Building Clang/LLVM from Trunk with UnitTests On broken presently

The following output from LLVM/Clang 3.3 on Debian and against GCC-4.8.1

CMakeFiles/ToolingTests.dir/ToolingTest.cpp.o:/home/mdriftmeyer/DeveloperProjects/LLVMProject/llvm/tools/clang/unittests/Tooling/ToolingTest.cpp:function clang::tooling::newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test::TestBody(): error: undefined reference to ‘clang::SyntaxOnlyAction::~SyntaxOnlyAction()’
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tools/clang/unittests/Tooling/ToolingTests] Error 1
make[1]: *** [tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/all] Error 2
make: *** [all] Error 2
mdriftmeyer@horus:~/DeveloperProjects/LLVMProject/cmake-clang-trunk$

I can turn off the unittests but I’d rather this got fixed.

And no I’m not deeply versed in C++, just yet. In fact, I’d prefer sticking to C and ObjC as long as possible, even though I’ll need to bite the bullet on C++ for stuff like Bullet Library, OpenCL in many cases and more for Numerical Analysis.

  • Marc

It’s a known issue:
http://llvm.org/bugs/show_bug.cgi?id=13124#c15

I think you need to use a combination of building with clang, building shared libs, enabling optimizations, and building the unit tests to trigger this.