Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 698086 - sys-devel/clang-9.0.0 USE=default-compiler-rt produces crash executable files
Summary: sys-devel/clang-9.0.0 USE=default-compiler-rt produces crash executable files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-20 07:52 UTC by Zhenjie Wang
Modified: 2019-10-20 21:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,6.12 KB, text/plain)
2019-10-20 07:52 UTC, Zhenjie Wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenjie Wang 2019-10-20 07:52:10 UTC
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.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-20 18:51:06 UTC
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
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-20 20:44:35 UTC
Found a patch, will backport shortly.
Comment 3 Larry the Git Cow gentoo-dev 2019-10-20 21:10:34 UTC
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(+)