public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom de Vries <tdevries@suse.de>
Subject: Re: [PATCH] [gdb/build] Work around cgen odr violations
Date: Fri, 18 Aug 2023 09:46:33 -0600	[thread overview]
Message-ID: <877cpsxsiu.fsf@tromey.com> (raw)
In-Reply-To: <20230818083857.15960-1-tdevries@suse.de> (Tom de Vries via Gdb-patches's message of "Fri, 18 Aug 2023 10:38:57 +0200")

>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> When building gdb with -flto -O2, I run into:
Tom> ...
Tom> opcodes/mep-desc.h:250:14: warning: type 'cgen_operand_type' violates the \
Tom>   C++ One Definition Rule [-Wodr]
Tom>  typedef enum cgen_operand_type {

I thought... hey, the best way is probably to change cgen to emit
different names for these things.  So I tried looking at cgen.  Then I
found out I don't know how it can even be run at all.  Maybe it requires
the obsolete-and-no-longer-shipped Guile 1.8 -- it definitely barfs with
newer versions.

Tom> Fix this by making the conflicting type names unique, adding a target-specific
Tom> prefix using a define before the include:
Tom> ...
Tom>  #define cgen_operand_type <target-name>_cgen_operand_type
Tom>  #define cgen_hw_type  <target-name>_cgen_hw_type
Tom>  #include "opcodes/<target-name>-desc.h"
Tom> ...

Thanks.

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

Tom> A PR has been filed to take care of this in the opcodes dir instead (PR30758).

That was WONTFIX'd unfortunately.

Tom

  reply	other threads:[~2023-08-18 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  8:38 Tom de Vries
2023-08-18 15:46 ` Tom Tromey [this message]
2023-08-21  6:05   ` Tom de Vries
2023-08-22 15:54     ` Tom Tromey

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=877cpsxsiu.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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).