From a6b220d8f81a61e64d1c17add423b92ae2fa71e2 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Wed, 27 Aug 2014 15:30:19 -0700 Subject: Allow for different BFD elf formats per architecture The upcoming MIPS toolchain inside chroot generates elf images of elf32-tradlittlemips format, whereas readily available tools outside of chroot generate images of elf32-littlemips format. Both of these formats are perfectly fine, but xcompile accepts only one format per CPU architecture. This patch allows to specify multiple formats per architecture, any matching format will suffice. BUG=chrome-os-partner:31438 TEST=emerged arm, x86 and mips targets inside chroot Change-Id: I2c6b8e46b9299059b8e099b93c8c3dcf0a569899 Signed-off-by: Patrick Georgi Original-Commit-Id: 7f2f1d51643f33b72ac5e4091669f38662e5b9ce Original-Change-Id: I22405e71ac72b985fad51e2f5d7cc014107b8a9e Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/214599 Original-Reviewed-by: Stefan Reinauer Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/8823 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/xcompile/xcompile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'util/xcompile') diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index 29cad285cf..3c3b1a4e2f 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -172,7 +172,7 @@ SUPPORTED_ARCHITECTURE="x86 arm arm64 riscv mipsel" arch_config_arm() { TARCH="arm" - TBFDARCH="littlearm" + TBFDARCHS="littlearm" TCLIST="armv7a armv7-a" TWIDTH="32" TSUPP="arm armv4 armv7" @@ -181,7 +181,7 @@ arch_config_arm() { arch_config_arm64() { TARCH="arm64" - TBFDARCH="littleaarch64" + TBFDARCHS="littleaarch64" TCLIST="aarch64" TWIDTH="64" TSUPP="arm64 armv8_64" @@ -190,7 +190,7 @@ arch_config_arm64() { arch_config_riscv() { TARCH="riscv" - TBFDARCH="littleriscv" + TBFDARCHS="littleriscv" TCLIST="riscv" TWIDTH="64" TABI="elf" @@ -198,7 +198,7 @@ arch_config_riscv() { arch_config_x86() { TARCH="x86_32" - TBFDARCH="i386" + TBFDARCHS="i386" TCLIST="i386 x86_64" TWIDTH="32" TABI="elf" @@ -206,7 +206,7 @@ arch_config_x86() { arch_config_mipsel() { TARCH="mipsel" - TBFDARCH="littlemips" + TBFDARCHS="tradlittlemips littlemips" TCLIST="mipsel" TWIDTH="32" TABI="elf" @@ -238,10 +238,13 @@ test_architecture() { echo "# $architecture TARCH_SEARCH=$search" # Search toolchain by checking assembler capability. - for gccprefixes in $search ""; do - program_exists "${gccprefixes}as" || continue - testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "" && break - testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "TRUE" && break + for TBFDARCH in $TBFDARCHS; do + for gccprefixes in $search ""; do + program_exists "${gccprefixes}as" || continue + testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "" && break + testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "TRUE" && break + done + [ "$GCCPREFIX" = "invalid" ] || break done if [ "$GCCPREFIX" = "invalid" ]; then -- cgit v1.2.3