From b8ec9071f5d20d8518b02d0077428b2c9f88861b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 29 Jan 2023 02:53:24 +0000 Subject: gentoo auto-resync : 29:01:2023 - 02:53:24 --- eclass/toolchain.eclass | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'eclass/toolchain.eclass') 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 -- cgit v1.2.3