trees: hardcode makeargs for xgcc

if coreboot itself is being handled, crossgcc has the
correct makeargs, setting the number of build threads.

however, other projects can specify "xtree" pointing to
a given coreboot tree, and build crossgcc for it.

one workaround may be to use trees -d coreboot TREE,
but then extra code would have to be written to make
it avoid other things like building cbfstool, which is
not required for just building crossgcc.

the cleanest way to do it is to simply hardcode it. the
value is set exactly the same as regular coreboot makeargs.

this fixes a bug, where some builds of crossgcc are made
on a single thread, rather than using XBMK_THREADS. this
patch forces it to always use CPUS=$XBMK_THREADS

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2
Leah Rowe 2024-07-17 23:25:44 +01:00 committed by Leah Rowe
parent 1bc484dbf6
commit 71091e03a7
1 changed files with 4 additions and 3 deletions

View File

@ -204,6 +204,7 @@ check_project_hashes()
check_cross_compiler() check_cross_compiler()
{ {
xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
for _xarch in $xarch; do for _xarch in $xarch; do
cbdir="src/coreboot/$tree" cbdir="src/coreboot/$tree"
[ "$project" != "coreboot" ] && cbdir="src/coreboot/default" [ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
@ -216,9 +217,9 @@ check_cross_compiler()
[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang" [ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
# sometimes buildgcc fails for like no reason. try twice. # sometimes buildgcc fails for like no reason. try twice.
make -C "$cbdir" crossgcc-${_xarch%-*} $makeargs || \ make -C "$cbdir" crossgcc-${_xarch%-*} $xgccargs || \
make -C "$cbdir" crossgcc-${_xarch%-*} $makeargs || \ make -C "$cbdir" crossgcc-${_xarch%-*} $xgccargs || \
$err "!mkxgcc $project/$xtree '${_xarch%-*}' '$makeargs'" $err "!mkxgcc $project/$xtree '${_xarch%-*}' '$xgccargs'"
done; return 0 done; return 0
} }