[coreboot-gerrit] New patch to review for coreboot: buildgcc: Never set GMP CFLAGS manually in order to get the right flags
Paul Kocialkowski (contact@paulk.fr)
gerrit at coreboot.org
Mon Jun 27 23:05:01 CEST 2016
Paul Kocialkowski (contact at paulk.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15452
-gerrit
commit baadd6aa8e89f4c17189309bf3b54640a2c12de0
Author: Paul Kocialkowski <contact at paulk.fr>
Date: Fri Jun 17 21:41:00 2016 -0700
buildgcc: Never set GMP CFLAGS manually in order to get the right flags
When no CFLAGS are explicitly provided to it, the GMP configure script
will figure out the best optimization flags to use on its own. In
particular, it will setup the march, mfpu and mtune flags based on
hardware detection.
However, when CFLAGS are provided, they are used as-is and such
detection doesn't happen. When the march, mfpu and mtune flags are not
provided (which happens when GMP wasn't built already), not only will
related optimizations be disabled, but some code might not build because
of missing support. This happens with NEON instructions on ARMv7 hosts.
Thus, it is better not to set CFLAGS and leave it up to the GMP
configure script to get them right and still reuse those later.
Change-Id: I6ffcbac1298523d1b8ddf29a8bca1b00298828a7
Signed-off-by: Paul Kocialkowski <contact at paulk.fr>
---
util/crossgcc/buildgcc | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 1e761da..118a50b 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -404,10 +404,6 @@ GNU General Public License for more details.
EOF
}
-have_hostcflags_from_gmp() {
- grep -q __GMP_CFLAGS $DESTDIR$TARGETDIR/include/gmp.h >/dev/null 2>&1
-}
-
set_hostcflags_from_gmp() {
# Now set CFLAGS to match GMP CFLAGS but strip out -pedantic
# as GCC 4.6.x fails if it's there.
@@ -416,7 +412,7 @@ set_hostcflags_from_gmp() {
}
build_GMP() {
- CC="$CC" CFLAGS="$HOSTCFLAGS" \
+ CC="$CC" \
../${GMP_DIR}/configure --disable-shared --enable-fat \
--prefix=$TARGETDIR $OPTIONS \
|| touch .failed
@@ -788,11 +784,6 @@ elif [ $UNAME = "NetBSD" ]; then
fi
fi # GCC
-export HOSTCFLAGS="-Os"
-if have_hostcflags_from_gmp; then
- set_hostcflags_from_gmp
-fi
-
if [ "$USECCACHE" = 1 ]; then
CC="ccache $CC"
fi
More information about the coreboot-gerrit
mailing list