I've got a Apple M2 Max macbook pro, running sequoia 15.0.1. I'm trying to follow the instructions for fuzzing on macos, but I'm running into trouble.
I reinstalled llvm via brew install, as the instructions indicated:
$ clang --version
Homebrew clang version 19.1.2
Target: arm64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/19.1.2/bin
$ clang++ --version
Homebrew clang version 19.1.2
Target: arm64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/19.1.2/bin
I've got our master branch checked out at e8f72aefd20049eac81b150e7f0d33709acd18ed:
$ git log --oneline -1
e8f72aefd20 (HEAD -> 2024-10-master, origin/master, origin/HEAD) Merge bitcoin/bitcoin#29877: tracing: explicitly cast block_connected duration to nanoseconds
And when I try to fuzz with the instructed preset, I get this:
$ cmake --preset=libfuzzer-nosan
Preset CMake variables:
BUILD_FOR_FUZZING="ON"
CMAKE_CXX_COMPILER="clang++"
CMAKE_C_COMPILER="clang"
SANITIZERS="fuzzer"
-- The CXX compiler identification is Clang 19.1.2
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SQLite3: /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include (found suitable version "3.43.2", minimum required is "3.7.17")
CMake Warning at CMakeLists.txt:227 (message):
BUILD_FOR_FUZZING=ON will disable all other targets and force
BUILD_FUZZ_BINARY=ON.
-- Performing Test CXX_SUPPORTS__WERROR
-- Performing Test CXX_SUPPORTS__WERROR - Success
-- Setting build type to "RelWithDebInfo" as none was specified
-- Performing Test CXX_SUPPORTS__G3
-- Performing Test CXX_SUPPORTS__G3 - Success
-- Performing Test LINKER_SUPPORTS__G3
-- Performing Test LINKER_SUPPORTS__G3 - Success
-- Performing Test CXX_SUPPORTS__FTRAPV
-- Performing Test CXX_SUPPORTS__FTRAPV - Success
-- Performing Test LINKER_SUPPORTS__FTRAPV
-- Performing Test LINKER_SUPPORTS__FTRAPV - Success
-- Performing Test LINKER_SUPPORTS__WL__FATAL_WARNINGS
-- Performing Test LINKER_SUPPORTS__WL__FATAL_WARNINGS - Success
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP - Success
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP_DYLIBS
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP_DYLIBS - Success
-- Performing Test LINKER_SUPPORTS__WL__HEADERPAD_MAX_INSTALL_NAMES
-- Performing Test LINKER_SUPPORTS__WL__HEADERPAD_MAX_INSTALL_NAMES - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test CXX_SUPPORTS__FSANITIZE_FUZZER
-- Performing Test CXX_SUPPORTS__FSANITIZE_FUZZER - Success
-- Performing Test LINKER_SUPPORTS__FSANITIZE_FUZZER_a797
-- Performing Test LINKER_SUPPORTS__FSANITIZE_FUZZER_a797 - Failed
CMake Error at CMakeLists.txt:377 (message):
Linker did not accept requested flags, you are missing required libraries.
-- Configuring incomplete, errors occurred!
Any suggestions for what I should try next?