Skip to content

Fuzzing Bitcoin Core with clang-16 #31922

@yancyribbens

Description

@yancyribbens

Is there an existing issue for this?

  • I have searched the existing issues

Current behaviour

building fails during linking CXX executable bitcoin-wallet

[ 27%] Building CXX object src/util/CMakeFiles/bitcoin_util.dir/__/sync.cpp.o                                                                                            
[ 27%] Linking CXX static library libbitcoin_util.a                                                                                                                      
[ 27%] Built target bitcoin_util                                                                                                                                         
[ 27%] Building C object src/secp256k1/src/CMakeFiles/secp256k1_precomputed.dir/precomputed_ecmult.c.o                                                                   
[ 27%] Building C object src/secp256k1/src/CMakeFiles/secp256k1_precomputed.dir/precomputed_ecmult_gen.c.o                                                               
[ 27%] Built target secp256k1_precomputed                                                                                                                                
[ 28%] Building C object src/secp256k1/src/CMakeFiles/secp256k1.dir/secp256k1.c.o                                                                                        
[ 28%] Linking C static library ../lib/libsecp256k1.a                                                                                                                    
[ 28%] Built target secp256k1                                                                                                                                            
[ 28%] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o                                                                                        
[ 28%] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/init/bitcoin-wallet.cpp.o                                                                                   
[ 28%] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/wallet/wallettool.cpp.o                                                                                     
[ 28%] Linking CXX executable bitcoin-wallet                                                                                                                             
/usr/bin/ld: libbitcoin_common.a(bloom.cpp.o): undefined reference to symbol 'exp@@GLIBC_2.29'                                                                           
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line                                                                        
clang: error: linker command failed with exit code 1 (use -v to see invocation)                                                                                          
gmake[2]: *** [src/CMakeFiles/bitcoin-wallet.dir/build.make:138: src/bitcoin-wallet] Error 1                                                                             
gmake[1]: *** [CMakeFiles/Makefile2:650: src/CMakeFiles/bitcoin-wallet.dir/all] Error 2                                                                                  
gmake: *** [Makefile:146: all] Error 2

Expected behaviour

successful fuzz build.

Steps to reproduce

Using master branch:

cmake -DCMAKE_C_COMPILER=/usr/bin/clang-16 -DCMAKE_CXX_COMPILER=/usr/bin/clang-16 --preset=libfuzzer

Note here I am using clang-16 because the project fails to even begin the build process due to an error: uint256.h:133:19: error: call to consteval function 'util::ConstevalHexDigit' is not a constant expression. After finding the issue: #30947 I set the compiler to clang-16 which begins the build process but fails 28% through.

Relevant log output

No response

How did you obtain Bitcoin Core

Compiled from source

What version of Bitcoin Core are you using?

master@5b8fd7c3a6b8c9c6a9481d340c3bcc67e74993c3

Operating system and version

Debian GNU/Linux 12 (bookworm)

Machine specifications

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions