Hello Kevin,
The error doesn’t seem to be with sending C++ options to clang. Here’s the CMake output,
– Performing Test CXX_SUPPORTS_CXX11
– Performing Test CXX_SUPPORTS_CXX11 - Failed
CMake Error at cmake/modules/HandleLLVMOptions.cmake:511 (message):
LLVM requires C++11 support but the ‘-std=c++11’ flag isn’t supported.
Call Stack (most recent call first):
CMakeLists.txt:578 (include)
The configuration runs fine when LLVM_ENABLE_LLD is set to OFF. But, when enabled, the debug stops at the test checking for C++11 support,
– Performing Test CXX_SUPPORTS_CXX11
– Performing Test CXX_SUPPORTS_CXX11 - Failed
CMake Error at cmake/modules/HandleLLVMOptions.cmake:511 (message):
LLVM requires C++11 support but the ‘-std=c++11’ flag isn’t supported.
Call Stack (most recent call first):
CMakeLists.txt:578 (include)
These lines of CMakeError.log reveal that clang++ actually fails because of “-fuse-ld=lld”,
[…] ( the following test is the only one that sends -std=c++11 to clang++ )
Performing C++ SOURCE FILE Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR failed with the following output:
Change Dir: /home/sanjay/Software/polly/llvm_build/CMakeFiles/CMakeTmp
Run Build Command:“/usr/bin/ninja” “cmTC_9cfd8”
[1/2] Building CXX object CMakeFiles/cmTC_9cfd8.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_9cfd8
FAILED: : && /home/sanjay/Software/clang_vanilla/llvm_build/bin/clang++ -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -pedantic -Wno-long-long -DCXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR -std=c++11 -Werror=non-virtual-dtor -fuse-ld=lld CMakeFiles/cmTC_9cfd8.dir/src.cxx.o -o cmTC_9cfd8 -lm && :
clang-5.0: error: invalid linker name in argument ‘-fuse-ld=lld’
ninja: build stopped: subcommand failed.
Source file was:
class base {public: virtual void anchor();protected: ~base();};
class derived final : public base { public: ~derived();};
int main() { return 0; }
[…]
Performing C++ SOURCE FILE Test CXX_SUPPORTS_WERROR_DATE_TIME failed with the following output:
Change Dir: /home/sanjay/Software/polly/llvm_build/CMakeFiles/CMakeTmp
Run Build Command:“/usr/bin/ninja” “cmTC_39bc5”
[1/2] Building CXX object CMakeFiles/cmTC_39bc5.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_39bc5
FAILED: : && /home/sanjay/Software/clang_vanilla/llvm_build/bin/clang++ -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -pedantic -Wno-long-long -Wno-comment -DCXX_SUPPORTS_WERROR_DATE_TIME -fuse-ld=lld CMakeFiles/cmTC_39bc5.dir/src.cxx.o -o cmTC_39bc5 -lm && :
clang-5.0: error: invalid linker name in argument ‘-fuse-ld=lld’
ninja: build stopped: subcommand failed.
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CXX_SUPPORTS_CXX11 failed with the following output:
Change Dir: /home/sanjay/Software/polly/llvm_build/CMakeFiles/CMakeTmp
Run Build Command:“/usr/bin/ninja” “cmTC_25a8d”
[1/2] Building CXX object CMakeFiles/cmTC_25a8d.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_25a8d
FAILED: : && /home/sanjay/Software/clang_vanilla/llvm_build/bin/clang++ -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -pedantic -Wno-long-long -Wno-comment -DCXX_SUPPORTS_CXX11 -fuse-ld=lld CMakeFiles/cmTC_25a8d.dir/src.cxx.o -o cmTC_25a8d -lm && :
clang-5.0: error: invalid linker name in argument ‘-fuse-ld=lld’
ninja: build stopped: subcommand failed.
Source file was:
int main() { return 0; }
(EOF)
It’s odd that cmake reports that clang++ failed on “-std=c++11” when the problem was with “-fuse-ld=lld”.
Also, do I have to explicitly indicate that lld needs to be built when building LLVM ? ( I couldn’t find lld in llvm_build/bin )
Thank You,
Sanjay Srivallabh