From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 174751382C5 for ; Wed, 31 Mar 2021 06:54:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E265E0833; Wed, 31 Mar 2021 06:54:43 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 212C3E0833 for ; Wed, 31 Mar 2021 06:54:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B23DB340B9C for ; Wed, 31 Mar 2021 06:54:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1F70E5D2 for ; Wed, 31 Mar 2021 06:54:40 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1617173468.7ca9acf145b59b0efb129a52788308e7764971bf.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-prefix.sh X-VCS-Directories: scripts/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 7ca9acf145b59b0efb129a52788308e7764971bf X-VCS-Branch: master Date: Wed, 31 Mar 2021 06:54:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e8818156-f7d0-4b29-96e9-b1c24347a1dc X-Archives-Hash: 0d5013416dda01ad9fcd6a065ff73859 commit: 7ca9acf145b59b0efb129a52788308e7764971bf Author: Fabian Groffen gentoo org> AuthorDate: Wed Mar 31 06:51:08 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Mar 31 06:51:08 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7ca9acf1 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 gentoo.org> scripts/bootstrap-prefix.sh | 8 +++----- 1 file 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