[Bug gdb/28444] gdb fails to build on ppc64le when building with -flto

"cvs-commit at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=28444

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Keith Seitz <[email protected]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d839c0e5ab5a1c08d0a110b31f54d17946d4fc8b

commit d839c0e5ab5a1c08d0a110b31f54d17946d4fc8b
Author: Keith Seitz <[email protected]>
Date:   Tue Jul 7 12:10:08 2026 -0700

    regdat.sh: generate const_target_desc_up for register descriptions

    Late last year, a patch propagated the use of target_desc unique
    pointers (commit 1a5362ce51ef79ffb61caa20c93284dc368dc74a).  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 <[email protected]>
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28444

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.