failing bootstrap: C++11 or greater is required but the compiler does not support c++11

several hours ago one of the bots that does a bootstrap started to fail
(http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer)

CMake Error at projects/libcxx/CMakeLists.txt:365 (message):
  C++11 or greater is required but the compiler does not support c++11

I can reproduce it locally with

cmake -GNinja -DCMAKE_CXX_COMPILER=clang++ ~/llvm

Goes away if I remove -GNinja. (!!!)

Does anyone else see this?

I can’t reproduce right away. I wonder if the check for the -std=c++11 flag is failing due to the earlier error about failing to find libatomic.

When these bots start failing?

/Eric

started with http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/1380 (Fri Dec 9 18:42:04 2016)
The previous one (Fri Dec 9 17:41:56 2016) was fine.
There was just one revision between these runs (mine), but reverting it does not help.
Maybe an update in Ubuntu 14.04 broke this?

So it seems that libatomic went missing between build #1379 and #1380, so I
don't think this is related to the -std=c++11 failure. Instead it seems
likely that the compile test for -std=c++11 is failing due to
mis-configuring -latomic.

Can you confirm the bot has libatomic installed?

You shouldn't need it on x86-64. The issue there is that cmake is reporting, incorrectly:
-- Performing Test LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed

despite that previously in the same run, the same test configuring llvm itself worked:
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success

I suspect that the flags change has somehow caused *all* compiler invocations to fail, and that results in both the erroneously-failed atomic check and the erroneously-failed std=c++11 check.

FTR, I’ve disabled libcxx checkout on that particular bot to make it green.
The problem remains, of course. :frowning:

I can reliably reproduce the issue on linux with the following CMake command line:

cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_PARALLEL_LINK_JOBS=8 -DCMAKE_C_COMPILER=$HOME/out/llvm/bootstrap/bin/clang -DCMAKE_CXX_COMPILER=$HOME/out/llvm/bootstrap/bin/clang++ -DLLVM_USE_SANITIZER=Address -DLLVM_USE_SANITIZE_COVERAGE=YES -DLLVM_ENABLE_ASSERTIONS=ON ~/src/llvm/

  • Performing Test LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB
    – Performing Test LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
    – Looking for __atomic_fetch_add_8 in atomic
    – Looking for __atomic_fetch_add_8 in atomic - not found
    CMake Warning at projects/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake:45 (message):
    Host compiler appears to require libatomic, but cannot find it.
    Call Stack (most recent call first):
    projects/libcxx/cmake/config-ix.cmake:47 (include)
    projects/libcxx/CMakeLists.txt:370 (include)

– Performing Test LIBCXX_HAS_WX_FLAG
– Performing Test LIBCXX_HAS_WX_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_WX_FLAG
– Performing Test LIBCXX_HAS_NO_WX_FLAG - Failed
– Performing Test LIBCXX_HAS_EHSC_FLAG
– Performing Test LIBCXX_HAS_EHSC_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_EHS_FLAG
– Performing Test LIBCXX_HAS_NO_EHS_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_EHA_FLAG
– Performing Test LIBCXX_HAS_NO_EHA_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_GR_FLAG
– Performing Test LIBCXX_HAS_NO_GR_FLAG - Failed
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - not found
– Looking for ccos in m
– Looking for ccos in m - not found
– Looking for clock_gettime in rt
– Looking for clock_gettime in rt - not found
– Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG
– Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG - Failed
CMake Error at projects/libcxx/CMakeLists.txt:423 (message):
C++11 or greater is required but the compiler does not support c++11

– Configuring incomplete, errors occurred!
See also “/usr/local/google/home/aizatsky/out/llvm/fuzzer/CMakeFiles/CMakeOutput.log”.
See also “/usr/local/google/home/aizatsky/out/llvm/fuzzer/CMakeFiles/CMakeError.log”.
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=OFF 23.14s user 12.73s system 100% cpu 35.826 total

Here are CMake logs (in case they could shed a light):

https://gist.github.com/anonymous/47a413ae30e2e6952f20d471b123def0

https://gist.github.com/anonymous/1c1e85a154912f5d3479cc75a6e27aa1

Mike, I know we’ve had a similar issue on a Linux distro that has some headers missing in the regular include path (I don’t remember the details). We’ve had to supply -DGCC_INSTALL_PREFIX= when building the stage1 compiler to get around the issue. It could be a similar problem that you’re experiencing.