This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc the gnu linker and the -z extract option
- From: Andrew Haley <aph at redhat dot com>
- To: eoin <eoin dot mcquillan at btinternet dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 28 Jul 2008 09:35:54 +0100
- Subject: Re: gcc the gnu linker and the -z extract option
- References: <18635245.post@talk.nabble.com>
eoin wrote:
> 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.
What should be in this meta library? Is it all the contents of all the libraries?
> 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.
"Lose the idenitity?" I don't know what you mean.
> I do this in Solaris using the -z extract option. I can't see how to do
> this in Linux using the GNU linker.
Compile every .o file with -fpic. Make them all into archives with ar.
Link all the archives together into a .so.
Andrew.