build: remove linking librt for backwards compatibility #17738

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:remove_librt_back_compat changing 2 files +0 −7
  1. fanquake commented at 7:38 pm on December 12, 2019: member

    Now that we require glibc 2.17+, see #17538, we can remove linking librt for backwards compatibility purposes. The clock_* functions from librt were merged into glibc as part of the 2.17 release:

    • The clock_* suite of functions (declared in <time.h>) is now available directly in the main C library. Previously it was necessary to link with -lrt to use these functions. This change has the effect that a single-threaded program that uses a function such as `clock_gettime’ (and is not linked with -lrt) will no longer implicitly load the pthreads library at runtime and so will not suffer the overheads associated with multi-thread support in other code such as the C++ runtime library.

    Note that librt is already unused by the RISC-V and AARCH64 binaries as their librts don’t export any clock_* functions. As an example, you can find a diff of the arm32 vs arm64 librt symbols here.

    Below is the library usage for the v0.19.0.1 release (can delete these tables pre-merge).

    RISC-V

    0riscv/bin/bitcoin-cli: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1']
    1riscv/bin/bitcoin-qt: ['libpthread.so.0', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
    2riscv/bin/bitcoin-wallet: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
    3riscv/bin/bitcoind: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
    4riscv/bin/bitcoin-tx: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1']
    5riscv/bin/test_bitcoin: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
    

    AARCH64

    0aarch64/bin/bitcoin-cli: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
    1aarch64/bin/bitcoin-qt: ['libpthread.so.0', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
    2aarch64/bin/bitcoin-wallet: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
    3aarch64/bin/bitcoind: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
    4aarch64/bin/bitcoin-tx: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
    5aarch64/bin/test_bitcoin: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
    

    ARM LINUX GNUEABIHF

    0arm32/bin/bitcoin-cli: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
    1arm32/bin/bitcoin-qt: ['libpthread.so.0', 'librt.so.1', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
    2arm32/bin/bitcoin-wallet: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
    3arm32/bin/bitcoind: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
    4arm32/bin/bitcoin-tx: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
    5arm32/bin/test_bitcoin: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
    

    LINUX X86_64

    0x86_64/bin/bitcoin-cli: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
    1x86_64/bin/bitcoin-qt: ['libpthread.so.0', 'librt.so.1', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
    2x86_64/bin/bitcoin-wallet: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
    3x86_64/bin/bitcoind: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
    4x86_64/bin/bitcoin-tx: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
    5x86_64/bin/test_bitcoin: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
    

    LINUX i686

    0i686/bin/bitcoin-cli: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
    1i686/bin/bitcoin-qt: ['libpthread.so.0', 'librt.so.1', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
    2i686/bin/bitcoin-wallet: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
    3i686/bin/bitcoind: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
    4i686/bin/bitcoin-tx: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
    5i686/bin/test_bitcoin: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
    
  2. fanquake added the label Build system on Dec 12, 2019
  3. fanquake added the label Needs gitian build on Dec 12, 2019
  4. fanquake added the label Needs Conceptual Review on Dec 12, 2019
  5. laanwj commented at 7:41 pm on December 12, 2019: member
    Good clean up, concept ACK
  6. DrahtBot commented at 2:52 pm on December 13, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17740 (build: remove configure checks for win libraries we don’t link against by fanquake)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. DrahtBot removed the label Needs gitian build on Dec 14, 2019
  8. MarcoFalke commented at 5:51 pm on December 15, 2019: member
     0  CXXLD    qt/bitcoin-qt
     1make[2]: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/src'
     2make[1]: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/src'
     3Making all in doc/man
     4make[1]: Entering directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/doc/man'
     5make[1]: Nothing to be done for 'all'.
     6make[1]: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/doc/man'
     7make[1]: Entering directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu'
     8make[1]: Nothing to be done for 'all-am'.
     9make[1]: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu'
    10+ make -j1 -C src check-security
    11make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/src'
    12Checking binary security...
    13make: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/src'
    14+ make -j1 -C src check-symbols
    15make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/src'
    16Checking glibc back compat...
    17bitcoin-wallet: NEEDED library librt.so.1 is not allowed
    18test/test_bitcoin: NEEDED library librt.so.1 is not allowed
    19qt/bitcoin-qt: NEEDED library librt.so.1 is not allowed
    20Makefile:15542: recipe for target 'check-symbols' failed
    21make: *** [check-symbols] Error 1
    22make: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-i686-pc-linux-gnu/src'
    
  9. laanwj commented at 11:12 am on December 16, 2019: member
    Right, removing the AC_CHECK_LIB only removes the check for the lib, it doesn’t prevent linking against -lrt (though I’m not sure where this happens).
  10. fanquake force-pushed on Dec 18, 2019
  11. fanquake added the label Needs gitian build on Dec 18, 2019
  12. DrahtBot removed the label Needs gitian build on Dec 18, 2019
  13. fanquake commented at 12:52 pm on December 18, 2019: member
    I’ll update this PR shortly.
  14. fanquake added the label Waiting for author on Dec 18, 2019
  15. build: remove linking librt for backwards compatibility
    Now that we require glibc 2.17+, #17538, we can remove linking in librt
    for backwards compatibility purposes. The clock_* functions from librt
    were merged into glibc as part of the 2.17 release.
    
    * The `clock_*' suite of functions (declared in <time.h>) is now available
      directly in the main C library.  Previously it was necessary to link with
      -lrt to use these functions.  This change has the effect that a
      single-threaded program that uses a function such as `clock_gettime' (and
      is not linked with -lrt) will no longer implicitly load the pthreads
      library at runtime and so will not suffer the overheads associated with
      multi-thread support in other code such as the C++ runtime library.
    
    https://sourceware.org/ml/libc-announce/2012/msg00001.html
    
    Note that librt is already not linked by the RISC-V and AARCH64 binaries.
    f7453dcc03
  16. fanquake force-pushed on Dec 31, 2019
  17. fanquake removed the label Needs Conceptual Review on Dec 31, 2019
  18. fanquake removed the label Waiting for author on Dec 31, 2019
  19. fanquake added the label Needs gitian build on Dec 31, 2019
  20. DrahtBot removed the label Needs gitian build on Jan 1, 2020
  21. MarcoFalke deleted a comment on Jan 2, 2020
  22. MarcoFalke added the label Waiting for author on Jan 2, 2020
  23. MarcoFalke deleted a comment on Jan 2, 2020
  24. MarcoFalke deleted a comment on Jan 2, 2020
  25. MarcoFalke removed the label Waiting for author on Jan 2, 2020
  26. MarcoFalke added the label Needs gitian build on Jan 2, 2020
  27. DrahtBot commented at 10:01 am on January 3, 2020: member

    Gitian builds

    File commit 35fff5be60e853455abc24713481544e91adfedb(master) commit b0fb787ee07644f68cce2075a5eed87ee7910a6d(master and this pull)
    bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz 1a1b79c30ee23b1e... 1810d981704fc199...
    bitcoin-0.19.99-aarch64-linux-gnu.tar.gz 4f5477e988e15339... 1ec2a04162e367fd...
    bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz 907d28fc95980468... d5c6f7547c971799...
    bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz e55899ead1a7ff56... 8e886f3742c9603b...
    bitcoin-0.19.99-i686-pc-linux-gnu-debug.tar.gz 95fa4bccc8b22ac0... 30b720bfa981e33b...
    bitcoin-0.19.99-i686-pc-linux-gnu.tar.gz 340c796226da90c7... 1b4f7da4722589ac...
    bitcoin-0.19.99-osx-unsigned.dmg 1c5ab941efd90df4... cf23d9d47a9e594e...
    bitcoin-0.19.99-osx64.tar.gz e0d2d4ef7befbf1f... 164d56e9248c6576...
    bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz 7fb3888850d15c57... d21bc7a3cd787baf...
    bitcoin-0.19.99-riscv64-linux-gnu.tar.gz c6bd3037c22bbde5... 7953c442e528a871...
    bitcoin-0.19.99-win64-debug.zip a2369f394ffcb551... 17e6311823e4bb52...
    bitcoin-0.19.99-win64-setup-unsigned.exe ffc23fa5abc3ca5f... e542dd240734c2cf...
    bitcoin-0.19.99-win64.zip 2d13e80f0011ce7d... ab8cf0147dfbd308...
    bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz 2a4aa0a81c4d2591... 14c18621082e7df8...
    bitcoin-0.19.99-x86_64-linux-gnu.tar.gz 8940a74e71b82107... 29b735889b8337d4...
    bitcoin-0.19.99.tar.gz 7703c9c861b5b755... 4f96eb7a744b6ae7...
    bitcoin-core-linux-0.20-res.yml 5db46f5eca4bb180... de2de4dc06f2915c...
    bitcoin-core-osx-0.20-res.yml 9db10d1794650fb3... 1171202f97a167b2...
    bitcoin-core-win-0.20-res.yml 89078fed82c8928e... b6d2c3a081952092...
    linux-build.log a3067a2425690fd1... 6d573d80cd9413fb...
    osx-build.log a15a76ffd1535083... d3feeacb6fecd74d...
    win-build.log 615dbd3684fcd0b0... 64090cab2707e563...
    bitcoin-core-linux-0.20-res.yml.diff a3701b2eda766c01...
    bitcoin-core-osx-0.20-res.yml.diff 87b4fa894224d400...
    bitcoin-core-win-0.20-res.yml.diff 2368d10d4efe0668...
    linux-build.log.diff 662c885501f1cc05...
    osx-build.log.diff f7429c55ae3ff50b...
    win-build.log.diff 7adfe0aa8bbe6cbc...
  28. DrahtBot removed the label Needs gitian build on Jan 3, 2020
  29. laanwj commented at 9:21 pm on January 22, 2020: member
    ACK f7453dcc0386a4a1162ced1a490c096afa13178a
  30. laanwj referenced this in commit 7a311fa54a on Jan 22, 2020
  31. laanwj merged this on Jan 22, 2020
  32. laanwj closed this on Jan 22, 2020

  33. fanquake deleted the branch on Jan 23, 2020
  34. sidhujag referenced this in commit dc4da91312 on Jan 24, 2020
  35. deadalnix referenced this in commit a21b1c528a on Apr 30, 2020
  36. ftrader referenced this in commit 67a3ed1a70 on Aug 17, 2020
  37. sidhujag referenced this in commit 9766374435 on Nov 10, 2020
  38. UdjinM6 referenced this in commit ccc223d231 on Aug 30, 2021
  39. UdjinM6 referenced this in commit 38a36dedf4 on Sep 7, 2021
  40. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me