trees: reset PATH per-target

Otherwise, if PATH was set before, it will be re-used
again in the next pass. We previously unset CROSS_COMPILE
to avoid using the wrong cross-compiler when switching to
another target within a multi-tree project such as U-Boot.

Well, PATH was also being set, to use coreboot xgcc first.
This is fine, but the next target may not use the same one.

This patch solves a similar problem to the following patch
which was mentioned above:

commit 637c0a1521
Author: Leah Rowe <leah@libreboot.org>
Date:   Tue Nov 19 02:52:28 2024 +0000

    trees: unset CROSS_COMPILE per target

Signed-off-by: Leah Rowe <leah@libreboot.org>
m920qwip
Leah Rowe 2024-11-29 00:36:40 +00:00
parent f4b6aeea28
commit 7f6e47d27c
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,8 @@ set -u -e
. "include/lib.sh"
. "include/git.sh"
XBMKPATH="$PATH"
eval `setvars "" xarch srcdir premake cmakedir xlang mode makeargs elfdir cmd \
project target target_dir targets xtree _f release bootstrapargs mkhelper \
autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
@ -74,6 +76,7 @@ build_targets()
for x in $targets; do
unset CROSS_COMPILE
export PATH="$XBMKPATH"
[ "$x" = "list" ] && x_ ls -1 "config/$project" && \
listfile="" && break
target="$x"