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

Sylvestre Ledru sylvestre at debian.org
Sat Apr 25 09:48:55 BST 2020


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

Maybe we should change this to YES and see what happens

Cheers,
Sylvestre


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (900, 'testing'), (600, 'unstable'), (500, 'buildd-unstable'), (500, 'oldstable'), (300, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.4.0-3-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_WARN
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages clang-10 depends on:
ii  binutils                2.34-4
ii  libc6                   2.30-4
ii  libc6-dev               2.30-4
ii  libclang-common-10-dev  1:10.0.0-4
ii  libclang-cpp10          1:10.0.0-4
ii  libclang1-10            1:10.0.0-4
ii  libgcc-9-dev            9.2.1-30
ii  libgcc-s1               10-20200222-1
ii  libllvm10               1:10.0.0-4
ii  libobjc-9-dev           9.2.1-30
ii  libstdc++-9-dev         9.2.1-30
ii  libstdc++6              10-20200222-1

Versions of packages clang-10 recommends:
ii  libomp-10-dev  1:10.0.0-4
ii  llvm-10-dev    1:10.0.0-4
ii  python3        3.7.5-3

Versions of packages clang-10 suggests:
pn  clang-10-doc  <none>

-- no debconf information



More information about the Pkg-llvm-team mailing list