我正在尝试将LLDB构建为Clang/LLVM的一部分。LLVM,Clang,Compiler和Extras build .但是,在使用其他组件进行构建时,LLVM存在问题。
目录结构是根据LLVM/Clang/LLDB指令设置的。LLDB上的文档位于建筑LLDB。下面是从build目录运行的,该目录位于llvm目录旁边(llvm是所有源代码被解压缩的地方):
$ 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编辑:遵循Matt的以下说明,我能够避免Undefined symbols SystemRuntimeMacOSX::Initialize and SystemRuntimeMacOSX::Terminate。但是这个建筑仍然死了,因为:
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.奇怪的是,lldbPluginSystemRuntimeMacOSX的处理方式与其他插件(如lldbPluginProcessMachCore )一样。相同的指令出现在相同的地方,如Cmake.txt。
主机平台为OSX10.8.5,x64,完全修补。Xcode版本为5.1.1 (5B1008) (这是最新版本)。
有人知道我应该执行哪些神奇的步骤来让lldb用LLVM和Clang编译吗?
100赏金编辑:在Clang 3.4.2配方的shell脚本中有一个带有我的菜谱的巴斯特宾。菜谱使用Missing-Makefile,Matt在下面提供了它。菜谱修补makefile,所以您不需要手动完成它。
150个赏金编辑:Cos的答案是最后一步。这个问题既需要马特的回答,也需要考斯的回答。Cos提供了一个更新的食谱。它可以在Clang 3.4.2配方(最终)上使用。
发布于 2014-08-17 00:21:49
您需要在脚本中添加以下修补程序:
sed -i '' '\|DIRS += Process/mach-core|a\
DIRS += SystemRuntime/MacOSX\
' llvm/tools/lldb/source/Plugins/Makefile你最新的食谱
发布于 2014-08-02 11:53:46
我相信吉姆以上的建议可能是最好的选择。但是,我在构建llvm+clang+lldb 3.4时也遇到了这个问题。
我把问题缩小到一个特定的插件上,专门针对OS,而不是通过Make构建。这是一个构建系统错误,由此提交修复:
https://github.com/llvm-mirror/lldb/commit/7a53199e140843235d2bd2b12182ceb764419c8a
您可以使用上面的提交作为指南。要成功构建,实际上只需要进行两个更改。我只是修补了我的本地副本。
lldb/lib/Makefile:"lldbPluginSystemRuntimeMacOSX.a“需要添加到第98行之后
需要创建具有以下内容的lldb/source/Plugins/SystemRuntime/MacOSX/Makefile:
##===- source/Plugins/SystemRuntime/MacOSX/Makefile ---------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
LLDB_LEVEL := ../../../..
LIBRARYNAME := lldbPluginSystemRuntimeMacOSX
BUILD_ARCHIVE = 1
include $(LLDB_LEVEL)/Makefile完成所有这些工作后,我就完成了构建,并获得了一个功能良好的liblldb.dylib版本,这正是我所追求的。希望这能有所帮助!
发布于 2014-07-24 20:09:40
我通常是在MacOS X上使用Xcode项目构建的,只需获取lldb源代码,然后执行以下操作:
cd lldb
xcodebuild -configuration Debug或者,如果您也想调试Clang方面的内容:
xcodebuild -configuration DebugClang您甚至不需要获取llvm源代码,如果它们不存在,Xcode项目将为您检查它们(但不会覆盖您想要在分支或其他地方构建的版本)。
托特·伊尔德现在为我做得很好。
在lldb-dev邮件列表中还有其他人确实使用Makefile构建,如果您出于某种原因想以这种方式构建它,您可能会问there.some。
https://stackoverflow.com/questions/24923650
复制相似问题