The role of distributions &/or Unix flavors, where does pkg management stands - Psychology, Philosophy, and Licenses
Users browsing this thread: 1 Guest(s)
|
|||
One tip for doing static linking :
It is terribly hard to configure it, so instead of configuring it, it is possible to /not/ build the shared libraries, and only expose the libsomething.a to the compiler, which will pick it. That is exactly the same compiler flags! it just picks what's available to fulfill -lsomething among what is there. And given ./configure and other autotools works by launching cc nad check the outcome rather than stating out the presence of the files themself, the libsomething.a wil survive through all the piping of the autotools and the craziest of the makefiles. Yes, you have to configure it from the library's rather than though the program's package, but it works _nicely_! $ ldd $(which curl) linux-vdso.so.1 (0x00007ffd9b5f0000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5fc033b000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5fc031a000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5fc0159000) /lib64/ld-linux-x86-64.so.2 (0x00007f5fc0694000) $ ldd $(which gpg2) linux-vdso.so.1 (0x00007fff5f738000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2baafad000) /lib64/ld-linux-x86-64.so.2 (0x00007f2bab4d8000) Yes, these are not "true static binaries", but looks at the pile of dependency for compiling gpg2 and look-ma-no-configure-flags and still have all of the libraries statically linked ! Next step is to rm libc.so... Hmm, I'll wait a bit if you do not mind. ;) [edit] BTW, the ./configure flags in autotool style are --enable-shared=no --enable-static=yes [/edit] |
|||