build: `test_bitcoin` link failure with `-flto=thin` & address sanitizer #33147

issue fanquake opened this issue on August 6, 2025
  1. fanquake commented at 3:46 PM on August 6, 2025: member
    clang --version
    clang version 20.1.8 (Fedora 20.1.8-3.fc43)
    Target: aarch64-redhat-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin
    Configuration file: /etc/clang/aarch64-redhat-linux-gnu-clang.cfg
    
    export CC=clang
    export CXX=clang++
    # CMAKE_INTERPROCEDURAL_OPTIMIZATION is -flto=thin for clang
    cmake -B build -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DSANITIZERS=address
    <snip>
    [ 54%] Built target bitcoin-util
    [ 55%] Built target bitcoin-wallet
    [ 72%] Built target bitcoin_node
    [ 73%] Built target bitcoind
    [ 73%] Linking CXX executable ../../bin/test_bitcoin
    /usr/bin/ld: error: Failed to link module ../../lib/libbitcoin_consensus.a.llvm.20628.arith_uint256.cpp: Expected at most one ThinLTO module per bitcode file
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    

    We have seen the same issue in oss-fuzz: https://github.com/google/oss-fuzz/blob/564805ba6f3d5b3b9386ae68aaa919ffcf8b50da/projects/bitcoin-core/build.sh#L33.

  2. fanquake added the label Build system on Aug 6, 2025
  3. hebasto commented at 4:11 PM on September 16, 2025: member

    Using a supported linker, such as lld on Ubuntu, helps.

  4. maflcko commented at 5:36 PM on September 25, 2025: member

    Can be closed as fixed? Edit: Or rather closed as upstream bug?

  5. maflcko added the label Upstream on Sep 25, 2025
  6. fanquake commented at 7:07 PM on September 29, 2025: member

    I think either, given we've got this working in oss-fuzz again.

  7. fanquake closed this on Sep 29, 2025


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: 2026-04-17 00:12 UTC

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