]> granicus.if.org Git - python/commitdiff
Patch #1608. Someone with access to autoconf 2.61 or higher needs to
authorGuido van Rossum <guido@python.org>
Thu, 13 Dec 2007 20:50:10 +0000 (20:50 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 13 Dec 2007 20:50:10 +0000 (20:50 +0000)
run it and check in the resulting configure file.

Misc/ACKS
Misc/NEWS
configure.in

index 65ee9e7a70f4479be6c00a7fdb7a173fda8dc073..3b968dde8c990b3dea1b12abdfde7df56e6ab6bb 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -167,6 +167,7 @@ Yves Dionne
 Daniel Dittmar
 Walter Dörwald
 Jaromir Dolecek
+Ismail Donmez
 Dima Dorfman
 Cesar Douady
 Dean Draayer
index 7dae508ec22dfd3ca946b848d8cf899327e3dd53..0d420d0e38501a7ff836d5936aa7cd0bd4b48536 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1123,6 +1123,10 @@ Tools/Demos
 Build
 -----
 
+- Bug #1608: use -fwrapv when GCC supports it.  This is important,
+  newer GCC versions may optimize away overflow buffer overflow checks
+  without this option!
+
 - Patch #1418: Make the AC_REPLACE_FUNCS object files actually work.
 
 - Add a FAST_LOOPS build option that speeds-up looping by trading away
index b0313e2472b65a21bd700e70b4c575f4726ca522..496495483e198a8f27e2d3164e68f3fe8c0caac6 100644 (file)
@@ -757,6 +757,10 @@ then
         if test "$CC" != 'g++' ; then
            STRICT_PROTO="-Wstrict-prototypes"
        fi
+        # For gcc 4.x we need to use -fwrapv so lets check if its supported
+        if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
+           WRAP="-fwrapv"
+        fi
        case $ac_cv_prog_cc_g in
        yes)
            if test "$Py_DEBUG" = 'true' ; then
@@ -764,7 +768,7 @@ then
                # debug builds.
                OPT="-g -Wall $STRICT_PROTO"
            else
-               OPT="-g -O3 -Wall $STRICT_PROTO"
+               OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
            fi
            ;;
        *)