From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32418 invoked by alias); 31 Jul 2008 17:07:38 -0000 Received: (qmail 32408 invoked by uid 22791); 31 Jul 2008 17:07:38 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 Jul 2008 17:07:20 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m6VH7GdI010891; Thu, 31 Jul 2008 13:07:16 -0400 Received: from zebedee.pink (vpn-12-5.rdu.redhat.com [10.11.12.5]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m6VH7DUV027198; Thu, 31 Jul 2008 13:07:14 -0400 Message-ID: <4891F137.9020002@redhat.com> Date: Thu, 31 Jul 2008 22:15:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: eoin CC: gcc-help@gcc.gnu.org Subject: Re: gcc the gnu linker and the -z extract option References: <18635245.post@talk.nabble.com> <18759076.post@talk.nabble.com> In-Reply-To: <18759076.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg00331.txt.bz2 eoin wrote: > Ok - I now know better what I want to do. > > Basically using gcc I want to statically link a number of .as to a shared > object and dynamically link the rest. > > In Solaris I do -h -z muldefs -z allextract -Bstatic archives> -Bdynamic > > In gcc what I'm trying is -shared (I require this option due to a few other > things) -z muldefs -static -shared > > This however does not statically link the archives into the shared > object(acccording to ldd). Any ideas? -Wl,-whole-archive > > Thanks > > > eoin wrote: >> Hi, >> I'm a new poster here. I am porting some Solaris code over to Linux >> and using the GNU compiler and linker. Now I have a "meta >> library"(creating a "master" shared object from mayny shared objects) >> which creates fine in Solaris but in Linux it doesn't create as a meta >> library - ldd suggests that it depends on the libraries which were >> previously used to produce the meta library on solaris. >> Looking into this I can see that with every .so we effectively lose >> the identity and so with a metalibrary what we need to do is to "unravel" >> the .sos to produce the meta library. >> I do this in Solaris using the -z extract option. I can't see how to >> do this in Linux using the GNU linker. Anyone any ideas? >> >> Thanks >> >