In 2007 Adrian Reber suggested that we drop ASSEMBLY in favor of __ASSEMBLER__.
[coreboot.git] / util / xcompile / xcompile
index 65e6e704f72a9334a0cfa25d330ef02873c41bf9..19103c7ade61b06d168380ad9452c2d4842ecf1d 100644 (file)
@@ -35,8 +35,8 @@ for make in make gmake gnumake; do
 done
 
 GCCPREFIX=invalid
-TMP=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz`
-touch $TMP
+TMPFILE=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz`
+touch $TMPFILE
 
 # This should be a loop over all supported architectures
 TARCH=i386
@@ -45,9 +45,9 @@ for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- "";
        if ! which ${gccprefixes}as 2>/dev/null >/dev/null; then
                continue
        fi
-       rm -f ${TMP}.o
-       if ${gccprefixes}as -o ${TMP}.o ${TMP}; then
-               TYPE=`${gccprefixes}objdump -p ${TMP}.o`
+       rm -f ${TMPFILE}.o
+       if ${gccprefixes}as -o ${TMPFILE}.o ${TMPFILE}; then
+               TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o`
                if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then
                        GCCPREFIX=$gccprefixes
                        ASFLAGS=
@@ -56,8 +56,8 @@ for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- "";
                        break
                fi
        fi
-       if ${gccprefixes}as --32 -o ${TMP}.o ${TMP}; then
-               TYPE=`${gccprefixes}objdump -p ${TMP}.o`
+       if ${gccprefixes}as --32 -o ${TMPFILE}.o ${TMPFILE}; then
+               TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o`
                if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then
                        GCCPREFIX=$gccprefixes
                        ASFLAGS=--32
@@ -67,7 +67,7 @@ for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- "";
                fi
        fi
 done
-rm -f $TMP ${TMP}.o
+rm -f $TMPFILE ${TMPFILE}.o
 
 if [ "$GCCPREFIX" = "invalid" ]; then
        echo '$(error no suitable gcc found)'
@@ -75,6 +75,7 @@ if [ "$GCCPREFIX" = "invalid" ]; then
 fi
 
 CC="${GCCPREFIX}gcc"
+testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
 testcc "$CC" "$CFLAGS-fno-stack-protector " && CFLAGS="$CFLAGS-fno-stack-protector "
 testcc "$CC" "$CFLAGS-Wl,--build-id=none " && CFLAGS="$CFLAGS-Wl,--build-id=none "
 
@@ -88,7 +89,6 @@ cat << EOF
 # elf${TWIDTH}-${TARCH} toolchain
 AS:=${GCCPREFIX}as ${ASFLAGS}
 CC:=${GCCPREFIX}gcc ${CFLAGS}
-CPP:=${GCCPREFIX}cpp
 AR:=${GCCPREFIX}ar
 LD:=${GCCPREFIX}ld ${LDFLAGS}
 STRIP:=${GCCPREFIX}strip