diff options
| author | Leah Rowe <leah@libreboot.org> | 2023-12-27 15:18:21 +0000 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2023-12-27 16:07:32 +0000 | 
| commit | eff9130b7ab9ce79338ae6b1ec5c2f18bad5b5ec (patch) | |
| tree | cbbb0178e265bac6864a5bbaaa10fd52f4606d5f /script | |
| parent | 6752780f46e3747ead538a7a5b62f63fe86ab505 (diff) | |
update/trees: further simplify crossgcc handling
arch no longer needs to be set, on multi-tree projects,
and it has been renamed to xarch
the new behaviour is: if xarch is set, treat it as a
list of crossgcc targets and go through the list. set
the first one as the target, for what lbmk builds, but
build all of the defined crossgccc targets
crossgcc_ada is now xlang, and defines which languages
to build, rather than whether to build gcc-gnat
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script')
| -rwxr-xr-x | script/build/roms | 3 | ||||
| -rwxr-xr-x | script/update/trees | 33 | 
2 files changed, 12 insertions, 24 deletions
| diff --git a/script/build/roms b/script/build/roms index 44e6db14..aa32ff35 100755 --- a/script/build/roms +++ b/script/build/roms @@ -21,7 +21,7 @@ kmapdir="config/grub/keymap"  # target.cfg files have to specifically enable [a] payload(s)  pv="payload_grub payload_grub_withseabios payload_seabios payload_memtest t"  pv="${pv} payload_seabios_withgrub payload_seabios_grubonly payload_uboot memtest_bin" -v="romdir cbrom initmode displaymode cbcfg targetdir tree arch keymaps" +v="romdir cbrom initmode displaymode cbcfg targetdir tree keymaps"  v="${v} grub_timeout ubdir board grub_scan_disk uboot_config"  eval "$(setvars "n" ${pv})"  eval "$(setvars "" ${v} boards _displaymode _payload _keyboard all targets)" @@ -84,7 +84,6 @@ configure_target()  	    && [ "${grub_scan_disk}" != "ahci" ] && \  		grub_scan_disk="both" -	[ -z "$arch" ] && err "$board: arch not defined"  	[ -z "$tree" ] && err "$board: tree not defined"  	[ "${payload_memtest}" != "y" ] && payload_memtest="n" diff --git a/script/update/trees b/script/update/trees index 9186ebb1..4c969df7 100755 --- a/script/update/trees +++ b/script/update/trees @@ -10,7 +10,7 @@ set -u -e  . "include/option.sh"  . "include/git.sh" -eval "$(setvars "" arch cfgsdir codedir config config_name crossgcc_ada mode \ +eval "$(setvars "" xarch cfgsdir codedir config config_name xlang mode \      elfdir listfile project target target_dir targets tree _f target1)"  main() @@ -140,12 +140,11 @@ handle_src_tree()  	fi  	x_ mkdir -p "${elfdir}/${target}" -	eval "$(setvars "" arch tree)" +	eval "$(setvars "" xarch xlang tree)"  	. "${target_dir}/target.cfg" || \  	    err "handle_src_tree ${target_dir}: cannot load target.cfg" -	[ -z "$arch" ] && err "handle_src_tree $project/$tree: arch unset"  	[ -z "$tree" ] && err "handle_src_tree $project/$tree: tree unset"  	codedir="src/${project}/${tree}" @@ -165,31 +164,21 @@ handle_src_tree()  	check_cross_compiler  } -# set up cross-compiler (coreboot crossgcc) for u-boot and coreboot -# (seabios and grub currently use hostcc, not crossgcc)  check_cross_compiler()  { -	[ "$project" = "u-boot" ] || [ "$project" = "coreboot" ] || return 0 -	[ -z "$arch" ] && err "${project}/${tree}: arch isn't set" +	for _xarch in $xarch; do +		cbdir="src/coreboot/${tree}" +		[ "$project" != "coreboot" ] && cbdir="src/coreboot/default" -	_arch="$arch" -	[ "$arch" = "aarch64-elf" ] && _arch="aarch64-elf arm-eabi" +		x_ ./update trees -f coreboot ${cbdir#src/coreboot/} -	[ "$crossgcc_ada" = "y" ] || [ "$crossgcc_ada" = "n" ] || crossgcc_ada=y -	[ "$crossgcc_ada" = "y" ] || export BUILD_LANGUAGES=c +		export PATH="${PWD}/${cbdir}/util/crossgcc/xgcc/bin:$PATH" +		export CROSS_COMPILE="${xarch% *}-" +		[ -n "${xlang}" ] && export BUILD_LANGUAGES="$xlang" -	cbdir="src/coreboot/${tree}" -	[ "$project" != "coreboot" ] && cbdir="src/coreboot/default" -	x_ ./update trees -f coreboot ${cbdir#src/coreboot/} - -	for xarch in $_arch; do -		[ -d "${cbdir}/util/crossgcc/xgcc/${xarch}/" ] && continue -		x_ make -C "$cbdir" crossgcc-${xarch%-*} CPUS=$(nproc) +		[ -d "${cbdir}/util/crossgcc/xgcc/${_xarch}/" ] && continue +		x_ make -C "$cbdir" crossgcc-${_xarch%-*} CPUS=$(nproc)  	done - -	# we *must* ensure that u-boot's build system uses crossgcc first -	export PATH="${PWD}/${cbdir}/util/crossgcc/xgcc/bin:$PATH" -	export CROSS_COMPILE="${_arch% *}-"  }  check_config() | 
