diff --git a/Misc/NEWS b/Misc/NEWS index db0d1589c6d..b497bd5bfe2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -26,6 +26,12 @@ Library argument which, if set to True, will pass messages to handlers taking handler levels into account. +Build +----- + +- Issue #23445: pydebug builds now use "gcc -Og" where possible, to make + the resulting executable faster. + What's New in Python 3.5 alpha 1? ================================= diff --git a/configure b/configure index ecefde4cfb9..35a31bb991d 100755 --- a/configure +++ b/configure @@ -6338,7 +6338,11 @@ then 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 index c7516225faf..a2c5eb46320 100644 --- a/configure.ac +++ b/configure.ac @@ -1128,7 +1128,11 @@ then 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