Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/, profiles/features/prefix/standalone/
Date: Sat, 28 Jan 2023 22:12:27
Message-Id: 1674943880.597efc1908793a77001d42ebbd96ebb07f8ee631.chewi@gentoo
1 commit: 597efc1908793a77001d42ebbd96ebb07f8ee631
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 7 14:58:43 2023 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 22:11:20 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=597efc19
7
8 toolchain.eclass: Move remaining gcc prefix tweaks from profile
9
10 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
11
12 eclass/toolchain.eclass | 13 +++++++++++++
13 profiles/features/prefix/standalone/profile.bashrc | 14 +-------------
14 2 files changed, 14 insertions(+), 13 deletions(-)
15
16 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
17 index 479814f0df3e..6d8901d21812 100644
18 --- a/eclass/toolchain.eclass
19 +++ b/eclass/toolchain.eclass
20 @@ -719,6 +719,19 @@ toolchain_src_prepare() {
21 einfo "Remove texinfo (bug #198182, bug #464008)"
22 eapply "${FILESDIR}"/gcc-configure-texinfo.patch
23
24 + if ! use prefix-guest && [[ -n ${EPREFIX} ]] ; then
25 + einfo "Prefixifying dynamic linkers..."
26 + for f in gcc/config/*/*linux*.h ; do
27 + ebegin " Updating ${f}"
28 + if [[ ${f} == gcc/config/rs6000/linux*.h ]]; then
29 + sed -i -r "s,(DYNAMIC_LINKER_PREFIX\s+)\"\",\1\"${EPREFIX}\",g" "${f}" || die
30 + else
31 + sed -i -r "/_DYNAMIC_LINKER/s,([\":])(/lib),\1${EPREFIX}\2,g" "${f}" || die
32 + fi
33 + eend $?
34 + done
35 + fi
36 +
37 # >=gcc-4
38 if [[ -x contrib/gcc_update ]] ; then
39 einfo "Touching generated files"
40
41 diff --git a/profiles/features/prefix/standalone/profile.bashrc b/profiles/features/prefix/standalone/profile.bashrc
42 index 043f766c37e9..57ec4b57abcb 100644
43 --- a/profiles/features/prefix/standalone/profile.bashrc
44 +++ b/profiles/features/prefix/standalone/profile.bashrc
45 @@ -9,19 +9,7 @@
46 # Disable RAP trick during bootstrap stage2
47 [[ -z ${BOOTSTRAP_RAP_STAGE2} ]] || return 0
48
49 -if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == configure ]]; then
50 - cd "${S}"
51 - einfo "Prefixifying dynamic linkers..."
52 - for h in gcc/config/*/*linux*.h; do
53 - ebegin " Updating $h"
54 - if [[ "${h}" == gcc/config/rs6000/linux*.h ]]; then
55 - sed -i -r "s,(DYNAMIC_LINKER_PREFIX\s+)\"\",\1\"${EPREFIX}\",g" $h
56 - else
57 - sed -i -r "/_DYNAMIC_LINKER/s,([\":])(/lib),\1${EPREFIX}\2,g" $h
58 - fi
59 - eend $?
60 - done
61 -elif [[ ${CATEGORY}/${PN} == sys-devel/clang && ${EBUILD_PHASE} == configure ]]; then
62 +if [[ ${CATEGORY}/${PN} == sys-devel/clang && ${EBUILD_PHASE} == configure ]]; then
63 ebegin "Use ${EPREFIX} as default sysroot"
64 sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" "${S}"/CMakeLists.txt
65 eend $?