Build LLVM, Clang and LibFuzzer

22 views
Skip to first unread message

Darshana Das K

unread,
Apr 1, 2024, 1:02:02 PMApr 1
to libfuzzer
Hi,
I'm trying to build LibFuzzer in my macOS 14.4.1 arm64 architecture. I used the cmake command:

cmake -S llvm -B build -G Ninja \ -DLLVM_ENABLE_PROJECTS="clang;lldb" \ -DLLVM_ENABLE_RUNTIMES="libcxx" \ -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_TARGETS_TO_BUILD="AArch64" \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_USE_SANITIZER=Address \ -DLLVM_USE_SANITIZE_COVERAGE=On \ -DLLDB_USE_SYSTEM_DEBUGSERVER=ON \ -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \ -DCMAKE_OSX_ARCHITECTURES='arm64' \ -DCMAKE_CXX_FLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"

But then when I build it, I got the error:

llvm-project/llvm/tools/vfabi-demangle-fuzzer/vfabi-demangler-fuzzer.cpp:20:16: error: variable has incomplete type ‘SMDiagnostic’
20 | SMDiagnostic Err;
llvm-project/llvm/include/llvm/AsmParser/Parser.h:29:7: note: forward declaration of ‘llvm::SMDiagnostic’
29 | class SMDiagnostic;
llvm-project/llvm/tools/vfabi-demangle-fuzzer/vfabi-demangler-fuzzer.cpp:33:44: error: member access into incomplete type ‘llvm::Module’
33 | FunctionType::get(Type::getVoidTy(M->getContext()), false);
llvm-project/llvm/include/llvm/AsmParser/Parser.h:26:7: note: forward declaration of ‘llvm::Module’
26 | class Module;
2 errors generated.
[3998/4053] Building CXX object tools/llvm-r…/CMakeFiles/llvm-readobj.dir/ELFDumper.cpp.o
ninja: build stopped: subcommand failed.

Please give any idea on what is wrong here. Thanks a lot for your help.



Reply all
Reply to author
Forward
0 new messages