build: Fix false positive CHECK_ATOMIC test #29859

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:240412-atomic changing 1 files +5 −2
  1. hebasto commented at 8:13 am on April 12, 2024: member

    On the master branch @ 0de63b8b46eff5cda85b4950062703324ba65a80, a building bitcoind with clang-15 for i686-pc-linux-gnu fails to link:

     0  CXXLD    bitcoind
     1/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): in function `std::remove_volatile<double>::type std::__atomic_impl::load<double>(double const*, std::memory_order)':
     2/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:948: undefined reference to `__atomic_load'
     3/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): in function `void std::__atomic_impl::store<double>(double*, std::remove_volatile<double>::type, std::memory_order)':
     4/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
     5/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): in function `void std::__atomic_impl::store<double>(double*, std::remove_volatile<double>::type, std::memory_order)':
     6/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
     7/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
     8/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): in function `std::remove_volatile<double>::type std::__atomic_impl::load<double>(double const*, std::memory_order)':
     9/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:948: undefined reference to `__atomic_load'
    10/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): in function `void std::__atomic_impl::store<double>(double*, std::remove_volatile<double>::type, std::memory_order)':
    11/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
    12/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-backup.o): in function `void std::__atomic_impl::store<double>(double*, std::remove_volatile<double>::type, std::memory_order)':
    13/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
    14/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
    15/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
    16/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: undefined reference to `__atomic_store'
    17/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-backup.o):/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:940: more undefined references to `__atomic_store' follow
    18clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    due to false positive CHECK_ATOMIC test in the configure script.

    This PR fixes this test.

  2. build: Fix false positive `CHECK_ATOMIC` test for clang-15 dd3e0fa125
  3. DrahtBot commented at 8:14 am on April 12, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, fanquake

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Build system on Apr 12, 2024
  5. maflcko commented at 9:19 am on April 12, 2024: member

    The same error happens with clang-18 locally, but why does CI pass?

    fad23a06469607689c4f637bb407c96af4902a27

  6. hebasto commented at 9:01 am on April 14, 2024: member

    The same error happens with clang-18 locally, but why does CI pass?

    fad23a0

    Depends on standard C++ library version?

  7. maflcko commented at 10:29 am on April 14, 2024: member

    The same error happens with clang-18 locally, but why does CI pass? fad23a0

    Depends on standard C++ library version?

    I can re-try, but my findings didn’t indicate that IIRC.

    In any case, the title needs to be adjusted to remove the clang-15, no?

  8. hebasto renamed this:
    build: Fix false positive `CHECK_ATOMIC` test for clang-15
    build: Fix false positive `CHECK_ATOMIC` test
    on Apr 14, 2024
  9. hebasto commented at 10:30 am on April 14, 2024: member

    In any case, the title needs to be adjusted to remove the clang-15, no?

    Updated.

  10. maflcko commented at 9:24 am on April 15, 2024: member

    For reference, on a fresh Ubuntu 24.04 Noble (which should be identical to the current CI config), it fails:

    0apt update && apt install clang-18 g++-multilib -y
    1clang++-18  -std=c++20 test.cpp -m32
    2
    3/usr/bin/ld: /tmp/test-9da16c.o: in function `std::__atomic_float<double>::store(double, std::memory_order)':
    4test.cpp:(.text._ZNSt14__atomic_floatIdE5storeEdSt12memory_order[_ZNSt14__atomic_floatIdE5storeEdSt12memory_order]+0x5a): undefined reference to `__atomic_store'
    5/usr/bin/ld: /tmp/test-9da16c.o: in function `std::__atomic_float<double>::load(std::memory_order) const':
    6test.cpp:(.text._ZNKSt14__atomic_floatIdE4loadESt12memory_order[_ZNKSt14__atomic_floatIdE4loadESt12memory_order]+0x47): undefined reference to `__atomic_load'
    7/usr/bin/ld: /tmp/test-9da16c.o: in function `std::atomic<std::chrono::duration<long long, std::ratio<1ll, 1ll> > >::compare_exchange_strong(std::chrono::duration<long long, std::ratio<1ll, 1ll> >&, std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::memory_order, std::memory_order)':
    8test.cpp:(.text._ZNSt6atomicINSt6chrono8durationIxSt5ratioILx1ELx1EEEEE23compare_exchange_strongERS4_S4_St12memory_orderS7_[_ZNSt6atomicINSt6chrono8durationIxSt5ratioILx1ELx1EEEEE23compare_exchange_strongERS4_S4_St12memory_orderS7_]+0x6e): undefined reference to `__atomic_compare_exchange'
    9clang++-18: error: linker command failed with exit code 1 (use -v to see invocation)
    
  11. maflcko commented at 1:45 pm on April 15, 2024: member

    On the master branch @ 0de63b8, a building bitcoind with clang-15 for i686-pc-linux-gnu fails to link:

    Can you add exact steps to reproduce, ideally starting from a fresh install of the operating system?

  12. maflcko commented at 8:46 pm on April 15, 2024: member
    Ok, I could reproduce by setting this CI to lunar or bookworm (I tried clang-15 and clang-16): FILE_ENV="./ci/test/00_setup_env_i686_multiprocess.sh" ./ci/test_run_all.sh. However, on jammy, mantic, and noble it passes.
  13. maflcko commented at 9:16 am on April 16, 2024: member
    review ACK dd3e0fa12534c9e782dc9c24d2e30b70a0d73176
  14. maflcko requested review from fanquake on Apr 16, 2024
  15. fanquake approved
  16. fanquake commented at 1:00 pm on April 17, 2024: member
    ACK dd3e0fa12534c9e782dc9c24d2e30b70a0d73176
  17. fanquake merged this on Apr 17, 2024
  18. fanquake closed this on Apr 17, 2024

  19. fanquake referenced this in commit 364bf01ff2 on Apr 17, 2024
  20. fanquake commented at 1:06 pm on April 17, 2024: member
    Backported to 27.x in #29888.
  21. hebasto deleted the branch on Apr 18, 2024

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-12-22 00:12 UTC

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