summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Miller <alex.miller@gmx.de>2022-08-07 01:22:09 +0200
committerSam James <sam@gentoo.org>2022-08-24 05:56:27 +0100
commit8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5 (patch)
tree8cc09bd56da2e18e3983669a24e22f3d956fbbb9 /sys-libs
parentflag-o-matic.eclass: test-flag-PROG, strip unused args that generate warnings (diff)
downloadgentoo-8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5.tar.gz
gentoo-8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5.tar.bz2
gentoo-8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5.zip
sys-libs/compiler-rt: Override start symbol when adding -nostartfiles to LDFLAGS
Trying to link executables for the configure checks generates linker warnings (in the CMake logs) like: "warning: cannot find entry symbol _start; defaulting to 0000000000001000". Moreover, with flags like -flto or -Wl,--gc-sections, the linker can discard all code, rendering the checks useless. Set main as entry symbol when linking with -nostartfiles to avoid both issues. (Note that the binaries would still crash, but that doesn't matter since they are never executed.) Bug: https://bugs.gentoo.org/862540 Closes: https://bugs.gentoo.org/862798 Signed-off-by: Alexander Miller <alex.miller@gmx.de> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild b/sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild
index 4ce8bbb484a7..c006ccddc481 100644
--- a/sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild
+++ b/sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild
@@ -88,8 +88,9 @@ src_configure() {
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
elif test_compiler "${nolib_flags[@]}" -nostartfiles; then
- # Avoiding -nostartfiles earlier on for bug #862540
- nolib_flags+=( -nostartfiles )
+ # Avoiding -nostartfiles earlier on for bug #862540,
+ # and set available entry symbol for bug #862798.
+ nolib_flags+=( -nostartfiles -emain )
local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
fi