[coreboot-gerrit] New patch to review for coreboot: xcompile: Put compiler variables outside of 'if' to allow checking

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Tue Jan 5 23:01:23 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12841

-gerrit

commit 57e01765dffa1eafab9b5f4e2f0a091630cc9a2f
Author: Martin Roth <martinroth at google.com>
Date:   Tue Jan 5 14:47:59 2016 -0700

    xcompile: Put compiler variables outside of 'if' to allow checking
    
    In order to be able to check the compiler versions, we need to be
    able to access the compiler variables.  Move the original assignments
    outside of the GCC check, and assign either the GCC or CLANG compiler
    to the actual CC_ environment variable later.  This ends up with the
    same value set, while allowing the compiler versions to be checked.
    
    Change-Id: Iffad02d526420ebbdfb15ed45eb51187caaa94fb
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 util/xcompile/xcompile | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index ebaf286..be08f74 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -197,19 +197,32 @@ report_arch_toolchain() {
 # elf${TWIDTH}-${TBFDARCH} toolchain (${GCC})
 ARCH_SUPPORTED+=${TARCH}
 SUBARCH_SUPPORTED+=${TSUPP-${TARCH}}
+
+# GCC
+GCC_CC_${TARCH}:=${GCC}
+GCC_CFLAGS_${TARCH}:=${CFLAGS_GCC}
+GCC_COMPILER_RT_${TARCH}:=${CC_RT_GCC}
+GCC_COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_GCC}
+
+# Clang
+CLANG_CC_${TARCH}:=${CLANG}
+CLANG_CFLAGS_${TARCH}:=${CFLAGS_CLANG}
+CLANG_CFLAGS_${TARCH}+=-no-integrated-as -Qunused-arguments -m${TWIDTH}
+# tone down clang compiler warnings
+CLANG_CFLAGS_${TARCH}+=-Wno-unused-variable -Wno-unused-function -Wno-tautological-compare -Wno-shift-overflow
+CLANG_COMPILER_RT_${TARCH}:=${CC_RT_CLANG}
+CLANG_COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_CLANG}
+
 ifeq (\$(CONFIG_COMPILER_GCC)\$(CONFIG_LP_COMPILER_GCC),y)
-CC_${TARCH}:=${GCC}
-CFLAGS_${TARCH}:=${CFLAGS_GCC}
-COMPILER_RT_${TARCH}:=${CC_RT_GCC}
-COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_GCC}
+	CC_${TARCH}:=\$(GCC_CC_${TARCH})
+	CFLAGS_${TARCH}:=\$(GCC_CFLAGS_${TARCH})
+	COMPILER_RT_${TARCH}:=\$(GCC_COMPILER_RT_${TARCH})
+	COMPILER_RT_FLAGS_${TARCH}:=\$(GCC_COMPILER_RT_FLAGS_${TARCH})
 else
-CC_${TARCH}:=${CLANG}
-CFLAGS_${TARCH}:=${CFLAGS_CLANG}
-CFLAGS_${TARCH}+=-no-integrated-as -Qunused-arguments -m${TWIDTH}
-# tone down compiler warnings
-CFLAGS_${TARCH}+=-Wno-unused-variable -Wno-unused-function -Wno-tautological-compare -Wno-shift-overflow
-COMPILER_RT_${TARCH}:=${CC_RT_CLANG}
-COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_CLANG}
+	CC_${TARCH}:=\$(CLANG_CC_${TARCH})
+	CFLAGS_${TARCH}:=\$(CLANG_CFLAGS_${TARCH})
+	COMPILER_RT_${TARCH}:=\$(CLANG_COMPILER_RT_${TARCH})
+	COMPILER_RT_FLAGS_${TARCH}:=\$(CLANG_COMPILER_RT_FLAGS_${TARCH})
 endif
 CPP_${TARCH}:=${GCCPREFIX}cpp
 AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS}



More information about the coreboot-gerrit mailing list