Chandler, I may be doing this wrong, but I'm getting a weird error in building LLVM with Clang via CMake. On x86_64: $ CC=clang CXX=clang++ cmake -G Ninja ../../src/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=True -DLLVM_ENABLE_ASSERTIONS=True On ARM: $ CC=clang CXX=clang++ cmake -G Ninja ../src/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_C_FLAGS=-mcpu=cortex-a15 -DCMAKE_CXX_FLAGS=-mcpu=cortex-a15 -DLLVM_TARGETS_TO_BUILD=ARM -DLLVM_BUILD_TESTS=True -DLLVM_ENABLE_ASSERTIONS=True Warning: CMake Warning at cmake/modules/HandleLLVMOptions.cmake:117 (message): -fPIC is not supported. Call Stack (most recent call first): cmake/modules/HandleLLVMOptions.cmake:150 (add_flag_or_print_warning) CMakeLists.txt:286 (include) Error log: Run Build Command:/usr/local/bin/ninja cmTryCompileExec3815591925 [1/2] Building C object CMakeFiles/cmTryCompileExec3815591925.dir/src.c.o FAILED: /home/user/devel/llvm/build/bin/clang -mcpu=cortex-a15 -DC_SUPPORTS_FLAG -std=c++0x -fPIC -o CMakeFiles/cmTryCompileExec3815591925.dir/src.c.o -c src.c error: invalid argument '-std=c++0x' not allowed with 'C/ObjC' ninja: build stopped: subcommand failed. Why is it adding --std=c++0x on a C compiler? Needless to say that with GCC, that doesn't happen (ie. --std=c++0x doesn't get added). Happens both on ARM and x86_64. Is this a side effect of your changes? cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/92ae3113/attachment.html>
Maybe, I'll have to debug. It does seem quite bizarre. On Tue, Jan 21, 2014 at 10:03 AM, Renato Golin <renato.golin at linaro.org>wrote:> Chandler, > > I may be doing this wrong, but I'm getting a weird error in building LLVM > with Clang via CMake. > > On x86_64: > $ CC=clang CXX=clang++ cmake -G Ninja ../../src/llvm > -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=True > -DLLVM_ENABLE_ASSERTIONS=True > > On ARM: > $ CC=clang CXX=clang++ cmake -G Ninja ../src/ -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_C_FLAGS=-mcpu=cortex-a15 > -DCMAKE_CXX_FLAGS=-mcpu=cortex-a15 -DLLVM_TARGETS_TO_BUILD=ARM > -DLLVM_BUILD_TESTS=True -DLLVM_ENABLE_ASSERTIONS=True > > Warning: > CMake Warning at cmake/modules/HandleLLVMOptions.cmake:117 (message): > -fPIC is not supported. > Call Stack (most recent call first): > cmake/modules/HandleLLVMOptions.cmake:150 (add_flag_or_print_warning) > CMakeLists.txt:286 (include) > > Error log: > Run Build Command:/usr/local/bin/ninja cmTryCompileExec3815591925 > [1/2] Building C object CMakeFiles/cmTryCompileExec3815591925.dir/src.c.o > FAILED: /home/user/devel/llvm/build/bin/clang -mcpu=cortex-a15 > -DC_SUPPORTS_FLAG -std=c++0x -fPIC -o > CMakeFiles/cmTryCompileExec3815591925.dir/src.c.o -c src.c > error: invalid argument '-std=c++0x' not allowed with 'C/ObjC' > ninja: build stopped: subcommand failed. > > Why is it adding --std=c++0x on a C compiler? > > Needless to say that with GCC, that doesn't happen (ie. --std=c++0x > doesn't get added). Happens both on ARM and x86_64. > > Is this a side effect of your changes? > > cheers, > --renato > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/ea0b211e/attachment.html>
Which version of CMake? On Tue, Jan 21, 2014 at 10:06 AM, Chandler Carruth <chandlerc at gmail.com>wrote:> Maybe, I'll have to debug. It does seem quite bizarre. > > > On Tue, Jan 21, 2014 at 10:03 AM, Renato Golin <renato.golin at linaro.org>wrote: > >> Chandler, >> >> I may be doing this wrong, but I'm getting a weird error in building LLVM >> with Clang via CMake. >> >> On x86_64: >> $ CC=clang CXX=clang++ cmake -G Ninja ../../src/llvm >> -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TESTS=True >> -DLLVM_ENABLE_ASSERTIONS=True >> >> On ARM: >> $ CC=clang CXX=clang++ cmake -G Ninja ../src/ -DCMAKE_BUILD_TYPE=Release >> -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_C_FLAGS=-mcpu=cortex-a15 >> -DCMAKE_CXX_FLAGS=-mcpu=cortex-a15 -DLLVM_TARGETS_TO_BUILD=ARM >> -DLLVM_BUILD_TESTS=True -DLLVM_ENABLE_ASSERTIONS=True >> >> Warning: >> CMake Warning at cmake/modules/HandleLLVMOptions.cmake:117 (message): >> -fPIC is not supported. >> Call Stack (most recent call first): >> cmake/modules/HandleLLVMOptions.cmake:150 (add_flag_or_print_warning) >> CMakeLists.txt:286 (include) >> >> Error log: >> Run Build Command:/usr/local/bin/ninja cmTryCompileExec3815591925 >> [1/2] Building C object CMakeFiles/cmTryCompileExec3815591925.dir/src.c.o >> FAILED: /home/user/devel/llvm/build/bin/clang -mcpu=cortex-a15 >> -DC_SUPPORTS_FLAG -std=c++0x -fPIC -o >> CMakeFiles/cmTryCompileExec3815591925.dir/src.c.o -c src.c >> error: invalid argument '-std=c++0x' not allowed with 'C/ObjC' >> ninja: build stopped: subcommand failed. >> >> Why is it adding --std=c++0x on a C compiler? >> >> Needless to say that with GCC, that doesn't happen (ie. --std=c++0x >> doesn't get added). Happens both on ARM and x86_64. >> >> Is this a side effect of your changes? >> >> cheers, >> --renato >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/2fcd61e0/attachment.html>
On Tue, Jan 21, 2014 at 8:03 PM, Renato Golin <renato.golin at linaro.org> wrote:> Chandler, > > I may be doing this wrong, but I'm getting a weird error in building LLVM > with Clang via CMake.I have been debugging a similar issue that I isolated to r199484. The issue surfaces for me as: /opt/centos/devtoolset-1.1/root/usr/bin/ld: ../../lib/libLLVMAArch64CodeGen.a(AArch64AsmPrinter.cpp.o): relocation R_X86_64_32 against `.rodata..L.str5' can not be used when making a shared object; recompile with -fPIC ../../lib/libLLVMAArch64CodeGen.a: could not read symbols: Bad value clang-3.4: error: linker command failed with exit code 1 (use -v to see invocation) [ 95%] make[2]: *** [lib/libLTO.so] Error 1 The same can be seen on some of our bulidbots (those that use Clang and CMake). Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
On Tue, Jan 21, 2014 at 10:20 AM, Dmitri Gribenko <gribozavr at gmail.com>wrote:> On Tue, Jan 21, 2014 at 8:03 PM, Renato Golin <renato.golin at linaro.org> > wrote: > > Chandler, > > > > I may be doing this wrong, but I'm getting a weird error in building LLVM > > with Clang via CMake. > > I have been debugging a similar issue that I isolated to r199484. The > issue surfaces for me as: > > /opt/centos/devtoolset-1.1/root/usr/bin/ld: > ../../lib/libLLVMAArch64CodeGen.a(AArch64AsmPrinter.cpp.o): relocation > R_X86_64_32 against `.rodata..L.str5' can not be used when making a > shared object; recompile with -fPIC > ../../lib/libLLVMAArch64CodeGen.a: could not read symbols: Bad value > clang-3.4: error: linker command failed with exit code 1 (use -v to > see invocation) > [ 95%] make[2]: *** [lib/libLTO.so] Error 1 > > The same can be seen on some of our bulidbots (those that use Clang and > CMake).This *could* be the same thing I suppose... If my fix actually helps, please let me know. But I don't completely see how this particular error happens so I'll be intrigued. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/1e40fba1/attachment.html>