[coreboot-gerrit] New patch to review for coreboot: xcompile: Fix compiler invocation in testcc

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Tue Jul 7 00:55:08 CEST 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10816

-gerrit

commit 0329a29c2b15912c788a3a1aeb7e567eb362594b
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Tue Jul 7 00:26:59 2015 +0200

    xcompile: Fix compiler invocation in testcc
    
    While for GCC targets the compiler is just defined as a single
    binary, for clang it is defined as a binary and some options, e.g.:
      clang -target i386-elf -ccc-gcc-name i386-elf-gcc
    
    When executing the compiler with "$1", the shell will look for a
    binary with the above name (instead of just clang) and always fail
    detection of any CFLAGS.
    
    By adding -c we prevent the compiler from failing because it can't
    link a user space program (when what we're looking for, is whether
    a specific compiler flag can be used to compile a coreboot object
    file)
    
    Change-Id: I1e9ff32fe40efbe3224c69785f31bc277f21d21b
    Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
 util/xcompile/xcompile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index c671172..7ae1e39 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -72,7 +72,7 @@ testcc() {
 	local tmp_o="$TMPFILE.o"
 	rm -f "$tmp_c" "$tmp_o"
 	echo "void _start(void) {}" >"$tmp_c"
-	"$1" -nostdlib -Werror $2 "$tmp_c" -o "$tmp_o" >/dev/null 2>&1
+	$1 -nostdlib -Werror $2 -c "$tmp_c" -o "$tmp_o" >/dev/null 2>&1
 }
 
 testas() {



More information about the coreboot-gerrit mailing list