public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-30757-4717-YYRnpdutUF@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30757-4717@http.sourceware.org/bugzilla/>

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <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=883d90a0ff6b1dbacf654f5a8db2350030b4df00

commit 883d90a0ff6b1dbacf654f5a8db2350030b4df00
Author: Tom de Vries <tdevries@suse.de>
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 the \
      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 <target-name>_cgen_operand_type
     #define cgen_hw_type  <target-name>_cgen_hw_type
     #include "opcodes/<target-name>-desc.h"
    ...
    and move those defines into a new file cgen-remap.h, similar to how that's
    done for yacc in yy-remap.h.

    Likewise for targets frv and lm32, the two other targets that include
    opcodes/<target-name>-desc.h.

    Likewise for more cgen symbols that I got the same warning for when using
    -flto-partition=one.

    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 <tom@tromey.com>

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

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

  parent reply	other threads:[~2023-08-22 17:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 15:44 [Bug build/30757] New: " vries at gcc dot gnu.org
2023-08-14 15:48 ` [Bug build/30757] " vries at gcc dot gnu.org
2023-08-14 15:50 ` vries at gcc dot gnu.org
2023-08-14 15:59 ` vries at gcc dot gnu.org
2023-08-15  3:27 ` sam at gentoo dot org
2023-08-18  8:45 ` vries at gcc dot gnu.org
2023-08-22 17:35 ` cvs-commit at gcc dot gnu.org [this message]
2023-08-22 17:36 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30757-4717-YYRnpdutUF@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).