<div dir="ltr"><div dir="ltr" class="gmail_msg">Hello Kevin,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The error doesn't seem to be with sending C++ options to clang. Here's the CMake output,</div><div class="gmail_msg"><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">-- Performing Test CXX_SUPPORTS_CXX11</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">-- Performing Test CXX_SUPPORTS_CXX11 - Failed</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">CMake Error at cmake/modules/HandleLLVMOptions.cmake:511 (message):</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"> LLVM requires C++11 support but the '-std=c++11' flag isn't supported.</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Call Stack (most recent call first):</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"> CMakeLists.txt:578 (include)</font></div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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,</div><div class="gmail_msg"><div class="gmail_msg"><font face="monospace">-- Performing Test CXX_SUPPORTS_CXX11</font></div><div class="gmail_msg"><font face="monospace">-- Performing Test CXX_SUPPORTS_CXX11 - Failed</font></div><div class="gmail_msg"><font face="monospace">CMake Error at cmake/modules/HandleLLVMOptions.cmake:511 (message):</font></div><div class="gmail_msg"><font face="monospace"> LLVM requires C++11 support but the '-std=c++11' flag isn't supported.</font></div><div class="gmail_msg"><font face="monospace">Call Stack (most recent call first):</font></div><div class="gmail_msg"><font face="monospace"> CMakeLists.txt:578 (include)</font></div></div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">These lines of CMakeError.log reveal that clang++ actually fails because of "-fuse-ld=lld",</div><div class="gmail_msg">[...] ( the following test is the only one that sends -std=c++11 to clang++ )</div><div class="gmail_msg"><div class="gmail_msg"><font face="monospace">Performing C++ SOURCE FILE Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR failed with the following output:</font></div><div class="gmail_msg"><font face="monospace">Change Dir: /home/sanjay/Software/polly/llvm_build/CMakeFiles/CMakeTmp</font></div><div class="gmail_msg"><font face="monospace"><br></font></div><div class="gmail_msg"><font face="monospace">Run Build Command:"/usr/bin/ninja" "cmTC_9cfd8"</font></div><div class="gmail_msg"><font face="monospace">[1/2] Building CXX object CMakeFiles/cmTC_9cfd8.dir/src.cxx.o</font></div><div class="gmail_msg"><font face="monospace">[2/2] Linking CXX executable cmTC_9cfd8</font></div><div class="gmail_msg"><font face="monospace">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 && :</font></div><div class="gmail_msg"><font face="monospace">clang-5.0: error: invalid linker name in argument '-fuse-ld=lld'</font></div><div class="gmail_msg"><font face="monospace">ninja: build stopped: subcommand failed.</font></div><div class="gmail_msg"><font face="monospace"><br></font></div><div class="gmail_msg"><font face="monospace">Source file was:</font></div><div class="gmail_msg"><font face="monospace">class base {public: virtual void anchor();protected: ~base();};</font></div><div class="gmail_msg"><font face="monospace"> class derived final : public base { public: ~derived();};</font></div><div class="gmail_msg"><font face="monospace"> int main() { return 0; }</font></div></div><div class="gmail_msg">[...]</div><div class="gmail_msg"><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Performing C++ SOURCE FILE Test CXX_SUPPORTS_WERROR_DATE_TIME failed with the following output:</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Change Dir: /home/sanjay/Software/polly/llvm_build/CMakeFiles/CMakeTmp</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Run Build Command:"/usr/bin/ninja" "cmTC_39bc5"</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">[1/2] Building CXX object CMakeFiles/cmTC_39bc5.dir/src.cxx.o</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">[2/2] Linking CXX executable cmTC_39bc5</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">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 && :</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">clang-5.0: error: invalid linker name in argument '-fuse-ld=lld'</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">ninja: build stopped: subcommand failed.</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Source file was:</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">int main() { return 0; }</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Performing C++ SOURCE FILE Test CXX_SUPPORTS_CXX11 failed with the following output:</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Change Dir: /home/sanjay/Software/polly/llvm_build/CMakeFiles/CMakeTmp</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Run Build Command:"/usr/bin/ninja" "cmTC_25a8d"</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">[1/2] Building CXX object CMakeFiles/cmTC_25a8d.dir/src.cxx.o</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">[2/2] Linking CXX executable cmTC_25a8d</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">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 && :</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">clang-5.0: error: invalid linker name in argument '-fuse-ld=lld'</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">ninja: build stopped: subcommand failed.</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Source file was:</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">int main() { return 0; }</font></div></div><div class="gmail_msg">(EOF)</div><div class="gmail_msg"><br></div><div class="gmail_msg">It's odd that cmake reports that clang++ failed on "-std=c++11" when the problem was with "-fuse-ld=lld".</div><div class="gmail_msg"><br></div><div class="gmail_msg">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 )</div><div class="gmail_msg"><br></div><div class="gmail_msg">Thank You,</div><div class="gmail_msg">Sanjay Srivallabh</div></div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Feb 27, 2017 at 5:05 PM Flamedoge <<a href="mailto:code.kchoi@gmail.com" class="gmail_msg" target="_blank">code.kchoi@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">This might be error from `clang -std=c++11 a.c`. I would dump out and see what commands CMake is running to check if it's feeding c++ options to c files.<br class="gmail_msg"><br class="gmail_msg">Regards,<br class="gmail_msg">Kevin</div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Sun, Feb 26, 2017 at 11:11 PM, SANJAY SRIVALLABH SINGAPURAM via llvm-dev <span dir="ltr" class="gmail_msg"><<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Hello,<br class="gmail_msg"><br class="gmail_msg"></div>I issued the following command to point the build to use clang and clang++, from a local llvm build directory included in PATH, instead of /usr/bin/{cc,c++},<span style="font-family:monospace" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"></span></div><div class="gmail_msg"><font size="4" class="gmail_msg"><span style="font-family:monospace" class="gmail_msg">cmake <font size="4" class="gmail_msg"><span style="font-family:monospace" class="gmail_msg">-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</span></font> ../llvm_src<br class="gmail_msg"></span></font></div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">The configuration failed with the error stating the compiler didn't recognize '-std=c++11' flag, whereas clang compiled a dummy c++ file with warnings.<br class="gmail_msg"><font size="4" class="gmail_msg"><span style="font-family:monospace" class="gmail_msg"><br class="gmail_msg"></span></font></div><div class="gmail_msg"><font size="4" class="gmail_msg"><span style="font-family:monospace" class="gmail_msg">int main(){return 0;} ( which was used during the config, found in build/CMakeFiles/CMakeErrors.log )</span></font><br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">How can I resolve this ?<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thank You,<br class="gmail_msg"></div><div class="gmail_msg">Sanjay<br class="gmail_msg"></div></div></div>
<br class="gmail_msg"></blockquote></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
<br class="gmail_msg"></blockquote></div><br class="gmail_msg"></div>
</blockquote></div></div>