[cfe-dev] clang + libcxx + ninja

Peter Stirling peter at pjstirling.plus.com
Sun Apr 5 14:42:47 PDT 2015


Hi,
Since clang tools currently choke when using the gcc 4.9.2 libstdc++ 
headers (and 4.8.3, and 4.8.2, and testing against older versions is 
seriously inconvenient), I decided to try libcxx to work around it. I 
checked out the source as described in [1], but that caused the llvm 
build to fail with the following error:

[9/24] Performing configure step for 'libcxx_tsan'
FAILED: cd 
/home/peter/Programming/llvm/ninja/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build 
&& /usr/bin/cmake -P 
/home/peter/Programming/llvm/ninja/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure.cmake 
&& /usr/bin/cmake -E touch 
/home/peter/Programming/llvm/ninja/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure
CMake Error at 
/home/peter/Programming/llvm/ninja/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure.cmake:16 
(message):
   Command failed: 1

    '/usr/bin/cmake' 
'-DCMAKE_C_COMPILER=/home/peter/Programming/llvm/ninja/./bin/clang' 
'-DCMAKE_CXX_COMPILER=/home/peter/Programming/llvm/ninja/./bin/clang' 
'-DCMAKE_C_FLAGS= -fsanitize=thread' '-DCMAKE_CXX_FLAGS= 
-fsanitize=thread' '-DCMAKE_BUILD_TYPE=Release' 
'-DCMAKE_INSTALL_PREFIX:PATH=/home/peter/Programming/llvm/ninja/projects/compiler-rt/lib/tsan/libcxx_tsan' 
'-GNinja' '/home/peter/Programming/llvm/llvm/projects/libcxx'

   See also

/home/peter/Programming/llvm/ninja/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure-*.log

Close inspection reveals that it tries to run cmake passing -GNinja (the 
same as the main build) but doesn't supply -DCMAKE_MAKE_PROGRAM. Editing 
the file [2] to inject the missing parameter lets the build succeed, but 
as that file is generated, this edit needs to be repeated sometimes when 
I update svn, and I'm not sure where it is generated from for a more 
permanent fix.

[1] http://libcxx.llvm.org/
[2] 
$BUILD/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure.cmake




More information about the cfe-dev mailing list