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.