When compiling with the -fsanitize=fuzzer
flag to include libfuzzer in LLVM on macOS, I get the error:
libclang_rt.fuzzer_osx.a is not found
The LLVM/clang compiler I'm using is bundled with Xcode, 14.0.3.
When compiling with the -fsanitize=fuzzer
flag to include libfuzzer in LLVM on macOS, I get the error:
libclang_rt.fuzzer_osx.a is not found
The LLVM/clang compiler I'm using is bundled with Xcode, 14.0.3.
The issue is that the version of Clang bundled with LLVM in Xcode excludes libfuzzer.
There are two solutions to this problem:
brew install llvm
)libclang_rt.fuzzer*
files from the archive's lib/darwin
directory into the Xcode path for the libraries -
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/lib/darwin