X Tutup
The Wayback Machine - https://web.archive.org/web/20220202175245/https://github.com/python/cpython/pull/31052/files
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-46600: ./configure --with-pydebug uses -Og with clang #31052

Merged
merged 2 commits into from Feb 1, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,3 @@
Fix the test checking if the C compiler supports ``-Og`` option in the
``./configure`` script to also use ``-Og`` on clang which supports it. Patch
by Victor Stinner.

Some generated files are not rendered by default. Learn more.

@@ -1791,6 +1791,28 @@ case $CC in
fi
esac

# Check if CC supports -Og optimization level
_SAVE_VAR([CFLAGS])
CFLAGS="-Og"
AC_CACHE_CHECK([if $CC supports -Og optimization level],
[ac_cv_cc_supports_og],
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM([[]], [[]])
],[
ac_cv_cc_supports_og=yes
],[
ac_cv_cc_supports_og=no
])
)
_RESTORE_VAR([CFLAGS])

# Optimization messes up debuggers, so turn it off for
# debug builds.
PYDEBUG_CFLAGS="-O0"
AS_VAR_IF([ac_cv_cc_supports_og], [yes],
[PYDEBUG_CFLAGS="-Og"])

# tweak OPT based on compiler and platform, only if the user didn't set
# it on the command line
AC_SUBST(OPT)
@@ -1816,13 +1838,7 @@ then
case $ac_cv_prog_cc_g in
yes)
if test "$Py_DEBUG" = 'true' ; then
# Optimization messes up debuggers, so turn it off for
# debug builds.
if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
OPT="-g -Og -Wall"
else
OPT="-g -O0 -Wall"
fi
OPT="-g $PYDEBUG_CFLAGS -Wall"
else
OPT="-g $WRAP -O3 -Wall"
fi
X Tutup