Skip to content

Commit 4a196c4

Browse files
committed
gh-128042: configure complains when CFLAGS=-O0 and --enable-optimizations are set
1 parent d22a745 commit 4a196c4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

configure

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,12 @@ fi],
18231823
[AC_MSG_RESULT([no])])
18241824

18251825
if test "$Py_OPT" = 'true' ; then
1826+
# Check for conflicting CFLAGS=-O0 and --enable-optimizations
1827+
case "$CFLAGS" in
1828+
*-O0*)
1829+
AC_MSG_ERROR([CFLAGS contains -O0 which conflicts with --enable-optimizations. Please remove -O0 from CFLAGS or do not use --enable-optimizations.])
1830+
;;
1831+
esac
18261832
# Intentionally not forcing Py_LTO='true' here. Too many toolchains do not
18271833
# compile working code using it and both test_distutils and test_gdb are
18281834
# broken when you do manage to get a toolchain that works with it. People

0 commit comments

Comments
 (0)