From: Florian Fuchs <fuchsfl@gmail.com>
To: gdb-patches@sourceware.org, Andreas Arnez <arnez@linux.ibm.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>, Florian Fuchs <fuchsfl@gmail.com>
Subject: [PATCH] gdb/s390-linux-nat.c: use gdb_fpregset_t to fix build with musl
Date: Tue, 10 Nov 2026 19:03:32 +0100 [thread overview]
Message-ID: <20261110180332.2998111-1-fuchsfl@gmail.com> (raw)
gdb/gregset.h declares supply_fpregset and fill_fpregset with
gdb_fpregset_t, which nm-linux.h defines as elf_fpregset_t. The s390
native target defines them with fpregset_t instead. On glibc the two
are the same type, so this goes unnoticed. On musl they are distinct
types, so the definitions in s390-linux-nat.c become separate
overloads, and the calls in proc-service.c find no definition:
ld: proc-service.o: in function `ps_lgetfpregs':
proc-service.c:(.text+0x3f0): undefined reference to
`fill_fpregset(regcache const*, elf_fpregset_t*, int)'
ld: proc-service.o: in function `ps_lsetfpregs':
proc-service.c:(.text+0x426): undefined reference to
`supply_fpregset(regcache*, elf_fpregset_t const*)'
Use gdb_fpregset_t in the definitions and the local buffers, like other
Linux native targets do, so they match the declarations in gregset.h.
Tested by cross-building and running GDB for s390x with musl and glibc.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34986
Signed-off-by: Florian Fuchs <fuchsfl@gmail.com>
---
gdb/s390-linux-nat.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index cffaadf3c28..f3e93a81c3b 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -239,20 +239,21 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
/* Fill GDB's register array with the floating-point register values
in *REGP. */
void
-supply_fpregset (struct regcache *regcache, const fpregset_t *regp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *regp)
{
regcache_supply_regset (&s390_fpregset, regcache, -1, regp,
- sizeof (fpregset_t));
+ sizeof (gdb_fpregset_t));
}
/* Fill register REGNO (if it is a general-purpose register) in
*REGP with the value in GDB's register array. If REGNO is -1,
do this for all registers. */
void
-fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno)
+fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *regp,
+ int regno)
{
regcache_collect_regset (&s390_fpregset, regcache, regno, regp,
- sizeof (fpregset_t));
+ sizeof (gdb_fpregset_t));
}
/* Find the TID for the current inferior thread to use with ptrace. */
@@ -309,7 +310,7 @@ store_regs (const struct regcache *regcache, int tid, int regnum)
static void
fetch_fpregs (struct regcache *regcache, int tid)
{
- fpregset_t fpregs;
+ gdb_fpregset_t fpregs;
ptrace_area parea;
parea.len = sizeof (fpregs);
@@ -318,7 +319,7 @@ fetch_fpregs (struct regcache *regcache, int tid)
if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
perror_with_name (_("Couldn't get floating point status"));
- supply_fpregset (regcache, (const fpregset_t *) &fpregs);
+ supply_fpregset (regcache, &fpregs);
}
/* Store all valid floating-point registers in GDB's register cache
@@ -326,7 +327,7 @@ fetch_fpregs (struct regcache *regcache, int tid)
static void
store_fpregs (const struct regcache *regcache, int tid, int regnum)
{
- fpregset_t fpregs;
+ gdb_fpregset_t fpregs;
ptrace_area parea;
parea.len = sizeof (fpregs);
--
2.43.0
next reply other threads:[~2026-11-10 18:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 18:03 Florian Fuchs [this message]
2026-11-11 14:52 ` Ulrich Weigand
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=20261110180332.2998111-1-fuchsfl@gmail.com \
--to=fuchsfl@gmail.com \
--cc=arnez@linux.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/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