Summary: | sys-devel/clang-9.0.0: crashes when compiling with -march=x86-64 -O1 -fno-plt -m32 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michał Bartoszkiewicz <mbartoszkiewicz> |
Component: | Current packages | Assignee: | LLVM support project <llvm> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | bugs.gentoo.org, mgorny, soprwa, z23 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.llvm.org/show_bug.cgi?id=43490 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
Reproducer script Preprocessed source |
Description
Michał Bartoszkiewicz
2019-09-25 12:26:05 UTC
Created attachment 591022 [details]
Reproducer script
Created attachment 591024 [details]
Preprocessed source
Reduced example: $ cat wrappers_c-d34ae5.cpp __attribute__((weak)) void a(); void b() { if (a) a(); } $ "/usr/lib/llvm/9/bin/clang-9" -c wrappers_c-d34ae5.cpp -o a.o -march=sandybridge -O2 -fno-plt -m32 Stack dump: ... 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'wrappers_c-d34ae5.cpp'. 4. Running pass 'Machine Common Subexpression Elimination' on function '@_Z1bv' #0 0x00007f327641408a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/llvm/9/bin/../lib64/libLLVMSupport.so.9+0x19208a) #1 0x00007f3276412344 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/9/bin/../lib64/libLLVMSupport.so.9+0x190344) ... Thanks for reducing it. I can reproduce with the reduced code, even with '-march=x86-64 -O1 -fno-plt -m32'. I'm going to test trunk, in case it's been fixed upstream. Also can reproduce Clang crahs when building 32 bit `compiler-rt-sanitizers` on amd64. Moreover any 32 bit executable produced by Clang will segfault, I think it may be related to compiler-Rt (I use it by default) but I cannot check right now. I've been able to reproduce with Clang 8 and trunk. I'm currently rebuilding trunk with debug info to get a nice stack trace, and I'll file it upstream afterwards. That said, looking at upstream Bugzilla -fno-plt may have more problems than that (apparently it can produce broken code), so I doubt it's a good idea to use it. https://reviews.llvm.org/D68907 is said to resolve this but I won't be able to test it for another 2 weeks. No problem, it will probably take some time before it's merged anyway. I'll subscribe and possibly call for backport when that happens. With https://reviews.llvm.org/D68907?id=224785 example from https://bugs.gentoo.org/695618#c3 doesn't crash for me. Compiler-rt testsuite was still crashing for me but because it ignores LDFLAGS (I've added `-fuse-ld=lld` to make.conf). Forcing it to use LLD made tests pass. Maybe LD 2.32 cannot link properly compiler-rt objects or something else on my system is casing this issue but it doesn't matter. I'll patch my Clang to use LLD by default instead of relying solely of LDFLAGS. Bump, this just hit stable. Stable tree will not build at this time. Is this still an issue? |