This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc the gnu linker and the -z extract option


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
>>
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]