public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: eoin <eoin.mcquillan@btinternet.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc the gnu linker and the -z extract option
Date: Thu, 31 Jul 2008 22:15:00 -0000	[thread overview]
Message-ID: <4891F137.9020002@redhat.com> (raw)
In-Reply-To: <18759076.post@talk.nabble.com>

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 <so name> -z muldefs -z allextract -Bstatic <list of
> archives> -Bdynamic
> 
> In gcc what I'm trying is -shared (I require this option due to a few other
> things) -z muldefs -static <list of archives> -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
>>
> 

      reply	other threads:[~2008-07-31 17:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-24 16:58 eoin
2008-07-28  9:39 ` Andrew Haley
2008-07-31 17:15 ` eoin
2008-07-31 22:15   ` Andrew Haley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4891F137.9020002@redhat.com \
    --to=aph@redhat.com \
    --cc=eoin.mcquillan@btinternet.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).