Created attachment 593358 [details] emerge --info clang-9.0.0 was compiled with default-compiler-rt. even for a simple source file, `int main() {return 0; }`, the executable that it produced always crashed before the main was called. With default-compiler-rt disabled or -fuse-ld=lld, clang will produce a working executable.
Apparently the crt{begin,end} files supplied by compiler-rt don't work. As a workaround, you can remove the following files: $ qlist compiler-rt | grep crt /usr/lib/clang/9.0.0/lib/linux/clang_rt.crtbegin-i386.o /usr/lib/clang/9.0.0/lib/linux/clang_rt.crtend-i386.o /usr/lib/clang/9.0.0/lib/linux/clang_rt.crtbegin-x86_64.o /usr/lib/clang/9.0.0/lib/linux/clang_rt.crtend-x86_64.o
Found a patch, will backport shortly.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f49ee2a7f534503415b56cf67babc40598bf2ba commit 8f49ee2a7f534503415b56cf67babc40598bf2ba Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2019-10-20 20:46:34 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2019-10-20 21:10:28 +0000 sys-libs/compiler-rt: Backport crt*.o fix Closes: https://bugs.gentoo.org/698086 Signed-off-by: Michał Górny <mgorny@gentoo.org> ...rt-9.0.0.ebuild => compiler-rt-9.0.0-r1.ebuild} | 6 ++++ ...-crt-make-test-case-nontrivial-in-check_c.patch | 41 ++++++++++++++++++++++ 2 files changed, 47 insertions(+)