[24/28] make.sh: Set correct PATH in stage1

Message ID 20220204164748.315559-24-michael.tremer@ipfire.org
State Accepted
Commit 1c74bc461dc4bd14b16d492c5e25a0bb272b9eb9
Headers
Series [01/28] gcc: toolchain stage 2: Set sysroot to /tools_${arch} |

Commit Message

Michael Tremer Feb. 4, 2022, 4:47 p.m. UTC
  We did not use any of the tools that we were building which made the
build fail when cross-building on a different architecture.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 make.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/make.sh b/make.sh
index f59624665..3c7bc1011 100755
--- a/make.sh
+++ b/make.sh
@@ -663,8 +663,11 @@  lfsmake1() {
 	lfsmakecommoncheck $*
 	[ $? == 1 ] && return 0
 
+	# Set PATH to use the toolchain tools first and then whatever the host has set
+	local PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}"
+
 	if [ -n "${CUSTOM_PATH}" ]; then
-		local PATH="${CUSTOM_PATH}:${PATH}"
+		PATH="${CUSTOM_PATH}:${PATH}"
 	fi
 
 	cd $BASEDIR/lfs && env -i \