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 <pgeorgi@chromium.org>
Original-Commit-Id: 7f2f1d51643f33b72ac5e4091669f38662e5b9ce
Original-Change-Id: I22405e71ac72b985fad51e2f5d7cc014107b8a9e
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/214599
Original-Reviewed-by: Stefan Reinauer <reinauer@google.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8823
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Vadim Bendebury 2014-08-27 15:30:19 -07:00 committed by Patrick Georgi
parent b1688caa6f
commit a6b220d8f8
1 changed files with 12 additions and 9 deletions

View File

@ -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,11 +238,14 @@ test_architecture() {
echo "# $architecture TARCH_SEARCH=$search"
# Search toolchain by checking assembler capability.
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
echo "Warning: no suitable GCC for $architecture." >&2