From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 105723858D37 for ; Thu, 30 Nov 2023 11:21:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 105723858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 105723858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701343293; cv=none; b=om5ACtEqQc7+GFA0CF95q8d5rVCMjkv65MZaD73Ve9WOA62pGkcJ2WLg03KFEnEsHZRIg+Tagg51i5U3id85eKktPDBpKTELmsf7pMaP2wzi0oVcWbtKXSUdp424pj7DxHpb2hrI7xJq+Y2CBu5Mi5IjgGVJD5JNZwOkA9f7w0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701343293; c=relaxed/simple; bh=KwjjbhmsCBDWp1GlkflrWKlfNcMXwup5idMRMiMdHmk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=GLlAoTzljsgeXYudmGLskrgxca1ibhhv1+duLFMFLSa8dUpcCy0h/f1JI/c3GGMRt3yOiiaNJ8xOm2BBDkydWEFfBvTi3vjn0uGzztgDJEK6XIhi3QyqPsAJRz6/Tu3C0PnrpkmNZ1p3St4Cs+JtENVxmGHq/Meq0blobHhRWms= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 059951FCEC for ; Thu, 30 Nov 2023 11:21:31 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E55A613AB1 for ; Thu, 30 Nov 2023 11:21:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id UcS1NjpwaGULHgAAD6G6ig (envelope-from ) for ; Thu, 30 Nov 2023 11:21:30 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/build] Fix adding -DNDEBUG to python flags of release build Date: Thu, 30 Nov 2023 12:21:28 +0100 Message-Id: <20231130112128.9197-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: ++++++++++++++ Authentication-Results: smtp-out2.suse.de; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=suse.de (policy=none); spf=softfail (smtp-out2.suse.de: 2a07:de40:b281:104:10:150:64:97 is neither permitted nor denied by domain of tdevries@suse.de) smtp.mailfrom=tdevries@suse.de X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [14.79 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; R_SPF_SOFTFAIL(4.60)[~all:c]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_SPAM_LONG(3.50)[1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[37.87%]; DMARC_POLICY_SOFTFAIL(0.10)[suse.de : No valid SPF, No valid DKIM,none] X-Spam-Score: 14.79 X-Rspamd-Queue-Id: 059951FCEC X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 ... [ Stripped gdb/configure part of patch to work around: Your message to Gdb-patches awaits moderator approval, the reason it is being held: Message body is too big. ] PR build/31099 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31099 --- gdb/configure | 17709 +++++++++++++++++++++++---------------------- gdb/configure.ac | 3 +- 2 files changed, 8857 insertions(+), 8855 deletions(-) diff --git a/gdb/configure.ac b/gdb/configure.ac index 43e5067e6ff..cbde37014de 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -57,6 +57,8 @@ LT_OUTPUT # necessary, set CXX_DIALECT to some -std=xxx switch. AX_CXX_COMPILE_STDCXX(17, , mandatory) +GDB_AC_COMMON + # Dependency checking. ZW_CREATE_DEPDIR ZW_PROG_COMPILER_DEPENDENCIES([CC]) @@ -1353,7 +1355,6 @@ AC_CHECK_FUNCS([getuid getgid \ setrlimit getrlimit posix_madvise waitpid \ use_default_colors]) AM_LANGINFO_CODESET -GDB_AC_COMMON # Check the return and argument types of ptrace. GDB_AC_PTRACE base-commit: 56006f79386f261f637809296585153b09f84ee1 -- 2.35.3