summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-04 08:07:06 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-04 08:07:06 +0100
commit1b7a9fd637d2ca98d1da5ded0e2090bd311b4b8c (patch)
treead5504198698b0c9ca25b651ec7b38793abbbbcf
parent488d52e784f4520f679e5823ff2c48057037cbd8 (diff)
mk: tidy up check_cross_compiler
only initialise variables at the point they're needed. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xmk6
1 files changed, 2 insertions, 4 deletions
diff --git a/mk b/mk
index 4d7cf116..2dd9379b 100755
--- a/mk
+++ b/mk
@@ -297,7 +297,6 @@ check_project_hashes()
check_cross_compiler()
{
remkdir "$XBMK_CACHE/gnupath"
- xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
cbdir="src/coreboot/$tree"
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
@@ -309,12 +308,11 @@ check_cross_compiler()
export CROSS_COMPILE="${xarch% *}-"
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
- xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
-
# match gnat-X to gcc
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
- # sometimes buildgcc fails for like no reason. try twice.
+ xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
+ xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
make -C "$cbdir" crossgcc-$xfix $xgccargs || \
x_ make -C "$cbdir" crossgcc-$xfix $xgccargs