Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt/
Date: Wed, 24 Aug 2022 04:57:10
Message-Id: 1661316987.8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5.sam@gentoo
1 commit: 8bb13b19b42601b8b57c5b1c2d64d1b0a04fede5
2 Author: Alexander Miller <alex.miller <AT> gmx <DOT> de>
3 AuthorDate: Sat Aug 6 23:22:09 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 24 04:56:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bb13b19
7
8 sys-libs/compiler-rt: Override start symbol when adding -nostartfiles to LDFLAGS
9
10 Trying to link executables for the configure checks generates linker
11 warnings (in the CMake logs) like: "warning: cannot find entry symbol
12 _start; defaulting to 0000000000001000".
13 Moreover, with flags like -flto or -Wl,--gc-sections, the linker can
14 discard all code, rendering the checks useless.
15
16 Set main as entry symbol when linking with -nostartfiles to avoid
17 both issues. (Note that the binaries would still crash, but that
18 doesn't matter since they are never executed.)
19
20 Bug: https://bugs.gentoo.org/862540
21 Closes: https://bugs.gentoo.org/862798
22 Signed-off-by: Alexander Miller <alex.miller <AT> gmx.de>
23 Signed-off-by: Sam James <sam <AT> gentoo.org>
24
25 sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild | 5 +++--
26 1 file changed, 3 insertions(+), 2 deletions(-)
27
28 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
29 index 4ce8bbb484a7..c006ccddc481 100644
30 --- a/sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild
31 +++ b/sys-libs/compiler-rt/compiler-rt-14.0.6-r1.ebuild
32 @@ -88,8 +88,9 @@ src_configure() {
33 local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
34 ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
35 elif test_compiler "${nolib_flags[@]}" -nostartfiles; then
36 - # Avoiding -nostartfiles earlier on for bug #862540
37 - nolib_flags+=( -nostartfiles )
38 + # Avoiding -nostartfiles earlier on for bug #862540,
39 + # and set available entry symbol for bug #862798.
40 + nolib_flags+=( -nostartfiles -emain )
41 local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
42 ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
43 fi