Bug#958783: clang-10: -rtlib=compiler-rt fails with undefined symbol: _Unwind_Resume

Sylvestre Ledru sylvestre at debian.org
Fri May 1 10:18:26 BST 2020


Le 25/04/2020 à 10:48, Sylvestre Ledru a écrit :
> Package: clang-10
> Version: 1:10.0.0-4
> Severity: normal
> 
> Dear Maintainer,
> 
> With
> ---
> #include <iostream>
> int main(int argc, char **argv) {
>    std::cout << "Hello World" << std::endl;
>    return 0;
> }
> ---
> 
> clang++-10 -fuse-ld=lld -rtlib=compiler-rt -stdlib=libc++ foo.cpp
> ld.lld: error: undefined symbol: _Unwind_Resume
>>>> referenced by foo.cpp
>>>>                /tmp/foo-81c51b.o:(std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long))
>>>> referenced by foo.cpp
>>>>                /tmp/foo-81c51b.o:(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char))
>>>> referenced by foo.cpp
>>>>                /tmp/foo-81c51b.o:(std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const)
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> 
> But the following works:
> clang++-10 -fuse-ld=lld -rtlib=compiler-rt foo.cpp
> clang++-10 -fuse-ld=lld -stdlib=libc++ foo.cpp
> 
> I guess it is because compiler-rt is built with the option:
> -DCOMPILER_RT_USE_LIBCXX=NO

Actually, the option to provide is -DLIBCXXABI_USE_LLVM_UNWINDER=YES to build libc++abi and add libunwind-dev as a build dep

I will see to activate it by default in the pacakge.


Sylvestre



More information about the Pkg-llvm-team mailing list