From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 689133856948; Tue, 22 Aug 2023 17:35:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 689133856948 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692725748; bh=nsRBTQIaTZJPPkkLqYHDcjU6+UJJ2yBWpsYokvR5qg4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AfBQ+zVwX2D4nzeF20a4Pijbi6tpXStY+4iO6WatZqdCyEMtEnsMd4JbOOT+J0fmX 8egJ1nhwPUQ1dZ/Pha40jRkoj5k4byIG/AQaaeMmYWwzu62xISw92L+ZRcuDy+vluD PV3JH65X7dKHdzRCQswURm99+atqZfXpVj0tGlJk= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug build/30757] [gdb/build] ODR violations in opcodes dir Date: Tue, 22 Aug 2023 17:35:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30757 --- Comment #4 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D883d90a0ff6b= 1dbacf654f5a8db2350030b4df00 commit 883d90a0ff6b1dbacf654f5a8db2350030b4df00 Author: Tom de Vries Date: Tue Aug 22 19:35:52 2023 +0200 [gdb/build] Work around cgen odr violations When building gdb with -flto -O2, I run into: ... opcodes/mep-desc.h:250:14: warning: type 'cgen_operand_type' violates t= he \ C++ One Definition Rule [-Wodr] typedef enum cgen_operand_type { ^ opcodes/or1k-desc.h:624:14: note: an enum with different value name is \ defined in another translation unit typedef enum cgen_operand_type { ^ opcodes/mep-desc.h:212:14: warning: type 'cgen_hw_type' violates the C++ One \ Definition Rule [-Wodr] typedef enum cgen_hw_type { ^ opcodes/or1k-desc.h:433:14: note: an enum with different value name is \ defined in another translation unit typedef enum cgen_hw_type { ^ ... Fix this by making the conflicting type names unique, adding a target-specific prefix using a define before the include: ... #define cgen_operand_type _cgen_operand_type #define cgen_hw_type _cgen_hw_type #include "opcodes/-desc.h" ... and move those defines into a new file cgen-remap.h, similar to how tha= t's done for yacc in yy-remap.h. Likewise for targets frv and lm32, the two other targets that include opcodes/-desc.h. Likewise for more cgen symbols that I got the same warning for when usi= ng -flto-partition=3Done. A PR has been filed to take care of this in the opcodes dir instead (PR30758). Tested on x86_64-linux. Approved-By: Tom Tromey PR build/30757 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30757 --=20 You are receiving this mail because: You are on the CC list for the bug.=