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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

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

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

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

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

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

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

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

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

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

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Oct 24, 2024
c75a0d4 Merge bitcoin#29177: build: Fix check whether `-latomic` needed (fanquake)
f670118 Merge bitcoin#28851: build: Patch Qt to handle minimum macOS version properly (fanquake)
685ee8a Merge bitcoin#28884: doc: remove x86_64 build assumption from depends doc (fanquake)
47f6126 Merge bitcoin#28881: doc: remove mention of missing bdb being a configure error (fanquake)
a9021db Merge bitcoin#28777: doc: update docs for `CHECK_ATOMIC` macro (fanquake)
d5e15df Merge bitcoin#26839: Add support for RNDR/RNDRRS for AArch64 on Linux (Andrew Chow)
5aedcbf Merge bitcoin#28778: depends: drop -O1 workaround from arm64 apple Qt build (fanquake)
95a8d8c Merge bitcoin#21161: Fee estimation: extend bucket ranges consistently (glozow)
f4ea48e Merge bitcoin#28693: build: Include `config/bitcoin-config.h` explicitly in `util/trace.h` (fanquake)
f160e0d Merge bitcoin#28691: refactor: Remove CBlockFileInfo::SetNull (fanquake)
0278163 Merge bitcoin#28697: fuzz: Increase merge -rss_limit_mb (fanquake)
90a1fb0 Merge bitcoin#28650: fuzz: Merge with -set_cover_merge=1 (fanquake)
f007abd Merge bitcoin#28459: build: add `-mbranch-protection=bti` (aarch64) to hardening flags (fanquake)
af8d124 Merge bitcoin#28624: docs: fix typo (fanquake)
c740264 Merge bitcoin#28532: qt: enable` -ltcg` for windows under LTO (fanquake)
ccd3920 Merge bitcoin#28556: doc: fix link to developer-notes.md file in multiprocess.md (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK c75a0d4

Tree-SHA512: 035dc3fa9812c7f381946ae4798b8e729a58b38a090d94502a8d992e9cfaab3307173c602d7b782c637a79c5c41b62570dc73bb4bb367e4505a039964926181b
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.

4 participants