summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2022-12-26 22:12:13 +0000
committerJames Le Cuirot <chewi@gentoo.org>2023-01-28 22:11:10 +0000
commit134dce1bc828e731dc1b12b4454f8827675a5fc9 (patch)
tree1f3c00afb86b5520110cb2d819b8db95214cbaac /profiles/features
parentsys-apps/baselayout: keyword 2.13-r1 (diff)
downloadgentoo-134dce1bc828e731dc1b12b4454f8827675a5fc9.tar.gz
gentoo-134dce1bc828e731dc1b12b4454f8827675a5fc9.tar.bz2
gentoo-134dce1bc828e731dc1b12b4454f8827675a5fc9.zip
sys-libs/glibc: Strip prefix from ld scripts for better cross-compiling
The toolchain expects to find the libc's files under its own sysroot. This sysroot is automatically prepended to paths found in ld scripts, such as those installed with glibc. We configure standalone prefix systems with a sysroot, so these paths should not be prefixed. However, Gentoo Prefix has traditionally left them prefixed and stopped the compiler from passing the sysroot to the linker instead. It is better to strip the prefix and let the sysroot do its job, as this makes cross-compiling much less awkward. prefix-guest systems do not have a sysroot applied, as they use the host's libc, but they would not install glibc anyway. This change is not needed for musl, as it does not install any ld scripts. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'profiles/features')
-rw-r--r--profiles/features/prefix/standalone/profile.bashrc9
1 files changed, 1 insertions, 8 deletions
diff --git a/profiles/features/prefix/standalone/profile.bashrc b/profiles/features/prefix/standalone/profile.bashrc
index fd95e43f7f30..3cdda77b9a88 100644
--- a/profiles/features/prefix/standalone/profile.bashrc
+++ b/profiles/features/prefix/standalone/profile.bashrc
@@ -1,5 +1,5 @@
# -*- mode: shell-script; -*-
-# Copyright 2018-2021 Gentoo Authors
+# Copyright 2018-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# RAP specific patches pending upstream:
@@ -24,10 +24,6 @@ if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == configure ]]; the
# use sysroot of toolchain to get correct include and library at compile time
EXTRA_ECONF="${EXTRA_ECONF} --with-sysroot=${EPREFIX}"
-
- ebegin "remove --sysroot call on ld for native toolchain"
- sed -i 's/--sysroot=%R//' gcc/gcc.c*
- eend $?
elif [[ ${CATEGORY}/${PN} == sys-devel/clang && ${EBUILD_PHASE} == configure ]]; then
ebegin "Use ${EPREFIX} as default sysroot"
sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" "${S}"/CMakeLists.txt
@@ -36,9 +32,6 @@ elif [[ ${CATEGORY}/${PN} == sys-devel/clang && ${EBUILD_PHASE} == configure ]];
ebegin "Use dynamic linker from ${EPREFIX}"
sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX%/}/\"@" Linux.cpp
eend $?
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
popd >/dev/null
elif [[ ${CATEGORY}/${PN} == sys-devel/binutils && ${EBUILD_PHASE} == prepare ]]; then
ebegin "Prefixifying native library path"