summaryrefslogtreecommitdiff
path: root/include/tree.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-08-23 16:02:40 +0100
committerLeah Rowe <leah@libreboot.org>2025-08-23 16:02:40 +0100
commit07562e3f281492cb040072e78468114d1a960bee (patch)
tree22d16877049b003078dd0d375fbfb2feb3c4645b /include/tree.sh
parent66f1be1ba77b44bfae29beb7678fb0598ede8030 (diff)
tree.sh: don't re-check xgcc needlessly
instead, create a file indicating that a given xgcc target had already been built successfully, within a given coreboot tree. this will considerably speed up the building of release archives, especially when there are a lot of boards. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/tree.sh')
-rw-r--r--include/tree.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/tree.sh b/include/tree.sh
index 093d5d9c..75dd230b 100644
--- a/include/tree.sh
+++ b/include/tree.sh
@@ -222,6 +222,10 @@ project_up_to_date()
check_cross_compiler()
{
cbdir="src/coreboot/$tree"
+ xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
+ xgccfile="elf/coreboot/$tree/xgcc_${xfix}_was_compiled"
+ x_ mkdir -p "elf/coreboot/$tree"
+
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
[ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
@@ -231,13 +235,16 @@ check_cross_compiler()
export CROSS_COMPILE="${xarch% *}-"
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
+ [ -f "$xgccfile" ] && return 0 # skip build if already done
+
# match gnat-X to gcc
check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
- xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
xgccargs="crossgcc-$xfix UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
make -C "$cbdir" $xgccargs || x_ make -C "$cbdir" $xgccargs
+ x_ touch "$xgccfile"
+
# we only want to mess with hostcc to build xgcc
remkdir "$XBMK_CACHE/gnupath"
}