summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2021-03-31 08:51:08 +0200
committerFabian Groffen <grobian@gentoo.org>2021-03-31 08:51:08 +0200
commit7ca9acf145b59b0efb129a52788308e7764971bf (patch)
tree48de731779e28653bf0e2ae70ac9e11410e40db6
parentdev-libs/openssl-1.1.1k: security version bump (diff)
downloadprefix-7ca9acf145b59b0efb129a52788308e7764971bf.tar.gz
prefix-7ca9acf145b59b0efb129a52788308e7764971bf.tar.bz2
prefix-7ca9acf145b59b0efb129a52788308e7764971bf.zip
scripts/bootstrap-prefix: ensure stage1 gcc wrapper is functional
In the these days quite uncommon case of calling the stage functions directly, stage1's gcc wrapper would use the unset variable STAGE1_PATH. This variable is normally set in the interactive proze that re-defines PATH to remove any unwanted stuff. Avoid this dependency by storing the original value of PATH right at the startup of the script, such that stage1 can refer to it, whether or not called from the interactive wrapper or not. Thanks Sargun Dhillon in bug #779145. Closes: https://bugs.gentoo.org/779145 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rwxr-xr-xscripts/bootstrap-prefix.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 6789abd382..dd534d0aac 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1447,6 +1447,7 @@ bootstrap_stage1() {
# we're working with now, bug #650284
[[ -x ${ROOT}/tmp/usr/bin/bash ]] \
|| (bootstrap_bash) || return 1
+
# Some host tools need to be wrapped to be useful for us.
# We put them in tmp/usr/local/bin, to not accidentally
# be identified as stage1-installed like in bug #615410.
@@ -1475,7 +1476,7 @@ bootstrap_stage1() {
# We need to direct the system gcc to find the system binutils.
cat >> "${ROOT}"/tmp/usr/local/bin/gcc <<-EOF
#! /bin/sh
- PATH="${STAGE1_PATH}" export PATH
+ PATH="${ORIGINAL_PATH}" export PATH
exec "\${0##*/}" "\$@"
EOF
cp "${ROOT}"/tmp/usr/local/bin/g{cc,++}
@@ -2768,7 +2769,6 @@ EOF
# location seems ok
break
done
- export STAGE1_PATH=${PATH}
export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$EPREFIX/tmp/usr/local/bin:${PATH}"
cat << EOF
@@ -3078,9 +3078,6 @@ case ${CHOST} in
powerpc-*darwin*)
DARWIN_USE_GCC=1 # must use GCC, Clang is impossible
;;
-# arm64-*darwin*)
-# DARWIN_USE_GCC=0 # cannot use GCC yet (needs silicon support)
-# ;;
*-darwin*)
# normalise value of DARWIN_USE_GCC
case ${DARWIN_USE_GCC} in
@@ -3138,6 +3135,7 @@ elif [[ -z $1 ]] ; then
fi
ROOT="$1"
+ORIGINAL_PATH="${PATH}"
set_helper_vars
case $ROOT in