Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Fix check whether -latomic needed #29177

Merged
merged 1 commit into from Jan 5, 2024

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jan 4, 2024

Clang >=15 still might need linking against libatomic.

We use std::atomic<std::chrono::seconds>::compare_exchange_strong in net_processing.cpp.

Addresses the #29165 (comment).

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 4, 2024

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.

@maflcko
Copy link
Member

maflcko commented Jan 4, 2024

Testing on a fresh install of Ubuntu 24.04 Noble: export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git --depth=1 && cd bitcoin && git fetch origin --depth=1 f8ca1357c8205ceff732dcfb0d2bad79b40b611b && git checkout f8ca1357c8205ceff732dcfb0d2bad79b40b611b && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 make automake cmake curl clang-17 llvm-17 g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison -y && ( cd depends && make DEBUG=1 HOST=i686-pc-linux-gnu NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) && ./autogen.sh && CONFIG_SITE="$PWD/depends/i686-pc-linux-gnu/share/config.site" ./configure CC='clang-17 -m32' CXX='clang++-17 -m32' --enable-fuzz --with-sanitizers=fuzzer && make -j $(nproc)

On master:

  CXXLD    test/fuzz/fuzz
/usr/bin/ld: libbitcoin_node.a(libbitcoin_node_a-net_processing.o): in function `(anonymous namespace)::PeerManagerImpl::BlockConnected(ChainstateRole, std::shared_ptr<CBlock const> const&, CBlockIndex const*)':
net_processing.cpp:(.text._ZN12_GLOBAL__N_115PeerManagerImpl14BlockConnectedE14ChainstateRoleRKSt10shared_ptrIK6CBlockEPK11CBlockIndex[_ZN12_GLOBAL__N_115PeerManagerImpl14BlockConnectedE14ChainstateRoleRKSt10shared_ptrIK6CBlockEPK11CBlockIndex]+0x1ef): undefined reference to `__atomic_compare_exchange'
/usr/bin/ld: libbitcoin_node.a(libbitcoin_node_a-net_processing.o): in function `(anonymous namespace)::PeerManagerImpl::SendMessages(CNode*)':
net_processing.cpp:(.text._ZN12_GLOBAL__N_115PeerManagerImpl12SendMessagesEP5CNode[_ZN12_GLOBAL__N_115PeerManagerImpl12SendMessagesEP5CNode]+0x6755): undefined reference to `__atomic_compare_exchange'
clang++-17: error: linker command failed with exit code 1 (use -v to see invocation)

This pull:

(all good)

@maflcko
Copy link
Member

maflcko commented Jan 4, 2024

lgtm ACK f8ca135

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 5, 2024

Guix builds (on x86_64)

File commit 737e588
(master)
commit 5ce5262
(master and this pull)
SHA256SUMS.part a05449ccd1eedf9d... fe8d60bbcf9ad8cd...
*-aarch64-linux-gnu-debug.tar.gz 566e2e720e510496... a685f4cdcb3aee69...
*-aarch64-linux-gnu.tar.gz ac229ee212444de0... 969f2526d0697eda...
*-arm-linux-gnueabihf-debug.tar.gz 102d6be068c3d6db... 89dc848df155e070...
*-arm-linux-gnueabihf.tar.gz d9dbd398b7ac417a... 3b842464ec317e40...
*-arm64-apple-darwin-unsigned.tar.gz 0e35063d34b37755... adcf46c22e631365...
*-arm64-apple-darwin-unsigned.zip 75cc4be9a95235df... 19ed760a0e0d3d5d...
*-arm64-apple-darwin.tar.gz 661ebadfcd81951b... 84ab633d7f83e5d0...
*-powerpc64-linux-gnu-debug.tar.gz 4e30d97f09a8ad90... fc13019f93b13e8b...
*-powerpc64-linux-gnu.tar.gz 2fa917b453e3b98e... 51a5f86e8669d447...
*-powerpc64le-linux-gnu-debug.tar.gz 57964282dce22f4d... aab298fdecb3a42c...
*-powerpc64le-linux-gnu.tar.gz ceb6f7cf6acdff9f... acf3ac47cfcd289f...
*-riscv64-linux-gnu-debug.tar.gz 436eb35b0015a18e... 3fbd1e7ee15b6d27...
*-riscv64-linux-gnu.tar.gz d3022d5be39d5c59... 25637002066d8a8c...
*-x86_64-apple-darwin-unsigned.tar.gz c5a222621368a649... 37e2a7aed74cb942...
*-x86_64-apple-darwin-unsigned.zip 3148c2407851a49f... bcb046a76fdd21d9...
*-x86_64-apple-darwin.tar.gz 0bd0c25b23aa186d... d25006a37829577a...
*-x86_64-linux-gnu-debug.tar.gz bba534832b7dd68f... cfa215a4e4fe9891...
*-x86_64-linux-gnu.tar.gz e8b23d8149cb6e00... 6514d464b471868f...
*.tar.gz 3f2dc263df892f77... 12b1625180444fb1...
guix_build.log 5b6f96ccdf1553af... b7b63b58106165ed...
guix_build.log.diff 55b083f7b7bcb07a...

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f8ca135

@fanquake fanquake merged commit c80f57b into bitcoin:master Jan 5, 2024
16 checks passed
@hebasto hebasto deleted the 240104-atomic branch January 5, 2024 11:17
hebasto added a commit to hebasto/bitcoin that referenced this pull request Jan 9, 2024
80b1ab6 fixup! cmake: Check system symbols (Hennadii Stepanov)

Pull request description:

  This PR mirrors changes from bitcoin#29177.

ACKs for top commit:
  TheCharlatan:
    ACK 80b1ab6

Tree-SHA512: b29f0a4872f1093af7157767fff77ff5dcc42a45f0f3cbe62c5e53a054890e969ee8bcdca6cbbc93e04dbde49203500f6f657223a7d56a68bbb6f1c54a7e57a6
Retropex pushed a commit to Retropex/bitcoin that referenced this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants