diff options
author | Tom de Vries <tdevries@suse.de> | 2023-08-22 19:35:52 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-08-22 19:35:52 +0200 |
commit | 883d90a0ff6b1dbacf654f5a8db2350030b4df00 (patch) | |
tree | 36fb5f6951bf34e256216fa815943ea31ec50b0a /gdb/ui-out.c | |
parent | 72275f1e6a2566569ac23fb8a2b2f6dbcf535408 (diff) | |
download | binutils-883d90a0ff6b1dbacf654f5a8db2350030b4df00.zip binutils-883d90a0ff6b1dbacf654f5a8db2350030b4df00.tar.gz binutils-883d90a0ff6b1dbacf654f5a8db2350030b4df00.tar.bz2 |
[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
Diffstat (limited to 'gdb/ui-out.c')
0 files changed, 0 insertions, 0 deletions