Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit105907f

Browse files
committed
Put in defense against gcc -ffast-math.
1 parent316d4e2 commit105907f

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

‎configure

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,6 +2442,7 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
24422442
fi
24432443
{echo"$as_me:$LINENO: using CFLAGS=$CFLAGS">&5
24442444
echo"$as_me: using CFLAGS=$CFLAGS">&6;}
2445+
24452446
# Check if the compiler still works with the template settings
24462447
echo"$as_me:$LINENO: checking whether the C compiler still works">&5
24472448
echo$ECHO_N"checking whether the C compiler still works...$ECHO_C">&6
@@ -2488,6 +2489,52 @@ echo "$as_me: error: cannot proceed" >&2;}
24882489
{ (exit 1);exit 1; }; }
24892490
fi
24902491
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2492+
2493+
# Defend against gcc -ffastmath
2494+
iftest"$GCC" = yes;then
2495+
cat>conftest.$ac_ext<<_ACEOF
2496+
#line$LINENO "configure"
2497+
#include "confdefs.h"
2498+
2499+
#ifdef F77_DUMMY_MAIN
2500+
# ifdef __cplusplus
2501+
extern "C"
2502+
# endif
2503+
int F77_DUMMY_MAIN() { return 1; }
2504+
#endif
2505+
int
2506+
main ()
2507+
{
2508+
#ifdef __FAST_MATH__
2509+
choke me
2510+
#endif
2511+
;
2512+
return 0;
2513+
}
2514+
_ACEOF
2515+
rm -f conftest.$ac_objext
2516+
if { (evalecho"$as_me:$LINENO:\"$ac_compile\"")>&5
2517+
(eval$ac_compile)2>&5
2518+
ac_status=$?
2519+
echo"$as_me:$LINENO:\$? =$ac_status">&5
2520+
(exit$ac_status); }&&
2521+
{ ac_try='test -s conftest.$ac_objext'
2522+
{ (evalecho"$as_me:$LINENO:\"$ac_try\"")>&5
2523+
(eval$ac_try)2>&5
2524+
ac_status=$?
2525+
echo"$as_me:$LINENO:\$? =$ac_status">&5
2526+
(exit$ac_status); }; };then
2527+
:
2528+
else
2529+
echo"$as_me: failed program was:">&5
2530+
cat conftest.$ac_ext>&5
2531+
{ {echo"$as_me:$LINENO: error: do not put -ffast-math in CFLAGS">&5
2532+
echo"$as_me: error: do not put -ffast-math in CFLAGS">&2;}
2533+
{ (exit 1);exit 1; }; }
2534+
fi
2535+
rm -f conftest.$ac_objext conftest.$ac_ext
2536+
fi
2537+
24912538
ac_ext=c
24922539
ac_cpp='$CPP $CPPFLAGS'
24932540
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'

‎configure.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.209 2002/09/17 04:27:41 momjian Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.210 2002/09/20 18:38:57 petere Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -253,12 +253,21 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
253253
CFLAGS="$CFLAGS -g"
254254
fi
255255
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
256+
256257
# Check if the compiler still works with the template settings
257258
AC_MSG_CHECKING([whether the C compiler still works])
258259
AC_TRY_LINK([], [return 0;],
259260
[AC_MSG_RESULT(yes)],
260261
[AC_MSG_RESULT(no)
261262
AC_MSG_ERROR([cannot proceed])])
263+
264+
# Defend against gcc -ffastmath
265+
if test "$GCC" = yes; then
266+
AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__
267+
choke me
268+
@%:@endif], [], [AC_MSG_ERROR([do not put -ffast-math in CFLAGS])])
269+
fi
270+
262271
AC_PROG_CPP
263272
AC_SUBST(GCC)
264273

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp