FS#30993 - [pacman] Build statically
Attached to Project:
Pacman
Opened by جاك الفضة (jacksilver) - Friday, 03 August 2012, 12:28 GMT
Last edited by Allan McRae (Allan) - Monday, 11 January 2016, 04:23 GMT
Opened by جاك الفضة (jacksilver) - Friday, 03 August 2012, 12:28 GMT
Last edited by Allan McRae (Allan) - Monday, 11 January 2016, 04:23 GMT
|
Details
Description:
Pacman may break at any time because of the dynamically linked with many libraries : /lib/libalpm.so.7 /lib/libc.so.6 /lib/libcurl.so.4 /lib/libgpgme.so.11 /lib/libarchive.so.12 /lib/libcrypto.so.1.0.0 /lib/libssh2.so.1 /lib/librt.so.1 /lib/libssl.so.1.0.0 /lib/libz.so.1 /lib/libpthread.so.0 /lib/libassuan.so.0 /lib/libgpg-error.so.0 /lib/libacl.so.1 /lib/libattr.so.1 /lib/libexpat.so.1 /lib/liblzma.so.5 /lib/libbz2.so.1.0 /lib/libdl.so.2 It would be a more robust software if it was build statically. I would like to be able to use pacman without installing it if something is break. I do not care if this will be a fairly large binary as long as it works. If it can not be completely built statically (not sure it is possible for glibc), please make every effort to build static with the maximum number of possible libs. thanks جاك الفضة |
This task depends upon
Closed by Allan McRae (Allan)
Monday, 11 January 2016, 04:23 GMT
Reason for closing: Not a bug
Additional comments about closing: There is nothing stopping pacman being build statically.
Monday, 11 January 2016, 04:23 GMT
Reason for closing: Not a bug
Additional comments about closing: There is nothing stopping pacman being build statically.
https://aur.archlinux.org/packages.php?ID=19287
Are you sure about this ?
A static lib is just a bunch of .o files in AR archive ... It،s possible can build ".o", and then link them all with other .o contained in a ".a" archive and also link everything with some ".so" as far as I know ...
http://gcc.gnu.org/ml/gcc/2001-07/msg01444.html
it can be done.
If just only glibc and a few other is dynamics, it is fine as pacman is now a more robust software.
Attempting to do this results in a linker flags looks something like -Wl,-Bstatic -llibstatic1 -libstatic2 -Wl,-Bdynamic -libdyn1 -libdyn2
It's an extremely ugly hack, and it isn't guaranteed to work everywhere that pacman is portable to.
The GNU toolchain has evolved in such a way that compilation is assumed to be dynamic. Its the GNU/Linux way of doing things.
Can't verify PGP signatures, but otherwise, to my knowledge, fully operational.
Else, one could build it as I did: build toolchain with ct-ng to link against uClibc, then build pacman with it.
I think an AUR package is a good compromise between having any of this grossness touch the core repository and facilitating some extreme repair options for really messed up systems. For example, if you waited too long to make /lib a symlink or didn't read the instructions carefully, pacman-static can save you some headaches...
That said, I'd be happy if the official acl package didn't gratuitously remove libacl.a, as having a static libacl.a would make pacman-static just a tiny bit less ugly.
As a separate issue, this will not be used in Arch because 1) glibc should not be used for static linking and 2) Arch is removing static libraries.