Subject: Putting shared libraries in an archive
To: None <port-mac68k@netbsd.org>
From: Roger Brown <rogerhb@xtra.co.nz>
List: port-mac68k
Date: 04/02/2000 08:05:53
Hello,

I am building a large project which makes heavy use of shared libraries
(it's an ORB).
I can build the libraries if I explicitly list the libraries in the link
command.
However this is a pain and makes the build lines look quite ugly.
I have since looked at using 'ar' to do this job, and it works wonderfully
on a couple
of ELF based systems (including Linux), where I add the shared libraries
into an
archive using 
    
    "ar r liborb.a  libmyobj.so"

then reference the archive with -Lmylibdir -lorb

However if I try this on NetBSD  (config says 'm68k-apple-netbsd1.4U') I get
a problem trying
to use link using the archive when building my second shared library, I
get...

    ld: Linker reserved symbol __GLOBAL_OFFSET_TABLE defined as type 7

Is this because it is not an ELF based system? Is there any way I can put
shared libraries
into an archive? For example is there a way to hide '__GLOBAL_OFFSET_TABLE'
or would this stop ld.so doing it's job?

Thanks

Roger