diff options
author | Martin Roth <martinroth@google.com> | 2016-01-05 15:49:32 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-01-07 17:24:50 +0100 |
commit | 7051dea5f4863ff1d1a08fe89dbb23bd18898974 (patch) | |
tree | 3ffe9dbda18a7ede388c4c4ebaa70beacb324e30 /util | |
parent | 033abe5e690d2533b768eae9c236bde70d514980 (diff) |
xcompile: Use local variables in the test functions
Using the local variables instead of positional parameters helps
readability.
- Add and use the local variables in testcc.
- Use the existing local variables in testld.
Change-Id: Ice13288b830a7aa043b360eaee8e36f060589a18
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12844
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util')
-rwxr-xr-x | util/xcompile/xcompile | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index b336f88c64..48df75b11b 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -74,11 +74,13 @@ HOSTCC?=${HOSTCC} EOF testcc() { + local cc="$1" + local cflags="$2" local tmp_c="$TMPFILE.c" local tmp_o="$TMPFILE.o" rm -f "$tmp_c" "$tmp_o" echo "void _start(void) {}" >"$tmp_c" - $1 -nostdlib -Werror $2 -c "$tmp_c" -o "$tmp_o" >/dev/null 2>&1 + "$cc" -nostdlib -Werror $cflags -c "$tmp_c" -o "$tmp_o" >/dev/null 2>&1 } testld() { @@ -89,8 +91,8 @@ testld() { local tmp_o="$TMPFILE.o" local tmp_elf="$TMPFILE.elf" rm -f "$tmp_elf" - testcc $1 $2 && - $3 -nostdlib -static $4 -o "$tmp_elf" "$tmp_o" >/dev/null 2>&1 + testcc "$gcc" "$cflags" && + $ld -nostdlib -static $ldflags -o "$tmp_elf" "$tmp_o" >/dev/null 2>&1 } testas() { |