2

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?

jww
  • 97,681
  • 90
  • 411
  • 885
  • Based on Icaru's answer, I think part of the solution is `--enable-cxx11 --enable-libcpp`. Its not clear to me why `configure` did not configure itself properly since these are *needed*, and not optional. Its only partial because there are more problems: [Undefined symbols SystemRuntimeMacOSX::Initialize and SystemRuntimeMacOSX::Terminate](http://stackoverflow.com/questions/24923650/undefined-symbols-systemruntimemacosxinitialize-and-systemruntimemacosxtermi). – jww Jul 24 '14 at 01:35

2 Answers2

4

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

By default c++11 is disabled.

For more information run "configure --help"

Icarus3
  • 2,310
  • 14
  • 22
  • Thanks Icarus. That died even quicker with `no member named 'move' in namespace 'std'; did you mean simply 'move'?`. Damn I hate working with Apple's junk. I really miss Windows and Linux.... – jww Jul 23 '14 at 23:43
  • I *think* I need `--enable-cxx11 --enable-libcpp`. But I'm not certain because there are more errors I'm trying to work trough. – jww Jul 24 '14 at 01:20
0

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

Community
  • 1
  • 1
Mattie
  • 2,868
  • 2
  • 25
  • 40