libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objc/2902: collect2 doesn't ...: libtool should use collect2?


From: John David Anglin
Subject: Re: objc/2902: collect2 doesn't ...: libtool should use collect2?
Date: Mon, 28 May 2001 01:11:34 -0400 (EDT)

> It also makes libtool use -nostdlib, which is most definitely wrong
> without a definition of output_verbose_link_cmd.  It appears to me
> that you have simply copied the definitions from ltcf-cxx.sh, where
> output_verbose_link_cmd is set whenever the compiler is GCC.
> ltcf-c.sh doesn't.

I did look at ltcf-cxx.sh.  My thinking on -nostdlib was that it allows
complete control of what is linked with the shared library.  In the case
of hpux, I believe that -nostdlib results in libgcc not being linked with
the shared archive.  Probably, linking the library with libgcc is the
correct thing to do.  However, it is not without problems since there
isn't a shared version of libgcc for hpux yet.  I missed the function
of output_verbose_link_cmd.

> I suppose the right solution for this problem is to introduce
> ltcf-objc.sh, perhaps mostly as a copy of ltcf-gcj.sh, where this
> problem should already have been taken care of.  [checks...]  No, it
> isn't, and this is certainly going to be a problem whenever libgcj is
> ported to HP-UX.  Perhaps we could kill both problems at the same
> time.  Or, ever better, we might introduce a ltcf-gcc.sh to take care
> of all languages supported by GCC in a generic way, instead of
> duplicating it over all language-specific scripts.

The later approach sounds much beter to me.  Anybody using libtool
to build a shared library with constructors doesn't want to have to add
a libtool configuration script.

> True.  But there's certainly a reason why we don't use GCC -shared on
> HP-UX; it was used on all OSs in which it worked, back in the early
> days of libtool.  I wish I knew what reason it was, in the case of
> HP-UX :-(

As far as I can tell, you can essentially do anything with -shared that
you can do with the linker directly in creating HPUX shared archives.
It just adds the linker `-b' option to create a shared archive and turns
off the addition of startfiles.  However, GCC -shared MUST be used when
creating a shared archive with GNU standard constructors because
it runs collect2 to process the library constructors and create the
library initialization/deinitialization routines.  I don't see there
is much choice here.

Using GCC -shared to build libstdc++ seems to work very well in the
3.0 prerelease.  The test results for the v3 library are much better
than ever before.

Dave
-- 
J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]