diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-08 19:38:17 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-08 19:38:17 +0000 |
commit | 68e1881d7403f946c72275220d8e6b089c6701b9 (patch) | |
tree | a1a0850efce956decdd30ccf8cc67d64ab875d26 /libgo/configure.ac | |
parent | 72851b689c79d92cf20066ff706cfc5e06392e67 (diff) | |
download | gcc-68e1881d7403f946c72275220d8e6b089c6701b9.tar.gz |
math: Compile with -mfancy-math-387 -funsafe-optimizations on x86.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184015 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/configure.ac')
-rw-r--r-- | libgo/configure.ac | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libgo/configure.ac b/libgo/configure.ac index 3de5b4a2c8b..155a412ee68 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -522,6 +522,23 @@ if test "$libgo_cv_c_stringops" = yes; then fi AC_SUBST(STRINGOPS_FLAG) +dnl For x86 we want to compile the math library with -mfancy-math-387 +dnl -funsafe-math-optimizations so that we can use the builtin +dnl instructions directly. +AC_CACHE_CHECK([whether compiler supports -mfancy-math-387], +[libgo_cv_c_fancymath], +[CFLAGS_hold=$CFLAGS +CFLAGS="$CFLAGS -mfancy-math-387" +AC_COMPILE_IFELSE([int i;], +[libgo_cv_c_fancymath=yes], +[libgo_cv_c_fancymath=no]) +CFLAGS=$CFLAGS_hold]) +MATH_FLAG= +if test "$libgo_cv_c_fancymath" = yes; then + MATH_FLAG="-mfancy-math-387 -funsafe-math-optimizations" +fi +AC_SUBST(MATH_FLAG) + CFLAGS_hold=$CFLAGS CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" AC_CHECK_TYPES([off64_t]) |