public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/31099] New: [gdb/build] -DNDEBUG missing in python flags of release build
@ 2023-11-30  8:45 vries at gcc dot gnu.org
  2023-11-30 11:22 ` [Bug build/31099] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-11-30  8:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31099

            Bug ID: 31099
           Summary: [gdb/build] -DNDEBUG missing in python flags of
                    release build
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Before commit db6878ac553 ("Move sourcing of development.sh to GDB_AC_COMMON")
we have:
...
. $srcdir/../bfd/development.sh
  ...
    $development || tentative_python_cflags="$tentative_python_cflags -DNDEBUG"
...
but after:
...
    $development || tentative_python_cflags="$tentative_python_cflags -DNDEBUG"
  ...
. $srcdir/../bfd/development.sh
...

Curiously, while this gives an error:
...
$  && echo bla
bash: syntax error near unexpected token `&&'
$  || echo bla
bash: syntax error near unexpected token `||'
...
an empty var seems to be handled similar to ':' or 'true':
...
$ $empty && echo bla
bla
$ $empty || echo bla
$ 
...

So, the -DNDEBUG is not added in a release branch.

Regression since gdb 10.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/31099] [gdb/build] -DNDEBUG missing in python flags of release build
  2023-11-30  8:45 [Bug build/31099] New: [gdb/build] -DNDEBUG missing in python flags of release build vries at gcc dot gnu.org
@ 2023-11-30 11:22 ` vries at gcc dot gnu.org
  2023-11-30 20:31 ` cvs-commit at gcc dot gnu.org
  2023-11-30 20:33 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-11-30 11:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31099

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2023-November/204631.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/31099] [gdb/build] -DNDEBUG missing in python flags of release build
  2023-11-30  8:45 [Bug build/31099] New: [gdb/build] -DNDEBUG missing in python flags of release build vries at gcc dot gnu.org
  2023-11-30 11:22 ` [Bug build/31099] " vries at gcc dot gnu.org
@ 2023-11-30 20:31 ` cvs-commit at gcc dot gnu.org
  2023-11-30 20:33 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-30 20:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31099

--- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d5835df2eebf8e9cd3ae35b683c831c2a16a5269

commit d5835df2eebf8e9cd3ae35b683c831c2a16a5269
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Nov 30 21:31:46 2023 +0100

    [gdb/build] Fix adding -DNDEBUG to python flags of release build

    In gdb/configure the line:
    ...
        $development || tentative_python_cflags="$tentative_python_cflags
-DNDEBUG"
    ...
    intends to ensure that -DNDEBUG is added to the python flags of a release
    build.

    However, when building gdb-14-branch we have:
    ...
    configure:22024: checking compiler flags for python code
      ...
    configure:22047: result:  -fno-strict-aliasing -fwrapv
    ...

    This is a regression since commit db6878ac553 ("Move sourcing of
development.sh
    to GDB_AC_COMMON"), which introduced a reference before assignment:
    ...
        $development || tentative_python_cflags="$tentative_python_cflags
-DNDEBUG"
      ...
    . $srcdir/../bfd/development.sh
    ...
    and consequently -DNDEBUG is never added.

    [ This was not obvious to me, but apparently evaluating an empty or
undefined
    variable in this context is similar to using ':' or 'true', so the line is
    evaluated as:
    ...
        true || tentative_python_cflags="$tentative_python_cflags -DNDEBUG"
    ... ]

    Fix this by moving GDB_AC_COMMON up in gdb/configure.ac, similar to how
that
    was done for gdbserver/configure.ac in commit db6878ac553.

    [ Unfortunately, the move might introduce issues similar to the one we're
    fixing, and I'm not sure how to check for this.  Shellcheck doesn't detect
    this type of problem.  FWIW, I did run shellcheck (using arguments -xa, in
the
    src/gdb directory to make sure ../bfd/development.sh is taken into account)
    before and after and observed that the number of lines/words/chars in the
    shellcheck output is identical. ]

    Build & tested on top of trunk.

    Also build on top of gdb-14-branch, and observed this in gdb/config.log:
    ...
    configure:25214: checking compiler flags for python code
      ...
    configure:25237: result:  -fno-strict-aliasing -fwrapv -DNDEBUG
    ...

    Approved-By: Tom Tromey <tom@tromey.com>

    PR build/31099
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31099

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/31099] [gdb/build] -DNDEBUG missing in python flags of release build
  2023-11-30  8:45 [Bug build/31099] New: [gdb/build] -DNDEBUG missing in python flags of release build vries at gcc dot gnu.org
  2023-11-30 11:22 ` [Bug build/31099] " vries at gcc dot gnu.org
  2023-11-30 20:31 ` cvs-commit at gcc dot gnu.org
@ 2023-11-30 20:33 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-11-30 20:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31099

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |15.1
             Status|NEW                         |RESOLVED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-30 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30  8:45 [Bug build/31099] New: [gdb/build] -DNDEBUG missing in python flags of release build vries at gcc dot gnu.org
2023-11-30 11:22 ` [Bug build/31099] " vries at gcc dot gnu.org
2023-11-30 20:31 ` cvs-commit at gcc dot gnu.org
2023-11-30 20:33 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).