未定义的符号SystemRuntimeMacOSX :: Initialize和SystemRuntimeMacOSX :: Terminate [英] Undefined symbols SystemRuntimeMacOSX::Initialize and SystemRuntimeMacOSX::Terminate

查看:164
本文介绍了未定义的符号SystemRuntimeMacOSX :: Initialize和SystemRuntimeMacOSX :: Terminate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将LLDB构建为 Clang / LLVM 的一部分。 LLVM,Clang,Compiler-RT和Extras build OK。但是,当使用其他组件构建时,LLVM有一个问题。

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.

目录结构根据LLVM / Clang / LLDB指令设置。 LLDB上的文档位于构建LLDB 。下面是从位于 llvm 目录( llvm c)旁边的 / code>是所有来源解压缩的地方):

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 :按照以下Matt的说明,我是能够避免未定义的符号SystemRuntimeMacOSX :: Initialize和SystemRuntimeMacOSX :: Terminate 。但是构建仍然死机:

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.

奇怪的是, lldbPluginSystemRuntimeMacOSX 与其他插件相同,例如 lldbPluginProcessMachCore 。相同的指令出现在相同的地方,如 Cmake.txt

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.

主机平台是OS X 10.8.5 ,x64,完全修补。 Xcode版本是5.1.1(5B1008)(这是最新的)。

The host platform is OS X 10.8.5, x64, fully patched. Xcode version is 5.1.1 (5B1008) (which is the latest).

有没有人知道我应该执行什么神奇的步骤来使用LLVM和Clang来编译lldb?

Does anyone know what magical steps I should perform to get lldb to compile with LLVM and Clang?

100 BOUNTY EDIT :在 Clang 3.4.2食谱。该配方使用 Missing-Makefile ,Matt在下面提供。

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的答案是最后一步。这个问题需要马特的答案和考斯的答案。 Cos提供了更新的食谱。可在 Clang 3.4.2食谱(最终)

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).

推荐答案

您需要为脚本添加以下补丁:

You need to add following patch to your script:

sed -i '' '\|DIRS += Process/mach-core|a\
DIRS += SystemRuntime/MacOSX\
' llvm/tools/lldb/source/Plugins/Makefile

您更新的食谱

这篇关于未定义的符号SystemRuntimeMacOSX :: Initialize和SystemRuntimeMacOSX :: Terminate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆