Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 28 Jan 2023 22:12:27
Message-Id: 1674943873.d26d425af9aa825c94532589f2ca6d0cdb7f3d01.chewi@gentoo
1 commit: d26d425af9aa825c94532589f2ca6d0cdb7f3d01
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 26 22:17:40 2022 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 22:11:13 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d26d425a
7
8 usr-ldscript.eclass: Don't add prefix to ld script paths when standalone
9
10 The toolchain's sysroot is automatically prepended to these paths.
11 Gentoo Prefix used to prevent this, but now we're changing that.
12
13 prefix-guest systems do not have a sysroot applied, as they use the
14 host's libc, so the prefix is still needed in this case.
15
16 This is actually all moot because the gen_usr_ldscript function is a
17 noop on prefix anyway, but I'm still adding this in case that changes.
18
19 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
20
21 eclass/usr-ldscript.eclass | 9 ++++++++-
22 1 file changed, 8 insertions(+), 1 deletion(-)
23
24 diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
25 index b73d538ae5bb..6dbce59c6400 100644
26 --- a/eclass/usr-ldscript.eclass
27 +++ b/eclass/usr-ldscript.eclass
28 @@ -39,6 +39,13 @@ gen_usr_ldscript() {
29 tc-is-static-only && return
30 use prefix && return
31
32 + # The toolchain's sysroot is automatically prepended to paths in this
33 + # script. We therefore need to omit EPREFIX on standalone prefix (RAP)
34 + # systems. prefix-guest (non-RAP) systems don't apply a sysroot so EPREFIX
35 + # is still needed in that case. This is moot because the above line makes
36 + # the function a noop on prefix, but we keep this in case that changes.
37 + local prefix=$(usex prefix-guest "${EPREFIX}" "")
38 +
39 # We only care about stuffing / for the native ABI. #479448
40 if [[ $(type -t multilib_is_native_abi) == "function" ]] ; then
41 multilib_is_native_abi || return 0
42 @@ -154,7 +161,7 @@ gen_usr_ldscript() {
43 See bug https://bugs.gentoo.org/4411 for more info.
44 */
45 ${output_format}
46 - GROUP ( ${EPREFIX}/${libdir}/${tlib} )
47 + GROUP ( ${prefix}/${libdir}/${tlib} )
48 END_LDSCRIPT
49 ;;
50 esac