Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-dev] [PATCH 2/7] usr-ldscript.eclass: Don't add prefix to ld script paths when standalone

2 views
Skip to first unread message

James Le Cuirot

unread,
Jan 21, 2023, 5:30:03 PM1/21/23
to
The toolchain's sysroot is automatically prepended to these paths.
Gentoo Prefix used to prevent this, but now we're changing that.

prefix-guest systems do not have a sysroot applied, as they use the
host's libc, so the prefix is still needed in this case.

This is actually all moot because the gen_usr_ldscript function is a
noop on prefix anyway, but I'm still adding this in case that changes.

Signed-off-by: James Le Cuirot <ch...@gentoo.org>
---
eclass/usr-ldscript.eclass | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
index b73d538ae5bb..6dbce59c6400 100644
--- a/eclass/usr-ldscript.eclass
+++ b/eclass/usr-ldscript.eclass
@@ -39,6 +39,13 @@ gen_usr_ldscript() {
tc-is-static-only && return
use prefix && return

+ # The toolchain's sysroot is automatically prepended to paths in this
+ # script. We therefore need to omit EPREFIX on standalone prefix (RAP)
+ # systems. prefix-guest (non-RAP) systems don't apply a sysroot so EPREFIX
+ # is still needed in that case. This is moot because the above line makes
+ # the function a noop on prefix, but we keep this in case that changes.
+ local prefix=$(usex prefix-guest "${EPREFIX}" "")
+
# We only care about stuffing / for the native ABI. #479448
if [[ $(type -t multilib_is_native_abi) == "function" ]] ; then
multilib_is_native_abi || return 0
@@ -154,7 +161,7 @@ gen_usr_ldscript() {
See bug https://bugs.gentoo.org/4411 for more info.
*/
${output_format}
- GROUP ( ${EPREFIX}/${libdir}/${tlib} )
+ GROUP ( ${prefix}/${libdir}/${tlib} )
END_LDSCRIPT
;;
esac
--
2.39.1
0 new messages