Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Date: Thu, 22 Nov 2001 00:21:07 +0100 From: Corinna Vinschen To: cygwin-apps AT cygwin DOT com Subject: Re: ld ---export--all --exclude-libs,? Message-ID: <20011122002107.C27931@cygbert.vinschen.de> Reply-To: cygwin-apps AT cygwin DOT com Mail-Followup-To: cygwin-apps AT cygwin DOT com References: <20011121084158 DOT 22945 DOT qmail AT web14501 DOT mail DOT yahoo DOT com> <20011121110829 DOT B24327 AT cygbert DOT vinschen DOT de> <3BFBE824 DOT 6000007 AT ece DOT gatech DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3BFBE824.6000007@ece.gatech.edu>; from cwilson@ece.gatech.edu on Wed, Nov 21, 2001 at 12:45:08PM -0500 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 "convenience" > 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,--out-implib,libfoo.dll.a -Wl,--whole-archive libfoo1.a libfoo2.a -Wl,--no-whole-archive -lbar -lbaz Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc.