This is the mail archive of the
mailing list for the Cygwin project.
Re: ld ---export--all --exclude-libs,?
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: cygwin-apps at cygwin dot com
- Date: Thu, 22 Nov 2001 10:37:59 +1100 (EST)
- Subject: Re: ld ---export--all --exclude-libs,?
--- Corinna Vinschen <firstname.lastname@example.org> wrote: > On Wed, Nov 21, 2001
at 12:45:08PM -0500, Charles Wilson wrote:
> > Corinna Vinschen wrote:
> > > Isn't the functionality you're searching for already in ld given by
> > > the --no-whole-archive options?
> > >
> > > gcc -shared -o cygfoo.dll $(OBJ)
> > > -Wl,--out-implib,libfoo.dll.a
> > > -Wl,--no-whole-archive -lbar -lbaz
> > >
> > > Or am I missing the point?
> > the problem is, --no-whole-archive applies to EVERY library, even
> > convenience libraries. For instance, a common autotools idiom is to
> > create various convenience libraries libsubunit1.a and libsubunit2.a.
> > These archives are intended to be included in the eventual .so (.dll)
> > and the internal symbols of libsubunit*.a are INTENDED to be exported
> > from that .so.
> > --no-whole-archive makes this idiom impossible; it is not granular
> > enough. Ralf's solution removes the whole purpose of the idiom --
> > what's the use of a "convenience" library if you use --no-whole-archive
> > and must then explicitly export every .o contained within the
> > "convenience" library? You're better off not creating the
> > library at all, and just explicitly adding the various .o files to your
> > link command line.
> But isn't that the purpose of --whole-archive? In the above
> example I can create the static libs libfoo1.a and libfoo2.a
> from $(OBJ) and then call
> gcc -shared -o cygfoo.dll
> -Wl,--whole-archive libfoo1.a libfoo2.a
> -Wl,--no-whole-archive -lbar -lbaz
Still, those symbols from static libbar.a and libbaz.a that are used by
cygfoo will be exported from cygfoo.dll. That can cause problems if another
dll or exe that depends on cygfoo.dll also needs code from static libbar.a
or libfoo.a. Thats the reason why the current pe-dll.c has default
exclude libs. The --exclude-libs option would fix more generally.
http://shopping.yahoo.com.au - Yahoo! Shopping
- Get organised for Christmas early this year!