1 |
commit: 7ca9acf145b59b0efb129a52788308e7764971bf |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 31 06:51:08 2021 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 31 06:51:08 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7ca9acf1 |
7 |
|
8 |
scripts/bootstrap-prefix: ensure stage1 gcc wrapper is functional |
9 |
|
10 |
In the these days quite uncommon case of calling the stage functions |
11 |
directly, stage1's gcc wrapper would use the unset variable STAGE1_PATH. |
12 |
This variable is normally set in the interactive proze that re-defines |
13 |
PATH to remove any unwanted stuff. |
14 |
|
15 |
Avoid this dependency by storing the original value of PATH right at the |
16 |
startup of the script, such that stage1 can refer to it, whether or not |
17 |
called from the interactive wrapper or not. |
18 |
|
19 |
Thanks Sargun Dhillon in bug #779145. |
20 |
|
21 |
Closes: https://bugs.gentoo.org/779145 |
22 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
23 |
|
24 |
scripts/bootstrap-prefix.sh | 8 +++----- |
25 |
1 file changed, 3 insertions(+), 5 deletions(-) |
26 |
|
27 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
28 |
index 6789abd382..dd534d0aac 100755 |
29 |
--- a/scripts/bootstrap-prefix.sh |
30 |
+++ b/scripts/bootstrap-prefix.sh |
31 |
@@ -1447,6 +1447,7 @@ bootstrap_stage1() { |
32 |
# we're working with now, bug #650284 |
33 |
[[ -x ${ROOT}/tmp/usr/bin/bash ]] \ |
34 |
|| (bootstrap_bash) || return 1 |
35 |
+ |
36 |
# Some host tools need to be wrapped to be useful for us. |
37 |
# We put them in tmp/usr/local/bin, to not accidentally |
38 |
# be identified as stage1-installed like in bug #615410. |
39 |
@@ -1475,7 +1476,7 @@ bootstrap_stage1() { |
40 |
# We need to direct the system gcc to find the system binutils. |
41 |
cat >> "${ROOT}"/tmp/usr/local/bin/gcc <<-EOF |
42 |
#! /bin/sh |
43 |
- PATH="${STAGE1_PATH}" export PATH |
44 |
+ PATH="${ORIGINAL_PATH}" export PATH |
45 |
exec "\${0##*/}" "\$@" |
46 |
EOF |
47 |
cp "${ROOT}"/tmp/usr/local/bin/g{cc,++} |
48 |
@@ -2768,7 +2769,6 @@ EOF |
49 |
# location seems ok |
50 |
break |
51 |
done |
52 |
- export STAGE1_PATH=${PATH} |
53 |
export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$EPREFIX/tmp/usr/local/bin:${PATH}" |
54 |
|
55 |
cat << EOF |
56 |
@@ -3078,9 +3078,6 @@ case ${CHOST} in |
57 |
powerpc-*darwin*) |
58 |
DARWIN_USE_GCC=1 # must use GCC, Clang is impossible |
59 |
;; |
60 |
-# arm64-*darwin*) |
61 |
-# DARWIN_USE_GCC=0 # cannot use GCC yet (needs silicon support) |
62 |
-# ;; |
63 |
*-darwin*) |
64 |
# normalise value of DARWIN_USE_GCC |
65 |
case ${DARWIN_USE_GCC} in |
66 |
@@ -3138,6 +3135,7 @@ elif [[ -z $1 ]] ; then |
67 |
fi |
68 |
|
69 |
ROOT="$1" |
70 |
+ORIGINAL_PATH="${PATH}" |
71 |
set_helper_vars |
72 |
|
73 |
case $ROOT in |