In the spirit of the halving, let’s (approximately) halve the number of packages in depends. Remove the following packages:
0 bdb.mk
1 boost.mk
2 capnp.mk
3- expat.mk
4- fontconfig.mk
5- freetype.mk
6 libevent.mk
7 libmultiprocess.mk
8 libnatpmp.mk
9- libXau.mk
10- libxcb.mk
11- libxcb_util.mk
12- libxcb_util_image.mk
13- libxcb_util_keysyms.mk
14- libxcb_util_render.mk
15- libxcb_util_wm.mk
16- libxkbcommon.mk
17 miniupnpc.mk
18 native_capnp.mk
19 native_cctools.mk
20 native_libmultiprocess.mk
21 native_libtapi.mk
22 native_llvm.mk
23 packages.mk
24 qrencode.mk
25 qt.mk
26+ qtsowrap.mk
27 sqlite.mk
28 systemtap.mk
29- xcb_proto.mk
30- xproto.mk
31 zeromq.mk
This is done by loading all of Qt’s system dependencies at run-time, replacing them with an auto-generated wrapper library qtsowrap
:
See https://github.com/laanwj/qtsowrap for details.
After this, bitcoin-qt
has the same direct linking dependencies as bitcoind
and other binaries:
0$ ldd build/src/qt/bitcoin-qt
1 linux-vdso.so.1 (0x00007ffc01d83000)
2 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f76dbf1f000)
3 libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f76dbc00000)
4 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f76de7a7000)
5 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f76dba1f000)
6 /lib64/ld-linux-x86-64.so.2 (0x00007f76de7d7000)
(libdl.so.X needed too depending on the libc version)
For comparison, bitcoin-qt
from release 27.0 has the following:
0$ ldd ~/workdir/x86_64-linux-gnu/bitcoin-27.0/bin/bitcoin-qt
1 linux-vdso.so.1 (0x00007ffde7f73000)
2 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa098e37000)
3 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa098e2f000)
4 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa098d4f000)
5 libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fa098cff000)
6 libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fa09632f000)
7 libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007fa098cf7000)
8 libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007fa098cef000)
9 libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fa098ce7000)
10 libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007fa096000000)
11 libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fa098ccf000)
12 libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007fa095c00000)
13 libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fa098cbf000)
14 libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007fa098cb7000)
15 libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fa098caf000)
16 libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fa098c9f000)
17 libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007fa096327000)
18 libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007fa096307000)
19 libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa0962d7000)
20 libxkbcommon-x11.so.0 => /lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007fa0962c7000)
21 libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fa09627f000)
22 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa09625f000)
23 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa095e1f000)
24 /lib64/ld-linux-x86-64.so.2 (0x00007fa098e4f000)
25 libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fa09622f000)
26 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa09620f000)
27 libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fa095bc7000)
28 libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fa095e0f000)
29 libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007fa095bbf000)
30 libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa096207000)
31 libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa095800000)
32 libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fa095b97000)
33 libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fa095b7f000)
34 libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fa095b6f000)
This does not affect Windows or MacOS, which already do not have this problem of having to build half the OS in the dependency chain.
This will make it possible to add Wayland support to the release binaries without requiring the Wayland (or X) libraries to be installed on every system that runs them.
Reviewing/Testing
- Three relatively small Python scripts that generate everything:
- One important thing to test is that the resulting
bitcoin-qt
binaries work on a range of different Linux distributions (also older ones that people still care about). - i’ve added some review notes for the Qt patch here: https://github.com/laanwj/qtsowrap?tab=readme-ov-file#patching-qt . What is important to ensure is that
initialize_
happens before any calls to a library, as calling early will cause a crash. Forgetting to wrap a header will be found during linking, as the symbol will be wrong, so it’s not a review concern.
TODOs (all done)
(before merge, probably)
- laanwj/qtsowrap#3
- laanwj/qtsowrap#4