From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qbmcKZJQxmqZMA8AWB0awg (envelope-from ) for ; Wed, 07 Oct 2026 10:00:50 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=R8Us+uDU; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9C8651E051; Wed, 07 Oct 2026 10:00:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F27ED1E04E for ; Wed, 07 Oct 2026 10:00:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 30E1E4BA2E37 for ; Wed, 7 Oct 2026 14:00:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30E1E4BA2E37 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=R8Us+uDU Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6AC984BA2E0F for ; Wed, 7 Oct 2026 14:00:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AC984BA2E0F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6AC984BA2E0F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791381624; cv=none; b=CttZXFxpxNtscOmmWnprjGBRun+XGJkpHRC10LOikkehYPQhqDG4iVV0bqTS9sTnBVGttHPzX+PZEaNJQK19T/qydvePFheAvbQKO4tpO/aM+eL184cJUaCOnwlxt103hWuuGsgVdBr0u1PHGLjy2mWPHB4hAXx35pGMZGMYbJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791381624; c=relaxed/simple; bh=pkEK8BqBw5OMpwMuVEgSVEFiGP6tNynC/MNDM2yBu6I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IL1rnsYTuisU6+kTPF3WtFyjSB2auie7c06fAaVE2hSqA4f5VOt+JIcwxYOx82rOWJBrSGpyxiC6KsDknDL2Udrw4BuVffsDiZF95VvuaJTpql6xPf30o4LUzMvrjFsossCuWYNMRMR29ygDXCY+W+Hqb94eknU02keVkd+r+tU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=R8Us+uDU DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AC984BA2E0F Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 697E0HtB087966 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Oct 2026 10:00:22 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 697E0HtB087966 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1791381622; bh=TVld4+en68u12GnAy8ZZA0smAjtKu955x6MYP6aBgjc=; h=From:To:Cc:Subject:Date:From; b=R8Us+uDUoVAZ5nIBmHWXhBk964wU52wSGGqJSoSnX8zuJXehqHGWGJU9PfyInbHNP rAHiwcL1LDcZblJBym4SRqKaLF5qUMtZit8GAWiUK6lUU0kQbYtQUwLCOVuVN9DvSp wpuq3uh63Nx0xmDb9hts0j7pO5P8j2zF+uffffAqJMUr5haUZQ3kMtXI7FmO2j3nUE HQqpwHvhbqzKe/0P92XRa1uKs/XG5Vjyeq2TF+kdOWCj/hoeT6hJ43OkL9NX/gvbWB /7mnaED8jbkjbopcKCTMPvkUmEXdjDonbOciFl6C1JdKhNDvjGWo/+PzhXK7KxK8SL 3067EcZwOm2xA== Received: by simark.ca (Postfix) id 2BEAF1E04E; Wed, 07 Oct 2026 10:00:16 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: rename YYSTACKDATA in generated parsers Date: Wed, 7 Oct 2026 09:55:47 -0400 Message-ID: <20261007140014.2488030-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 7 Oct 2026 14:00:17 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Simon Marchi When building with byacc and -flto -Werror=odr, we get: ada-exp-parser-gen.c.tmp:1552:3: error: type 'struct YYSTACKDATA' violates the C++ One Definition Rule [-Werror=odr] c-exp-parser-gen.c.tmp:3732:3: note: a different type is defined in another translation unit ada-exp-parser-gen.c.tmp:1546:30: note: the first difference of corresponding definitions is field 'l_base' c-exp-parser-gen.c.tmp:3726:28: note: a field of same name but different type is defined in another translation unit ada-exp-parser-gen.c.tmp:1552:3: note: type name 'ada_exp_parser_YYSTYPE' should match type name 'c_exp_parser_YYSTYPE' The byacc generated parsers define this type: typedef struct { unsigned stacksize; YYINT *s_base; YYINT *s_mark; YYINT *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; ... } YYSTACKDATA; Since YYSTYPE represents a different type in each parser (it is renamed to {prefix}_YYSTYPE by post-process-parser-output.sh), then YYSTACKDATA is also a different type in each parser, which leads to ODR violations. This is a regression from my patch that removed yy-remap.h (d3d68d798e0c "gdb: let the parser and lexer generators prefix their symbols"). yy-remap.h remapped YYSTACKDATA, since commit df940f8bb348 ("gdb: Fix an ODR warning with byacc with GDB_YY_REMAP") which fixed this exact problem. Fix it by adding YYSTACKDATA to the renames done in post-process-parser-output.sh, alongside YYSTYPE and friends. This is a master-only bug, no need to cherry-pick to gdb-18-branch. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34712 Change-Id: I6332bd0edc6619434f67cccef463cd21e96e3251 --- gdb/post-process-parser-output.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/post-process-parser-output.sh b/gdb/post-process-parser-output.sh index a0cf6b464c4b..ca5f0ba302fb 100755 --- a/gdb/post-process-parser-output.sh +++ b/gdb/post-process-parser-output.sh @@ -53,7 +53,8 @@ case "$generator" in -e '/^#line.*y.tab.c/d' \ -e "s/YYSTYPE/${name}_YYSTYPE/g" \ -e "s/yyalloc/${name}_yyalloc/g" \ - -e "s/yysymbol_kind_t/${name}_yysymbol_kind_t/g" + -e "s/yysymbol_kind_t/${name}_yysymbol_kind_t/g" \ + -e "s/YYSTACKDATA/${name}_YYSTACKDATA/g" ;; flex) sed -e "$common" \ base-commit: ca0665335ff67af94f9ded026d7ef2405a68c453 -- 2.55.0