From 7f2f1d51643f33b72ac5e4091669f38662e5b9ce Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Wed, 27 Aug 2014 15:30:19 -0700 Subject: [PATCH] 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: I22405e71ac72b985fad51e2f5d7cc014107b8a9e Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/214599 Reviewed-by: Stefan Reinauer Reviewed-by: Aaron Durbin --- util/xcompile/xcompile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index f8f3869dcc..442e36e7e2 100644 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -167,7 +167,7 @@ XGCCPATH=${1:-"`pwd`/util/crossgcc/xgcc/bin/"} # MIPS Architecture (Little Endian) TARCH_mipsel="mipsel" -TBFDARCH_mipsel="littlemips" +TBFDARCH_mipsel="tradlittlemips littlemips" TCLIST_mipsel="mipsel" TWIDTH_mipsel="32" @@ -175,7 +175,7 @@ TWIDTH_mipsel="32" for architecture in $SUPPORTED_ARCHITECTURE; do GCCPREFIX="invalid" TARCH="$(eval echo \$TARCH_$architecture)" - TBFDARCH="$(eval echo \$TBFDARCH_$architecture)" + TBFDARCHS="$(eval echo \$TBFDARCH_$architecture)" TCLIST="$(eval echo \$TCLIST_$architecture)" TWIDTH="$(eval echo \$TWIDTH_$architecture)" [ -z "$TARCH" -o -z "$TCLIST" -o -z "$TWIDTH" ] && @@ -196,10 +196,13 @@ for architecture in $SUPPORTED_ARCHITECTURE; do 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