Main menu:


March 2014
M T W T F S S
« Feb   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archives

Arch Linux and static libraries

Last year or the one before, Arch Linux turned on the makepkg.conf option !staticlibs in the default configuration. This meant that after being compiled and while being packaged, static libraries get removed from the package. Packages that absolutely need static libraries can add options=(‘staticlibs’) to the respective PKGBUILD to keep the static libraries.

The advantage of this is smaller package sizes and an application that depends on libxml2 will automatically use the new libxml2 shared library if Arch Linux patches some security bug in libxml2.

But how about applications that have binaries and libraries in the same package? Take for example libarchive. Instead of using the --disable-static configure flag, the static libraries get removed at the end.
Is it the same thing? No. Without --disable-static, bsdtar and bsdcpio are statically linked against the internal libarchive library instead of libarchive.so resulting in a 1Megabye increase in package size over --disable-static.

If i build libarchive without --disable-static. /usr/bin/bsdtar is 623776 bytes but if I add --disable-static, it is only 56672 bytes.

Obviously not all packages use autotools or even accept the --disable-static configure flag, but I think Arch Linux should have added that configure flag to as many packages as possible before auto-removing static libraries.

Leave a Reply

Your email address will not be published. Required fields are marked *