On Wed, 11 Aug 2004 11:17:30 -0500, Robert P. Goldman
<rpgoldman at sift.info> wrote:
> I've been trying to get these guys to just statically compile the dang
> thing, but they don't seem to want to.

Statically compiling is basically the only way to go unless you want
to separate build packages for various distros and distro versions.

You can statically link with some libraries and dynamically link with
everything else.  Here is an example of normal dynamic linking on a
Debian box:

$ g++ -c -o test.o test.cpp
$ gcc -o test test.o -lstdc++
$ ldd ./test
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40029000)
        libm.so.6 => /lib/libm.so.6 (0x400e2000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40104000)
        libc.so.6 => /lib/libc.so.6 (0x4010d000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ strip test; wc -c test
24908 test

This is static linking:

(test.o compile is the same as above)
$ gcc -o test test.o -Wl,-a,archive -lstdc++ -Wl,-a,shared
$ ldd ./test
        libc.so.6 => /lib/libc.so.6 (0x40029000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ strip test; wc -c test
386940 test

This is the same as the above, but with dynamic linking of libm (which
isn't actually used by the test program):

$ gcc -o test test.o -Wl,-a,archive -lstdc++ -Wl,-a,shared -lm
$ ldd ./test
        libm.so.6 => /lib/libm.so.6 (0x40029000)
        libc.so.6 => /lib/libc.so.6 (0x4004b000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ strip test; wc -c test
386972 test

-- 
David Phillips <david at acz.org>
http://david.acz.org/

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list