无法构建 lldb - 找不到"原子"文件

Cannot build lldb - 'atomic' file not found

本文关键字:原子 文件 找不到 构建 lldb      更新时间:2023-10-16

我正在尝试构建lldb,这是Clang/LLVM的3.4.2下载的一部分在LLVM下载页面

我可以构建LLVM, Clang, Compiler-RT和其他工具。然而,当我将LLDB添加到我的配方时,构建失败:

llvm[3]: Compiling lldb.cpp for Release+Asserts build
llvm[3]: Compiling lldb-log.cpp for Release+Asserts build
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/lldb-log.cpp:10:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-private-log.h:17:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-private.h:19:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-public.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-defines.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-types.h:14:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-forward.h:15:
/Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/Utility/SharingPtr.h:22:10: fatal error: 
      'atomic' file not found
#include <atomic>
         ^
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/lldb.cpp:12:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-private.h:19:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-public.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-defines.h:13:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-types.h:14:
In file included from /Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/lldb-forward.h:15:
/Users/jeffrey/Clang-3.4.2/llvm/tools/lldb/source/../include/lldb/Utility/SharingPtr.h:22:10: fatal error: 
      'atomic' file not found
#include <atomic>
         ^
1 error generated.

LLDB被解包在Clang旁边,根据要求,每个建筑LLDB:

llvm
|
`-- tools
    |
    +-- clang
    |
    `-- lldb

LLDB正在按照请求在构建目录中构建(与其他所有内容一样):

mkdir build
cd build
../llvm/configure --enable-optimized --prefix=/usr/local
make -j4

我在LLDB @ Mac OSX上发现了一个类似的问题:在雪豹上构建(仍然)支持?但是,建议的解决方案是在命令行中使用xcodebuild进行一些操作。我不使用Xcode,所以它不是我的替代品。

我的环境是OS X 10.8.5, x64,完全修补。Xcode版本5.1.1 (5B1008)。我有Clang 3.4.2安装在usr/local/(没有lldb),但我不相信它被使用。

如何从命令行构建lldb ?

在运行"configure"脚本时添加"——enable-cxx11"开关。

c++11默认禁用

更多信息运行"configure——help"

必须同时使用——enable-libcpp——enable-cxx11来配置包含lldb的llvm构建。但是,如果您尝试使用3.4进行构建,则会遇到另一个问题。

未定义符号SystemRuntimeMacOSX::Initialize和SystemRuntimeMacOSX::Terminate