From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39580 invoked by alias); 17 Sep 2018 18:19:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 39562 invoked by uid 89); 17 Sep 2018 18:19:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2730, hurt X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Sep 2018 18:19:08 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1691511615C; Mon, 17 Sep 2018 14:19:07 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jdUbdfikueAx; Mon, 17 Sep 2018 14:19:07 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D7214116155; Mon, 17 Sep 2018 14:19:06 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 244ED873D9; Mon, 17 Sep 2018 11:19:05 -0700 (PDT) Date: Mon, 17 Sep 2018 18:19:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] Do not pass -DNDEBUG to Python compilations in development mode Message-ID: <20180917181905.GD19172@adacore.com> References: <20180916184502.19617-1-tom@tromey.com> <20180916184502.19617-3-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180916184502.19617-3-tom@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-09/txt/msg00594.txt.bz2 Hi Tom, On Sun, Sep 16, 2018 at 12:45:02PM -0600, Tom Tromey wrote: > 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. > > ChangeLog > 2018-09-16 Tom Tromey > > PR python/20445: > * configure: Rebuild. > * configure.ac: Conditionally use -DNDEBUG for Python. > --- > gdb/ChangeLog | 6 ++++++ > gdb/configure | 6 +++++- > gdb/configure.ac | 6 +++++- > 3 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/gdb/configure b/gdb/configure > index e011b77414b..2fb69a8eda6 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" Are we missing a '$' before tentative_python_cflags in the string, by any chance? > fi > > if test "x${tentative_python_cflags}" != x; then > diff --git a/gdb/configure.ac b/gdb/configure.ac > index f658da84e32..0709b1ff720 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -965,7 +965,11 @@ if test "${have_libpython}" != no; then > # 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 > -- > 2.17.1 -- Joel