I try to compile LLVM, clang, lld and libcxx together in one source directory following the instructions on the website. I'm running Arch Linux and already have LLVM, clang, lld and libcxx installed (prebuilt against libstdc++). Now I want a "pure" llvm toolchain. The following options were used: -DBOOTSTRAP_LLVM_ENABLE_LLD -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_LINKER=lld -DCMAKE_LINK_EXECUTABLE="/usr/bin/ld.lld" -DCMAKE_AR="/usr/bin/llvm-ar" -DCMAKE_AS="/usr/bin/llvm-as" -DCLANG_DEFAULT_LINKER=lld -DCLANG_DEFAULT_RTLIB=compiler-rt -DCLANG_ENABLE_BOOTSTRAP=ON -DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DLLVM_ENABLE_LLD=ON -DLLVM_ENABLE_LIBCXX=ON However, the build fails with (many of those error messages): [1274/2712] Linking CXX shared library lib/libc++abi.so.1.0 FAILED: lib/libc++abi.so.1. /usr/bin/ld.lld: error: undefined symbol: _Unwind_Resume>>> referenced by ld-temp.o >>> lto.tmp:(__cxa_demangle)Can anyone please tell me what I am doing wrong and how I can fix the build? Regards Andreas
Petr Hosek via llvm-dev
2018-May-06 20:49 UTC
[llvm-dev] Cannot compile LLVM suite with clang+lld
You also need -DLIBUNWIND_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON. This is because you set -DLIBCXXABI_USE_COMPILER_RT=ON so libc++abi.so is no longer being linked agains libgcc_s.so which is where the unwinder otherwise comes from. On Sun, May 6, 2018 at 4:05 AM via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I try to compile LLVM, clang, lld and libcxx together in one source > directory following the instructions on the website. > I'm running Arch Linux and already have LLVM, clang, lld and libcxx > installed (prebuilt against libstdc++). Now I want a "pure" > llvm toolchain. > > The following options were used: > -DBOOTSTRAP_LLVM_ENABLE_LLD > -DCMAKE_C_COMPILER=clang > -DCMAKE_CXX_COMPILER=clang++ > -DCMAKE_LINKER=lld > -DCMAKE_LINK_EXECUTABLE="/usr/bin/ld.lld" > -DCMAKE_AR="/usr/bin/llvm-ar" > -DCMAKE_AS="/usr/bin/llvm-as" > -DCLANG_DEFAULT_LINKER=lld > -DCLANG_DEFAULT_RTLIB=compiler-rt > -DCLANG_ENABLE_BOOTSTRAP=ON > -DLIBCXX_USE_COMPILER_RT=ON > -DLIBCXXABI_USE_COMPILER_RT=ON > -DLLVM_ENABLE_LLD=ON > -DLLVM_ENABLE_LIBCXX=ON > > However, the build fails with (many of those error messages): > > [1274/2712] Linking CXX shared library lib/libc++abi.so.1.0 > FAILED: lib/libc++abi.so.1. > /usr/bin/ld.lld: error: undefined symbol: _Unwind_Resume > >>> referenced by ld-temp.o > >>> lto.tmp:(__cxa_demangle) > > Can anyone please tell me what I am doing wrong and how I can fix the > build? > > Regards > Andreas > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180506/901528b0/attachment.html>
A. Ilchinger via llvm-dev
2018-May-07 16:08 UTC
[llvm-dev] Cannot compile LLVM suite with clang+lld
Thank you for your reply. After I added those options nothing changed at first, then I added LLVM's libunwind to the source tree (runtimes/libunwind) and it got much better. However, I get the same errors at the end of the build process. Do I need LLVM's libunwind already installed? I was hoping I could bootstrap the whole toolchain directly. Maybe this warning is also interesting? [9/10] Linking CXX shared library /tmp/makepkg/llvm/src/llvm-6.0.0.src/build/lib/libunwind.so.1.0 clang-6.0: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument] This argument was added by -DLIBUNWIND_USE_COMPILER_RT=ON which you explained, it's strange that it is unused. The final error again is libcxxabi: [2715/2724] Linking CXX shared library lib/libc++abi.so.1.0 FAILED: lib/libc++abi.so.1.0 On Sun, 06 May 2018 20:49:39 +0000 Petr Hosek <phosek at chromium.org> wrote:> You also need -DLIBUNWIND_USE_COMPILER_RT=ON > -DLIBCXXABI_USE_LLVM_UNWINDER=ON. This is because you set > -DLIBCXXABI_USE_COMPILER_RT=ON > so libc++abi.so is no longer being linked agains libgcc_s.so which is > where the unwinder otherwise comes from. > > On Sun, May 6, 2018 at 4:05 AM via llvm-dev <llvm-dev at lists.llvm.org> > wrote: > > > I try to compile LLVM, clang, lld and libcxx together in one source > > directory following the instructions on the website. > > I'm running Arch Linux and already have LLVM, clang, lld and libcxx > > installed (prebuilt against libstdc++). Now I want a "pure" > > llvm toolchain. > > > > The following options were used: > > -DBOOTSTRAP_LLVM_ENABLE_LLD > > -DCMAKE_C_COMPILER=clang > > -DCMAKE_CXX_COMPILER=clang++ > > -DCMAKE_LINKER=lld > > -DCMAKE_LINK_EXECUTABLE="/usr/bin/ld.lld" > > -DCMAKE_AR="/usr/bin/llvm-ar" > > -DCMAKE_AS="/usr/bin/llvm-as" > > -DCLANG_DEFAULT_LINKER=lld > > -DCLANG_DEFAULT_RTLIB=compiler-rt > > -DCLANG_ENABLE_BOOTSTRAP=ON > > -DLIBCXX_USE_COMPILER_RT=ON > > -DLIBCXXABI_USE_COMPILER_RT=ON > > -DLLVM_ENABLE_LLD=ON > > -DLLVM_ENABLE_LIBCXX=ON > > > > However, the build fails with (many of those error messages): > > > > [1274/2712] Linking CXX shared library lib/libc++abi.so.1.0 > > FAILED: lib/libc++abi.so.1. > > /usr/bin/ld.lld: error: undefined symbol: _Unwind_Resume > > >>> referenced by ld-temp.o > > >>> lto.tmp:(__cxa_demangle) > > > > Can anyone please tell me what I am doing wrong and how I can fix > > the build? > > > > Regards > > Andreas > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >
Seemingly Similar Threads
- Cannot compile LLVM suite with clang+lld
- Trying to create a pure LLVM toolchain on musl based distribution
- Building LLVM with LLVM with no dependence on GCC
- Building LLVM with LLVM with no dependence on GCC
- Two-stage build w/ ninja - Tests still use stage1 compiler / linker ?