[Python-checkins] cpython (3.4): Issue #23445: pydebug builds now use "gcc -Og" where possible, to make the

antoine.pitrou python-checkins at python.org
Wed Feb 11 19:41:17 CET 2015


https://hg.python.org/cpython/rev/e37b201297d2
changeset:   94591:e37b201297d2
branch:      3.4
parent:      94589:368b2021c2e7
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Feb 11 19:39:16 2015 +0100
summary:
  Issue #23445: pydebug builds now use "gcc -Og" where possible, to make the resulting executable faster.

files:
  Misc/NEWS    |  6 ++++++
  configure    |  6 +++++-
  configure.ac |  6 +++++-
  3 files changed, 16 insertions(+), 2 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -17,6 +17,12 @@
 
 - Issue #23361: Fix possible overflow in Windows subprocess creation code.
 
+Build
+-----
+
+- Issue #23445: pydebug builds now use "gcc -Og" where possible, to make
+  the resulting executable faster.
+
 
 What's New in Python 3.4.3rc1?
 ==============================
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -6283,7 +6283,11 @@
 	    if test "$Py_DEBUG" = 'true' ; then
 		# Optimization messes up debuggers, so turn it off for
 		# debug builds.
-		OPT="-g -O0 -Wall $STRICT_PROTO"
+                if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
+                    OPT="-g -Og -Wall $STRICT_PROTO"
+                else
+                    OPT="-g -O0 -Wall $STRICT_PROTO"
+                fi
 	    else
 		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
 	    fi
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1119,7 +1119,11 @@
 	    if test "$Py_DEBUG" = 'true' ; then
 		# Optimization messes up debuggers, so turn it off for
 		# debug builds.
-		OPT="-g -O0 -Wall $STRICT_PROTO"
+                if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
+                    OPT="-g -Og -Wall $STRICT_PROTO"
+                else
+                    OPT="-g -O0 -Wall $STRICT_PROTO"
+                fi
 	    else
 		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
 	    fi

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list