This increases compatibility with older linux distributions.
0 2943584 Mar 20 11:43 32/bitcoin-cli
1 4376728 Mar 20 11:43 32/bitcoin-cli.static
2 7748512 Mar 20 11:43 32/bitcoind
3 9140856 Mar 20 11:43 32/bitcoind.static
4 12164000 Mar 20 11:43 32/bitcoin-qt
5 9740608 Mar 20 11:43 32/test_bitcoin
6 8420256 Mar 20 11:43 32/test_bitcoin-qt
7 3103728 Mar 20 11:53 64/bitcoin-cli
8 4355112 Mar 20 11:53 64/bitcoin-cli.static
9 7773680 Mar 20 11:53 64/bitcoind
10 8890088 Mar 20 11:53 64/bitcoind.static
11 12226032 Mar 20 11:53 64/bitcoin-qt
12 9860528 Mar 20 11:53 64/test_bitcoin
13 8457776 Mar 20 11:53 64/test_bitcoin-qt
A warning shown during build is:
0 warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Note I have not explicitly disabled hardening/-pie in this build. This makes that the 32-bit version still has a dependency on dynamic libc.so even though it is statically linked:
0$ ldd 32/bitcoind.static
1 statically linked
2$ readelf -a 32/bitcoind.static |grep interpreter
3 [Requesting program interpreter: /usr/lib/libc.so.1]
Not sure how much of an issue this is on true 32-bit systems. It needs to be tested. This is not the case for the 64-bit build:
0$ ldd 64/bitcoind.static
1 not a dynamic executable
2$ readelf -a 64/bitcoind.static |grep interpreter
3(nothing)
Edit: v2: -pie now explicitly disabled for 32-bit build as it was unusable otherwise.
Tested on:
- Debian 7.2 64-bit: OK (tested by me)
- Ubuntu 10.04.4 LTS 64-bit: OK (tested by me)
- Ubuntu 10.04.4 LTS 32-bit: OK (tested by me, v2)
- CentOS 6.5 64bit: OK (tested by alexeft on forums and anton000, v2)
- CentOS 6.5 32bit: OK (tested by anton000, v2)