summaryrefslogtreecommitdiff
path: root/eclass/toolchain.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-29 02:53:24 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-29 02:53:24 +0000
commitb8ec9071f5d20d8518b02d0077428b2c9f88861b (patch)
tree6214c0d63a2bd5ae464941924a90f415687fa63c /eclass/toolchain.eclass
parentbdf6e70da7a28f45617c02a251bb6b3844202bc5 (diff)
gentoo auto-resync : 29:01:2023 - 02:53:24
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass28
1 files changed, 28 insertions, 0 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 0dd23d93e383..6d8901d21812 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -719,6 +719,19 @@ toolchain_src_prepare() {
einfo "Remove texinfo (bug #198182, bug #464008)"
eapply "${FILESDIR}"/gcc-configure-texinfo.patch
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]] ; then
+ einfo "Prefixifying dynamic linkers..."
+ for f in gcc/config/*/*linux*.h ; do
+ ebegin " Updating ${f}"
+ if [[ ${f} == gcc/config/rs6000/linux*.h ]]; then
+ sed -i -r "s,(DYNAMIC_LINKER_PREFIX\s+)\"\",\1\"${EPREFIX}\",g" "${f}" || die
+ else
+ sed -i -r "/_DYNAMIC_LINKER/s,([\":])(/lib),\1${EPREFIX}\2,g" "${f}" || die
+ fi
+ eend $?
+ done
+ fi
+
# >=gcc-4
if [[ -x contrib/gcc_update ]] ; then
einfo "Touching generated files"
@@ -1200,6 +1213,21 @@ toolchain_src_configure() {
confgcc+=( --enable-threads=posix )
;;
esac
+
+ if ! use prefix-guest ; then
+ # GNU ld scripts, such as those in glibc, reference unprefixed paths
+ # as the sysroot given here is automatically prepended. For
+ # prefix-guest, we use the host's libc instead.
+ if [[ -n ${EPREFIX} ]] ; then
+ confgcc+=( --with-sysroot="${EPREFIX}" )
+ fi
+
+ # We need to build against the right headers and libraries. Again,
+ # for prefix-guest, this is the host's.
+ if [[ -n ${ESYSROOT} ]] ; then
+ confgcc+=( --with-build-sysroot="${ESYSROOT}" )
+ fi
+ fi
fi
# __cxa_atexit is "essential for fully standards-compliant handling of