On Fri, 28 Mar 2008, Aidan Gauland wrote:

Last time I had a go at this I found that static is deprecated.... the
libc folks like Uli Drepper seem to be pushing _hard_ on the idea that
you should keep it dynamically linked. In fact, chunks of the glibc
won't work properly if you don't.

Sigh! Personally I hate this, but I when I try fight it I seem to be
pissing upwind in a Canterbury gale...

Options for you....

0) Trust the distro to have the right .so. This seems to be the
   preferred appoach.

1) Deliver the .so's with the application and use LD_LIBRARY_PATH or
LD_PRELOAD environment variables in a wrapper script. (eg. Firefox
isn't a binary, it's a script. firefox-bin is the binary.)

2) Create a libwhatever.a and explicitly link against -lwhatever.a

3) Bugger around with the -Wl, option to talk directly to ld instead
of via the gcc wrapper. (Hint the program gcc is just a wrapper that
parses options, adds some more and invokes the real preprocessor /
compiler / assembler / linker.)

Let me know how you get on.

Another handy resource for this class of question is the gcc-help
mailing list. (Don't try the "gcc" mailing list, that's for
development of gcc and your ears tend to get crisped if you ask there
about using gcc rather than writing gcc.)





John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : [EMAIL PROTECTED]
New Zealand

Reply via email to