------- Comment #1 from pluto at agmk dot net 2006-05-04 13:15 ------- (In reply to comment #0) > Hi! > > I would be interested in having the "gcc libraries" statically linked to my > binary, but still use one shared-object (a commercial library for which no > static version is available), so '-static' is not really an option, as far as > I > can tell...
e.g. libfoo.so is a commercial shared library. $ ldd libfoo.so libc.so.6 => /lib64/libc.so.6 (0x00002b388050d000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) $ cat exec.c extern void foo(); int main() { foo(); return 0; } $ gcc exec.c -o exec -static-libgcc -Wl,-rpath,. -L. -lfoo $ ldd exec libfoo.so => ./libfoo.so (0x00002b795f7fc000) libc.so.6 => /lib64/libc.so.6 (0x00002b795f917000) /lib64/ld-linux-x86-64.so.2 (0x00002b795f6e1000) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27419