toolchain.eclass: Move remaining gcc prefix tweaks from profile

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
This commit is contained in:
James Le Cuirot
2023-01-28 22:11:20 +00:00
parent 72925b1dcc
commit 597efc1908
2 changed files with 14 additions and 13 deletions
+13
View File
@@ -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"
@@ -9,19 +9,7 @@
# Disable RAP trick during bootstrap stage2
[[ -z ${BOOTSTRAP_RAP_STAGE2} ]] || return 0
if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == configure ]]; then
cd "${S}"
einfo "Prefixifying dynamic linkers..."
for h in gcc/config/*/*linux*.h; do
ebegin " Updating $h"
if [[ "${h}" == gcc/config/rs6000/linux*.h ]]; then
sed -i -r "s,(DYNAMIC_LINKER_PREFIX\s+)\"\",\1\"${EPREFIX}\",g" $h
else
sed -i -r "/_DYNAMIC_LINKER/s,([\":])(/lib),\1${EPREFIX}\2,g" $h
fi
eend $?
done
elif [[ ${CATEGORY}/${PN} == sys-devel/clang && ${EBUILD_PHASE} == configure ]]; then
if [[ ${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
eend $?