Browse Source

make configure attempt to catch broken floating point CFLAGS/defaults

Rich Felker 9 năm trước cách đây
mục cha
commit
80fbaac4cd
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      configure

+ 10 - 0
configure

@@ -655,6 +655,16 @@ printf "no\n"
 fail "$0: error: unsupported long double type"
 fi
 
+#
+# Some build systems globally pass in broken CFLAGS like -ffast-math
+# for all packages. On recent GCC we can detect this and error out
+# early rather than producing a seriously-broken math library.
+#
+if trycppif "__FAST_MATH__ || (defined(__GCC_IEC_559) && __GCC_IEC_559==0)" \
+  "$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" ; then
+fail "$0: error: compiler has broken floating point; check CFLAGS"
+fi
+
 printf "creating config.mak... "
 
 cmdline=$(quote "$0")