I'm trying to build LLDB as part of Clang/LLVM. LLVM, Clang, Compiler-RT and Extras build OK. However, LLVM has an issue when building with the other components.
The directory structure is set up according to LLVM/Clang/LLDB instructions. The docs on LLDB are located at Building LLDB. Below was run from the build
directory, which lies next to the llvm
directory (llvm
is where all sources were unpacked):
$ cd build
$ ../llvm/configure --enable-optimized --enable-cxx11 --enable-libcpp --prefix=/usr/local
...
$ make -j4
...
llvm[4]: Compiling ARM_DWARF_Registers.cpp for Release+Asserts build
llvm[4]: Compiling KQueue.cpp for Release+Asserts build
llvm[4]: Compiling PseudoTerminal.cpp for Release+Asserts build
llvm[4]: Compiling Range.cpp for Release+Asserts build
llvm[4]: Compiling SharingPtr.cpp for Release+Asserts build
llvm[4]: Compiling StringExtractor.cpp for Release+Asserts build
llvm[4]: Compiling StringExtractorGDBRemote.cpp for Release+Asserts build
llvm[4]: Compiling TimeSpecTimeout.cpp for Release+Asserts build
llvm[4]: Building Release+Asserts Archive Library liblldbUtility.a
llvm[3]: Linking Release+Asserts Shared Library liblldb.dylib
Undefined symbols for architecture x86_64:
"SystemRuntimeMacOSX::Initialize()", referenced from:
lldb_private::Initialize() in liblldbInitAndLog.a(lldb.o)
"SystemRuntimeMacOSX::Terminate()", referenced from:
lldb_private::Terminate() in liblldbInitAndLog.a(lldb.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/jwalton/Clang-3.4.2/build/Release+Asserts/lib/liblldb.dylib] Error 1
make[2]: *** [all] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1
EDIT: following Matt's instructions below, I was able to avoid Undefined symbols SystemRuntimeMacOSX::Initialize and SystemRuntimeMacOSX::Terminate
. But the build still dies with:
llvm[4]: Compiling ARM_DWARF_Registers.cpp for Release+Asserts build
llvm[4]: Compiling KQueue.cpp for Release+Asserts build
llvm[4]: Compiling PseudoTerminal.cpp for Release+Asserts build
llvm[4]: Compiling Range.cpp for Release+Asserts build
llvm[4]: Compiling SharingPtr.cpp for Release+Asserts build
llvm[4]: Compiling StringExtractor.cpp for Release+Asserts build
llvm[4]: Compiling StringExtractorGDBRemote.cpp for Release+Asserts build
llvm[4]: Compiling TimeSpecTimeout.cpp for Release+Asserts build
llvm[4]: Building Release+Asserts Archive Library liblldbUtility.a
make[3]: *** No rule to make target `/Users/jwalton/Clang-3.4.2/build/Release+Asserts/lib/liblldbPluginSystemRuntimeMacOSX.a',
needed by `/Users/jwalton/Clang-3.4.2/build/Release+Asserts/lib/liblldb.dylib'. Stop.
The odd thing is, lldbPluginSystemRuntimeMacOSX
is handled the same as other plugins like lldbPluginProcessMachCore
. The same directives appear in the same places like Cmake.txt
.
The host platform is OS X 10.8.5, x64, fully patched. Xcode version is 5.1.1 (5B1008) (which is the latest).
Does anyone know what magical steps I should perform to get lldb to compile with LLVM and Clang?
100 BOUNTY EDIT: There's a pastebin with my recipe in a shell script at Clang 3.4.2 recipe. The recipe uses Missing-Makefile
, and Matt provides it below. The recipe patches the makefile, so you won't need to do it manually.
150 BOUNTY EDIT: Cos' answer was the final step. This question need both Matt's answer and Cos' answer. Cos provided an updated recipe. Its available at Clang 3.4.2 Recipe (Final).