Cannot compile LLVM suite with clang+lld

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:

However, the build fails with (many of those error messages):

[1274/2712] Linking CXX shared library lib/
FAILED: lib/
/usr/bin/ld.lld: error: undefined symbol: _Unwind_Resume

referenced by ld-temp.o

Can anyone please tell me what I am doing wrong and how I can fix the


You also need -DLIBUNWIND_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON. This is because you set -DLIBCXXABI_USE_COMPILER_RT=ON so is no longer being linked agains which is where the unwinder otherwise comes from.

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/
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/
FAILED: lib/


I experienced the similar issue

When building LLVM toolchain with clang-9 + binutils/ld:

CMakeFiles/SecondLib.dir/PipSqueak.cpp.o: In function `SetStrings':
PipSqueak.cpp:(.text.SetStrings+0xc8): undefined reference to `_Unwind_Resume'

----- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< ---

Andreas said he got the *same* errors at the end of the build process even added those options suggested by Petr.

And there was already a bug report several years ago

But why no response about Yuanfang's work?

My cmake option mentioned here


Leslie Zhai