xcompile: Rename internal variable CFLAGS to CFLAGS_GCC

This is in preparation of adding support for clang to xcompile.

Change-Id: I518d077f134610082b0939b1525682f2289eec34
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10423
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi 2015-06-04 13:20:24 +02:00 committed by Patrick Georgi
parent 93af2f271d
commit 532df293da
1 changed files with 19 additions and 19 deletions

View File

@ -100,11 +100,11 @@ testas() {
if [ -z "$use_dash_twidth" ]; then if [ -z "$use_dash_twidth" ]; then
ASFLAGS="" ASFLAGS=""
CFLAGS="" CFLAGS_GCC=""
LDFLAGS="" LDFLAGS=""
else else
ASFLAGS="--$twidth" ASFLAGS="--$twidth"
CFLAGS="-m$twidth" CFLAGS_GCC="-m$twidth"
LDFLAGS="-b $full_arch" LDFLAGS="-b $full_arch"
fi fi
@ -113,7 +113,7 @@ testas() {
[ -n "$use_dash_twidth" ] && case "$full_arch" in [ -n "$use_dash_twidth" ] && case "$full_arch" in
"elf32-i386" ) "elf32-i386" )
LDFLAGS="$LDFLAGS -melf_i386" LDFLAGS="$LDFLAGS -melf_i386"
CFLAGS="$CFLAGS -Wl,-b,elf32-i386 -Wl,-melf_i386" CFLAGS_GCC="$CFLAGS_GCC -Wl,-b,elf32-i386 -Wl,-melf_i386"
;; ;;
esac esac
@ -124,35 +124,35 @@ detect_special_flags() {
local architecture="$1" local architecture="$1"
# GCC 4.6 is much more picky about unused variables. # GCC 4.6 is much more picky about unused variables.
# Turn off it's warnings for now: # Turn off it's warnings for now:
testcc "$CC" "$CFLAGS -Wno-unused-but-set-variable " && testcc "$CC" "$CFLAGS_GCC -Wno-unused-but-set-variable " &&
CFLAGS="$CFLAGS -Wno-unused-but-set-variable " CFLAGS_GCC="$CFLAGS_GCC -Wno-unused-but-set-variable "
# Use bfd linker instead of gold if available: # Use bfd linker instead of gold if available:
testcc "$CC" "$CFLAGS -fuse-ld=bfd" && testcc "$CC" "$CFLAGS_GCC -fuse-ld=bfd" &&
CFLAGS="$CFLAGS -fuse-ld=bfd" && LINKER_SUFFIX='.bfd' CFLAGS_GCC="$CFLAGS_GCC -fuse-ld=bfd" && LINKER_SUFFIX='.bfd'
testcc "$CC" "$CFLAGS -fno-stack-protector"&& testcc "$CC" "$CFLAGS_GCC -fno-stack-protector"&&
CFLAGS="$CFLAGS -fno-stack-protector" CFLAGS_GCC="$CFLAGS_GCC -fno-stack-protector"
testcc "$CC" "$CFLAGS -Wl,--build-id=none" && testcc "$CC" "$CFLAGS_GCC -Wl,--build-id=none" &&
CFLAGS="$CFLAGS -Wl,--build-id=none" CFLAGS_GCC="$CFLAGS_GCC -Wl,--build-id=none"
case "$architecture" in case "$architecture" in
x86) x86)
testcc "$CC" "$CFLAGS -Wa,--divide" && testcc "$CC" "$CFLAGS_GCC -Wa,--divide" &&
CFLAGS="$CFLAGS -Wa,--divide" CFLAGS_GCC="$CFLAGS_GCC -Wa,--divide"
# Always build for i686 -- no sse/mmx instructions since SMM # Always build for i686 -- no sse/mmx instructions since SMM
# modules are compiled using these flags. Note that this # modules are compiled using these flags. Note that this
# doesn't prevent a project using xcompile to explicitly # doesn't prevent a project using xcompile to explicitly
# specify -mmsse, etc flags. # specify -mmsse, etc flags.
CFLAGS="$CFLAGS -march=i686" CFLAGS_GCC="$CFLAGS_GCC -march=i686"
;; ;;
mipsel) mipsel)
testcc "$CC" "$CFLAGS -mno-abicalls -fno-pic" && \ testcc "$CC" "$CFLAGS_GCC -mno-abicalls -fno-pic" && \
CFLAGS+=" -mno-abicalls -fno-pic" CFLAGS_GCC+=" -mno-abicalls -fno-pic"
# Enforce little endian mode. # Enforce little endian mode.
testcc "$CC" "$CFLAGS -EL" && \ testcc "$CC" "$CFLAGS_GCC -EL" && \
CFLAGS+=" -EL" CFLAGS_GCC+=" -EL"
;; ;;
esac esac
} }
@ -163,7 +163,7 @@ report_arch_toolchain() {
ARCH_SUPPORTED+=${TARCH} ARCH_SUPPORTED+=${TARCH}
SUBARCH_SUPPORTED+=${TSUPP-${TARCH}} SUBARCH_SUPPORTED+=${TSUPP-${TARCH}}
CC_${TARCH}:=${GCCPREFIX}gcc CC_${TARCH}:=${GCCPREFIX}gcc
CFLAGS_${TARCH}:=${CFLAGS} CFLAGS_${TARCH}:=${CFLAGS_GCC}
CPP_${TARCH}:=${GCCPREFIX}cpp CPP_${TARCH}:=${GCCPREFIX}cpp
AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS} AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS}
LD_${TARCH}:=${GCCPREFIX}ld${LINKER_SUFFIX} ${LDFLAGS} LD_${TARCH}:=${GCCPREFIX}ld${LINKER_SUFFIX} ${LDFLAGS}