Compile issue on v1.8.0-rc1
Ubuntu 16.04 LTS
Performing C++ SOURCE FILE Test HAVE_CXX_ATOMICS_WITHOUT_LIB failed with the following output:
Change Dir: /home/charles/src/llvm/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a4dbe/fast"
/usr/bin/make -f CMakeFiles/cmTC_a4dbe.dir/build.make CMakeFiles/cmTC_a4dbe.dir/build
make[1]: Entering directory '/home/charles/src/llvm/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_a4dbe.dir/src.cxx.o
/home/charles/opt/clang8/bin/clang++ -DHAVE_CXX_ATOMICS_WITHOUT_LIB -std=c++11 -o CMakeFiles/cmTC_a4dbe.dir/src.cxx.o -c /home/charles/src/llvm/build/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTC_a4dbe
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a4dbe.dir/link.txt --verbose=1
/home/charles/opt/clang8/bin/clang++ -DHAVE_CXX_ATOMICS_WITHOUT_LIB -std=c++11 -stdlib=libc++ -nostdlib++ CMakeFiles/cmTC_a4dbe.dir/src.cxx.o -o cmTC_a4dbe -lm /home/charles/opt/clang8/lib/libc++.a /home/charles/opt/clang8/lib/libc++abi.a
/home/charles/opt/clang8/lib/libc++abi.a(cxa_exception_storage.cpp.o): In function `__cxxabiv1::(anonymous namespace)::destruct_(void*)':
cxa_exception_storage.cpp:(.text._ZN10__cxxabiv112_GLOBAL__N_19destruct_EPv+0x12): undefined reference to `pthread_setspecific'
/home/charles/opt/clang8/lib/libc++abi.a(cxa_exception_storage.cpp.o): In function `__cxxabiv1::(anonymous namespace)::construct_()':
cxa_exception_storage.cpp:(.text._ZN10__cxxabiv112_GLOBAL__N_110construct_Ev+0x13): undefined reference to `pthread_key_create'
/home/charles/opt/clang8/lib/libc++abi.a(cxa_exception_storage.cpp.o): In function `__cxa_get_globals_fast':
cxa_exception_storage.cpp:(.text.__cxa_get_globals_fast+0x13): undefined reference to `pthread_once'
cxa_exception_storage.cpp:(.text.__cxa_get_globals_fast+0x26): undefined reference to `pthread_getspecific'
/home/charles/opt/clang8/lib/libc++abi.a(cxa_exception_storage.cpp.o): In function `__cxa_get_globals':
cxa_exception_storage.cpp:(.text.__cxa_get_globals+0x39): undefined reference to `pthread_setspecific'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/cmTC_a4dbe.dir/build.make:97: recipe for target 'cmTC_a4dbe' failed
make[1]: *** [cmTC_a4dbe] Error 1
make[1]: Leaving directory '/home/charles/src/llvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_a4dbe/fast' failed
make: *** [cmTC_a4dbe/fast] Error 2
Source file was:
#include <atomic>
std::atomic<int> x;
int main() {
return x;
}
Performing C++ SOURCE FILE Test HAVE_CXX_ATOMICS_WITH_LIB failed with the following output:
Change Dir: /home/charles/src/llvm/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_aa34d/fast"
/usr/bin/make -f CMakeFiles/cmTC_aa34d.dir/build.make CMakeFiles/cmTC_aa34d.dir/build
make[1]: Entering directory '/home/charles/src/llvm/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_aa34d.dir/src.cxx.o
/home/charles/opt/clang8/bin/clang++ -DHAVE_CXX_ATOMICS_WITH_LIB -std=c++11 -o CMakeFiles/cmTC_aa34d.dir/src.cxx.o -c /home/charles/src/llvm/build/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTC_aa34d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aa34d.dir/link.txt --verbose=1
/home/charles/opt/clang8/bin/clang++ -DHAVE_CXX_ATOMICS_WITH_LIB -std=c++11 -stdlib=libc++ -nostdlib++ CMakeFiles/cmTC_aa34d.dir/src.cxx.o -o cmTC_aa34d -lm -latomic /home/charles/opt/clang8/lib/libc++.a /home/charles/opt/clang8/lib/libc++abi.a
/usr/bin/ld: /home/charles/opt/clang8/lib/libc++abi.a(cxa_exception_storage.cpp.o): undefined reference to symbol 'pthread_once@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/cmTC_aa34d.dir/build.make:97: recipe for target 'cmTC_aa34d' failed
make[1]: *** [cmTC_aa34d] Error 1
make[1]: Leaving directory '/home/charles/src/llvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_aa34d/fast' failed
make: *** [cmTC_aa34d/fast] Error 2
Source file was:
#include <atomic>
std::atomic<int> x;
int main() {
return x;
}
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed -- Looking for __atomic_fetch_add_4 in atomic -- Looking for __atomic_fetch_add_4 in atomic - found -- Performing Test HAVE_CXX_ATOMICS_WITH_LIB -- Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Failed CMake Error at cmake/modules/CheckAtomic.cmake:49 (message): Host compiler must support std::atomic! Call Stack (most recent call first): cmake/config-ix.cmake:307 (include) CMakeLists.txt:582 (include)
Did you do a clean install after running the full_uninstaller script?
Yes tried that and manually checked /usr/local and ~/ DIRS for any remaining bits.
What's the options you're passing into the build script? Are you using -P?
no, I will try that and report back.
same issue for me.
trying with -f
still no good.
Is this a clean install of Ubuntu? It seems like a library/package you have installed might be causing the error. We run the scripts through a clean install of Ubuntu to be sure they work before a release.
not a clean install, so let's close the call.
How to solve this error,I met the same error.
Try building with flags: -P -f Sometimes this will also fail by then build normally after using those flags.
Thank you, i try it, but not good.