mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
xcompile: test if gcc is really available
Just because an 'as' with a certain prefix is available does not guarantee that a 'gcc' with the same prefix is available as well. Without a check detect_compiler_runtime() would try to execute an unavailable binary and print something like this: .../xcompile: line 218: arm-linux-gnueabi-gcc: command not found Change-Id: Icbadfeb2860152f7cf7696a9122521d0d881f3aa Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at> Reviewed-on: https://review.coreboot.org/14563 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
2d67d12570
commit
98ab22711d
1 changed files with 6 additions and 6 deletions
|
@ -149,9 +149,6 @@ testas() {
|
||||||
local obj_arch="$(expr "$obj_type" : '.*format \(.[a-z0-9-]*\)')"
|
local obj_arch="$(expr "$obj_type" : '.*format \(.[a-z0-9-]*\)')"
|
||||||
[ "$obj_arch" = "$full_arch" ] || return 1
|
[ "$obj_arch" = "$full_arch" ] || return 1
|
||||||
|
|
||||||
# Architecture matched.
|
|
||||||
GCCPREFIX="$gccprefix"
|
|
||||||
|
|
||||||
unset ASFLAGS LDFLAGS
|
unset ASFLAGS LDFLAGS
|
||||||
unset CFLAGS_GCC CFLAGS_CLANG
|
unset CFLAGS_GCC CFLAGS_CLANG
|
||||||
|
|
||||||
|
@ -414,10 +411,13 @@ test_architecture() {
|
||||||
for gccprefix in $search ""; do
|
for gccprefix in $search ""; do
|
||||||
program_exists "${gccprefix}as" || continue
|
program_exists "${gccprefix}as" || continue
|
||||||
for endian in $TENDIAN ""; do
|
for endian in $TENDIAN ""; do
|
||||||
|
{ testas "$gccprefix" "$TWIDTH" "$TBFDARCH" \
|
||||||
|
"" "$endian" ||
|
||||||
testas "$gccprefix" "$TWIDTH" "$TBFDARCH" \
|
testas "$gccprefix" "$TWIDTH" "$TBFDARCH" \
|
||||||
"" "$endian" && break 3
|
"TRUE" "$endian" ; } && \
|
||||||
testas "$gccprefix" "$TWIDTH" "$TBFDARCH" \
|
testcc "${gccprefix}gcc" "$CFLAGS_GCC" && \
|
||||||
"TRUE" "$endian" && break 3
|
GCCPREFIX="$gccprefix" && \
|
||||||
|
break 3
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue