aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-09-16 12:38:12 -0600
committerTom Tromey <tom@tromey.com>2018-09-17 13:51:38 -0600
commitae292b3afc0fce65c12014d2cc4621d7a0e661fd (patch)
tree700c8b4115795574d20a5f5cf5caef482dba11f3 /gdb/configure
parentda658607ed24bc5a4dcfcfb56b6e1440ccab33d2 (diff)
downloadgdb-ae292b3afc0fce65c12014d2cc4621d7a0e661fd.zip
gdb-ae292b3afc0fce65c12014d2cc4621d7a0e661fd.tar.gz
gdb-ae292b3afc0fce65c12014d2cc4621d7a0e661fd.tar.bz2
Do not pass -DNDEBUG to Python compilations in development mode
The Python CFLAGS include -DNDEBUG. This was apparently done intentionally -- setting the flags is done manually because, according to a comment, python-config passes too many things to the compiler (which is true). Per PR python/20445, this patch changes configure so that -DNDEBUG is only used by release builds. This probably doesn't have very much effect in practice, but I did see that some Python headers use assert, so perhaps it will give some safety. Tested by rebuilding and re-running gdb.python/*.exp on x86-64 Fedora 28. gdb/ChangeLog 2018-09-17 Tom Tromey <tom@tromey.com> PR python/20445: * configure: Rebuild. * configure.ac: Conditionally use -DNDEBUG for Python.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/configure b/gdb/configure
index e011b77..a5d6e74 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10762,7 +10762,11 @@ $as_echo "#define HAVE_PYTHON 1" >>confdefs.h
# would make the python-related objects be compiled differently from the
# rest of GDB (e.g., -O2 and -fPIC).
if test "${GCC}" = yes; then
- tentative_python_cflags="-fno-strict-aliasing -DNDEBUG -fwrapv"
+ tentative_python_cflags="-fno-strict-aliasing -fwrapv"
+ # Python headers recommend -DNDEBUG, but it's unclear if that just
+ # refers to building Python itself. In release mode, though, it
+ # doesn't hurt for the Python code in gdb to follow.
+ $development || tentative_python_cflags="$tentative_python_cflags -DNDEBUG"
fi
if test "x${tentative_python_cflags}" != x; then