llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.33k stars 11.7k forks source link

llvm bootstrap failed with only libcxx even if LLVM_ENABLE_LIBCXX=ON #42450

Open llvmbot opened 5 years ago

llvmbot commented 5 years ago
Bugzilla Link 43105
Version trunk
OS Linux
Attachments config_failed.Dockerfile
Reporter LLVM Bugzilla Contributor
CC @ldionne

Extended Description

Overview: '-stdlib=libc++' flag won't be used when probing CXX compiler

Steps to Reproduce: docker build . -f config_failed.Dockerfile, config_failed.Dockerfile attached.

Actual Results:

-- Check for working CXX compiler: /root/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang++ -- Check for working CXX compiler: /root/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang++ -- broken CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message): The C++ compiler "/root/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang++" is not able to compile a simple test program. It fails with the following output: Change Dir: /root/failed_config/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_33d99/fast" /usr/bin/make -f CMakeFiles/cmTC_33d99.dir/build.make CMakeFiles/cmTC_33d99.dir/build make[1]: Entering directory '/root/failed_config/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_33d99.dir/testCXXCompiler.cxx.o /root/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang++ -o CMakeFiles/cmTC_33d99.dir/testCXXCompiler.cxx.o -c /root/failed_config/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTC_33d99 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_33d99.dir/link.txt --verbose=1 /root/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang++ CMakeFiles/cmTC_33d99.dir/testCXXCompiler.cxx.o -o cmTC_33d99 /usr/bin/ld: cannot find -lstdc++ clang-8: error: linker command failed with exit code 1 (use -v to see invocation) CMakeFiles/cmTC_33d99.dir/build.make:97: recipe for target 'cmTC_33d99' failed make[1]: *** [cmTC_33d99] Error 1 make[1]: Leaving directory '/root/failed_config/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_33d99/fast' failed make: *** [cmTC_33d99/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:49 (project) -- Configuring incomplete, errors occurred! See also "/root/failed_config/CMakeFiles/CMakeOutput.log". See also "/root/failed_config/CMakeFiles/CMakeError.log". The command '/bin/sh -c cmake -G "Unix Makefiles" -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ "${LLVM_TRUNK}/llvm"' returned a non-zero code: 1 Expected Results: cmake without error
llvmbot commented 5 years ago

I think this cannot be fixed with a simple and elegant patch. Maybe it's better to mention we still need libstdc++ in doc of LLVM_ENABLE_LIBCXX? I'm not familiar with cmake and please correct me if I was wrong.

llvmbot commented 5 years ago

bootstrap in title