This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ios_base vanishing from shared objects


On Mon, Mar 19, 2001 at 01:37:35AM -0500, Phil Edwards wrote:
> I thought so at first -- after all, the compiler itself doesn't link up
> all the .o's into a .so, the linker does.  But then I took a closer look
> at what libtool was doing.
> 
> (paraphrasing the lines here)  It's turning
> 
>     libtool xgcc libmath.la libsupc++convenience.la ios.lo ...all the
>     other src .lo files... -o libstdc++.la
> 
> into
> 
>     xgcc -whole-archive libmath.a libsupc++convenience.a
>     -no-whole-archive -shared -o libstdc++.so
> 
> Notice something missing?  Like, all of the .lo files from the build?

Something funky is up with libtool, or possibly my invocation of it.
(Neither of which has changed lately AFAICT.)

Somewhere the libtool variable build_libtool_libs is being changed to equal
"no".  And it needs to be "yes".  I don't know which of the many assignment
inside libtool is changing it (oh, for watchpoint abilities inside Bourne
shell *grin*).

Anyhow, it gets changed to "no" during compile mode, which means that PIC
code is not produced by libtool.  So every source file only gets built once,
and all the .lo's pic_object settings are "none".

Which in turn means that in link mode, none of the .lo's are included in
the libobjs variable in

    # Commands used to build and install a shared archive.
    archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags
       \${allow_undefined_flag} \${wl}-soname \$wl\$soname -o \$lib"

In fact, $libobjs is empty.  Which explains why the command generated by
libtool to create the .so goes from "-shared" right to the whole-archive'd
libmath and libsupc++ parts.


And this is where I need help.  I don't know why build_libtool_libs gets
turned off, or even what it means exactly.  I'm using a fresh-from-scratch
build directory with everything getting generated correctly, I think...?

Phil
P.S.- We use LIBSUPCXX_FLAGS in libsupc++ and src, but only set it in the
former.  Duplicating the setting in src/Makefile.am (to add -prefer-pic
to the libtool call) doesn't change anything.

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]