6

I have been trying to build clang but after running for 36 hours it fails with following error:

[3840/4138] Linking CXX shared library lib/libLTO.so.7
FAILED: lib/libLTO.so.7 
: && /usr/local/bin/clang++ -fPIC -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wno-comment -Wstring-conversion -fdiagnostics-color -g  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=gold    -Wl,--version-script,/home/tehreem/clang-llvm/build/tools/lto/LTO.exports -shared -Wl,-soname,libLTO.so.7 -o lib/libLTO.so.7 tools/lto/CMakeFiles/LTO.dir/LTODisassembler.cpp.o tools/lto/CMakeFiles/LTO.dir/lto.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVM-7.so && :

And then there is a long long list of undefined reference errors. Let me know if anyone wants me to post them. These are the flags I used while building:

cmake -G Ninja ../llvm -DLLVM_USE_LINKER=gold -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_LINK_LLVM_DYLIB=true -DLLVM_USE_SPLIT_DWARF=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER=clang++

What am I doing wrong? Also 36 hours? If I don't set CXX compiler to clang, it usually fails in 4-5 hours with the same error. Here are the complete details of the error: https://pastebin.com/EycPC437

I have already installed Clang 7.0 on my system. Which I built using GNU 7.3. It succeeded once fortunately. However keeps on failing with it too if I try that again.

Tehreem
  • 939
  • 2
  • 14
  • 31
  • can you please add the complete error message?. list of missing symbols. – Chirag Patel Dec 16 '18 at 09:18
  • hello @ChiragPatel, I had closed the terminal by the time you asked for details. I have updated my question with link to complete error on a fresh run. Let me know if you can spot anything. Thanks – Tehreem Dec 24 '18 at 02:14
  • Have you spotted anything? I have the same issue. – Artyom Gevorgyan Oct 06 '20 at 19:39
  • I tried a lot of things, not really sure which one of them worked. Are you trying to build with debug symbols? I couldn't build with debug symbols on a system with 8GB RAM. Had to move to 16GB. Apart from that, I stopped using Ninja and got it done through makefiles. Try this: cmake -G "Unix Makefiles" ../llvm -DLLVM_BUILD_TESTS=ON -DLLVM_OPTIMIZED_TABLEGEN=ON -DCMAKE_BUILD_TYPE=DEBUG -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_ENABLE_IDE=TRUE – Tehreem Oct 08 '20 at 18:28

0 Answers0