jww
jww

Reputation: 102376

Cannot build lldb - 'atomic' file not found

I'm trying to build lldb that's part of Clang/LLVM's 3.4.2 downloads at LLVM Download Page.

I can build LLVM, Clang, Compiler-RT and Extras. However, when I add LLDB to my recipe, the build fails:

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 was unpacked next to Clang as requested per Building LLDB:

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

LLDB is being built in a build directory as requested (as is everything else):

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

I found a similar issue discussed at LLDB @ Mac OSX: build on Snow Leopard (still) supported?. However, the suggested solution is to turn some knobs with xcodebuild from the command line. I'm not using Xcode, so its not an alternative for me.

My environment is OS X 10.8.5, x64, fully patched. Xcode version 5.1.1 (5B1008). I have Clang 3.4.2 installed in usr/local/ (without lldb), but I don't believe its being used.

How does one build lldb from the command line?

Upvotes: 2

Views: 10206

Answers (2)

Mattie
Mattie

Reputation: 3028

You must use both --enable-libcpp --enable-cxx11 for configuring an llvm build with lldb included. However, if you are trying to build with 3.4, you'll run into another issue. See this question here for a way to resolve this.

Undefined symbols SystemRuntimeMacOSX::Initialize and SystemRuntimeMacOSX::Terminate

Upvotes: 0

Icarus3
Icarus3

Reputation: 2350

Add "--enable-cxx11" switch while running "configure" script.

By default c++11 is disabled.

For more information run "configure --help"

Upvotes: 4

Related Questions