binutils-gdb/gdb/regformats
Keith Seitz d839c0e5ab regdat.sh: generate const_target_desc_up for register descriptions
Late last year, a patch propagated the use of target_desc unique
pointers (commit 1a5362ce51).  At the
time, the "old regformats/regdat.sh [weren't] changed because their
target_desc objects are statically allocated in the generated files."

Unfortunately that re-introduced ODR violations on ppc64le:

CXXLD  gdbserver
../../src/gdbserver/../gdb/arch/ppc-linux-tdesc.h:46:29: error: ‘tdesc_powerpc_isa207_htm_vsx64l’ violates the C++ One Definition Rule [-Werror=odr]
   46 | extern const_target_desc_up tdesc_powerpc_isa207_htm_vsx64l;
      |                             ^
powerpc-isa207-htm-vsx64l-generated.cc:26:27: note: ‘tdesc_powerpc_isa207_htm_vsx64l’ was previously declared here
   26 | const struct target_desc *tdesc_powerpc_isa207_htm_vsx64l;
      |                           ^
powerpc-isa207-htm-vsx64l-generated.cc:26:27: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

Update regdat.sh so that generated init_registers_* code matches the
const-unique_ptr-based target description API, resolving the ODR violation.

A follow-up patch updates various gdbserver architectures to
accommodate this API change.

Tested on ppc64le and s390x Fedora 43 and mips-linux
cross build (all with LTO).

Approved-By: Simon Marchi <simon.marchi@efficios.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28444
2026-07-07 12:11:09 -07:00
..
rs6000
microblaze-linux.dat
mips-dsp-linux.dat
mips-linux.dat
mips64-dsp-linux.dat
mips64-linux.dat
or1k-linux.dat
reg-cf.dat
reg-ia64.dat
reg-m68k.dat
reg-sh.dat
reg-sparc64.dat
reg-xtensa.dat
regdat.sh regdat.sh: generate const_target_desc_up for register descriptions 2026-07-07 12:11:09 -07:00
regdef.h gdb, gdbserver, gdbsupport: replace many uses of strcmp with streq 2026-03-16 13:24:00 -04:00
s390-gs-linux64.dat
s390-linux32.dat
s390-linux32v1.dat
s390-linux32v2.dat
s390-linux64.dat
s390-linux64v1.dat
s390-linux64v2.dat
s390-te-linux64.dat
s390-tevx-linux64.dat
s390-vx-linux64.dat
s390x-gs-linux64.dat
s390x-linux64.dat
s390x-linux64v1.dat
s390x-linux64v2.dat
s390x-te-linux64.dat
s390x-tevx-linux64.dat
s390x-vx-linux64.dat