summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/xcompile/xcompile51
1 files changed, 26 insertions, 25 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 4a29cdd647..40356d93d9 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -227,6 +227,29 @@ 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}+=-Qunused-arguments -m${TWIDTH}
+# tone down clang compiler warnings
+CLANG_CFLAGS_${TARCH}+=-Wno-unused-variable -Wno-unused-function -Wno-tautological-compare
+CLANG_CFLAGS_${TARCH}+=-Wno-shift-overflow -Wno-address-of-packed-member -Wno-initializer-overrides
+CLANG_COMPILER_RT_${TARCH}:=${CC_RT_CLANG}
+CLANG_COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_CLANG}
+
+# GCC/Clang Common
+ifeq (\$(CONFIG_COMPILER_GCC)\$(CONFIG_LP_COMPILER_GCC),y)
+ 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_CC_${TARCH})
+ CFLAGS_${TARCH}:=\$(CLANG_CFLAGS_${TARCH})
+ COMPILER_RT_${TARCH}:=\$(CLANG_COMPILER_RT_${TARCH})
+ COMPILER_RT_FLAGS_${TARCH}:=\$(CLANG_COMPILER_RT_FLAGS_${TARCH})
+endif
EOF
# Generally the x86 should build for i686 -- no sse/mmx
@@ -238,7 +261,7 @@ EOF
# to use i586 instead.
if [ "${TARCH}" = "x86_64" ]; then
cat <<EOF
- GCC_CFLAGS_${TARCH} += -march=nocona -malign-data=abi
+ CFLAGS_${TARCH} += -march=nocona -malign-data=abi
EOF
fi
@@ -246,37 +269,15 @@ if [ "${TARCH}" = "x86_32" ]; then
cat <<EOF
ifneq (\$(CONFIG_USE_MARCH_586)\$(CONFIG_LP_USE_MARCH_586),)
- GCC_CFLAGS_${TARCH} += -march=i586
+ CFLAGS_${TARCH} += -march=i586
else
- GCC_CFLAGS_${TARCH} += -march=i686
+ CFLAGS_${TARCH} += -march=i686
endif
EOF
fi
cat <<EOF
-# Clang
-CLANG_CC_${TARCH}:=${CLANG}
-CLANG_CFLAGS_${TARCH}:=${CFLAGS_CLANG}
-CLANG_CFLAGS_${TARCH}+=-Qunused-arguments -m${TWIDTH}
-# tone down clang compiler warnings
-CLANG_CFLAGS_${TARCH}+=-Wno-unused-variable -Wno-unused-function -Wno-tautological-compare
-CLANG_CFLAGS_${TARCH}+=-Wno-shift-overflow -Wno-address-of-packed-member -Wno-initializer-overrides
-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_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_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}
LD_${TARCH}:=${GCCPREFIX}ld${LINKER_SUFFIX} ${LDFLAGS}