From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id DqTFNoTj9Gqu4gIAWB0awg (envelope-from ) for ; Wed, 11 Nov 2026 16:52:04 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MzMp2Kw+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CBA951E043; Wed, 11 Nov 2026 16:52:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E7FBE1E043 for ; Wed, 11 Nov 2026 16:52:03 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3B544BA9029 for ; Wed, 11 Nov 2026 21:51:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3B544BA9029 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MzMp2Kw+ Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 10F3E4BA79B5 for ; Wed, 11 Nov 2026 21:51:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10F3E4BA79B5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 10F3E4BA79B5 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794433892; cv=none; b=j5zJftuIXrH+/zwD7aYWH75ceL68EtKFfCgXofyS+DvJm0rHsDWEWB0XiHDoE0bhP9m8UIh3v3sEGc/lXhCQ6UNCJ7oPSSMmvHZPnq/f0WNkvfxmFvJPHgoybwntwx6Xwhxud+E0lIR3m5XZKkipxFKw1f/9sU+KFJbQa0Z9o1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794433892; c=relaxed/simple; bh=lXGty95pvl56t4xYTCw77MI0krL8kPV1j7FQ7/72LHw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Vw2zZ/8nYWNscZAJSPZ+1of5949C1GApEEwSv3FMUHycGD/4gKCiGCH/5estn+O7AQU9QvczXFq/kOY3DN5UH5bjK9by/AqRlYANICTma9UswU0PHF/5qIjs6fW9qyC2Fv61LmuCdAEpwFEkArpxkre0jRXN8415qYGk6L999oI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MzMp2Kw+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10F3E4BA79B5 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4afe2d546f9so44985185e9.3 for ; Wed, 11 Nov 2026 13:51:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794433891; x=1795038691; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ojQ0LhV1TPukg/oiPssaLBuflqAdzckXNikh56MOk6Y=; b=MzMp2Kw+u1asipsEwlIz56BfDlmCbJqwonYcAt2KX8J8IZmkDwKagSsIAdQIh6/ge6 VjfhNcA44tZK+srBDU6A1rqGCjtxYXVVpIi+VXef1ETgRvTSnVsdXIhjIYOxZg4amdQ3 RNIt9Dti+Z6rGfc3geBjKxk9cgzQk2AhFduAwcvGDG6BkIU42gXPwWgi0nnyWmVvIdWf n1vjEYNH4mhPMR/CRPG01FDTFJq5bG+7DxBki/xdQOiGZ99HcvQ2Xyg2/gBxdoWIzukG NDIqQ9+SadXOuAeKZSXbX9N0OoVfC3dph+tIj8FVO5CFiFr5737yrDhAaNVIaPWIFNAe gvng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794433891; x=1795038691; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ojQ0LhV1TPukg/oiPssaLBuflqAdzckXNikh56MOk6Y=; b=oR6mWxtgubQKbBpfaNDXPlU1oUqW4k/AumhiejPneExrMN2oiPzBPgemgFU58gLpon ep5IicDQ+WoK7gOTtVaCLSnS5FLYGiIx+Kdat+WFBB9S5qjq2ve8Gerh2ew7s2j72ELX vH1N6v1LGnhHFQqAQnwDR73f7idoZMMsga5RYJreunUvCkBOjri9fOktFIgeUwaIFnpC t6PWI/qPjw7l7LJbWEPFqMujr7/Bf4fXVVQyCyWUeHnUMon3lMHiAuO8bwUx0+ihb8Qc ghp2/nzlt/DQvRNvexdGOuzaNlQ1ZCMPkETb9Ba/p4a9WCHRd9gfvf4VPYkwTJ1sFXBG W/9Q== X-Gm-Message-State: APuU4Z9vC8q/88nysQmYzbDG0RERxQHajR5/sEhd1D8tKGsIzeVXZ6ic AtarTGL0mEK/KuJzGYy5LVXc/1WHfCjLCjgpUKlR68F0XGb2iXS5rvbAkVNYFWQ= X-Gm-Gg: AYBFou1OZdExAooT21BNsUSB9UMjT2gTQUM3pK6ITEMrYCG/aeCCDfMcVn7PluId59L iVHSn/HV8hR1MlQgv9N9nhQAcCBjAc29hElYUYv618Lx8/IrTepz/LYGVoPC/5XpmgW33cjfKW+ WAlNsSHu8NutweWZG2vR9mDkqvnkkYUzb+s+0c1dpVTAY27stBfOWyuEG8GwJ75IZ4we95NQ7ai AKyC+Tf6ye1+pqZJ+1IRcLaCS6dqTxw0oj2JomCCIcFPWPLIP3Rc5GtYdsFeCOy4ocNDARX+++g gp2wZdbGZodd3SI+sPn4rjVkoPRsyH/0lksBvE088X7NNBU9ayQX2L51IEd9diLTTtVfOTarQwY lzeydZQuezrNnNp8NfQCe25rLdmzxFCTqNt6dGZVXD4DGQpRNjFNLeHwPbqpy3mgUafy7daevON gQwIhQdgK7N3HvlUg/d96FggXgOdilOzLjOwVF0qrxdyqT8zccBK1tjzNnh06uA3GwXoPIt3xXN kOVlQ+qQJxS0S1YIwaC6M7ic4Dk6xfXy7SX2W4uNKjvD1Q90j7PxVYPYEjxUe82TsM0G/gh7H8p wu/Tnau1iwTvzXq1S87yXROqw+Nx3A2dEcFDmOkqLfLHifN4nJgZ4XisMkHK1Pg819IKhOizQyj jK3JQTnQHeG6FN751foksI1XzaQ+KNHM= X-Received: by 2002:a05:600c:870f:b0:4a1:7c56:d4e2 with SMTP id 5b1f17b1804b1-4ba093817d0mr62037305e9.16.1794433890678; Wed, 11 Nov 2026 13:51:30 -0800 (PST) Received: from localhost ([2a02:810d:4a94:b300:b304:926b:90e9:1439]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-498365ccbccsm13480757f8f.44.2026.11.11.13.51.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Nov 2026 13:51:30 -0800 (PST) From: Florian Fuchs To: gdb-patches@sourceware.org, Andreas Arnez Cc: Ulrich Weigand , Florian Fuchs Subject: [PATCH v2] gdb/s390-linux-nat: use gdb_{g, fp}regset_t to fix build with musl Date: Wed, 11 Nov 2026 22:48:23 +0100 Message-ID: <20261111214823.3098813-1-fuchsfl@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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. For consistency, do the same for supply_gregset and fill_gregset with gdb_gregset_t. gregset_t and elf_gregset_t are currently the same type on both glibc and musl, so this part is not needed to fix the build. Tested by cross-building and running GDB for s390x with musl and glibc. Signed-off-by: Florian Fuchs --- v1->v2: Also use gdb_gregset_t in supply_gregset and fill_gregset, as Ulrich suggested, and update commit msg accordingly. v1: https://sourceware.org/pipermail/gdb-patches/2026-November/231790.html gdb/s390-linux-nat.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c index cffaadf3c28..26cd6f32510 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c @@ -155,7 +155,7 @@ static s390_linux_nat_target the_s390_linux_nat_target; make them look like 32-bit registers. */ void -supply_gregset (struct regcache *regcache, const gregset_t *regp) +supply_gregset (struct regcache *regcache, const gdb_gregset_t *regp) { #ifdef __s390x__ struct gdbarch *gdbarch = regcache->arch (); @@ -166,7 +166,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) gdb_byte buf[4]; regcache_supply_regset (&s390_64_gregset, regcache, -1, - regp, sizeof (gregset_t)); + regp, sizeof (gdb_gregset_t)); pswm = extract_unsigned_integer ((const gdb_byte *) regp + S390_PSWM_OFFSET, 8, byte_order); pswa = extract_unsigned_integer ((const gdb_byte *) regp @@ -181,7 +181,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) #endif regcache_supply_regset (&s390_gregset, regcache, -1, regp, - sizeof (gregset_t)); + sizeof (gdb_gregset_t)); } /* Fill register REGNO (if it is a general-purpose register) in @@ -189,14 +189,14 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) do this for all registers. */ void -fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno) +fill_gregset (const struct regcache *regcache, gdb_gregset_t *regp, int regno) { #ifdef __s390x__ struct gdbarch *gdbarch = regcache->arch (); if (gdbarch_ptr_bit (gdbarch) == 32) { regcache_collect_regset (&s390_64_gregset, regcache, regno, - regp, sizeof (gregset_t)); + regp, sizeof (gdb_gregset_t)); if (regno == -1 || regno == S390_PSWM_REGNUM || regno == S390_PSWA_REGNUM) @@ -233,26 +233,27 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno) #endif regcache_collect_regset (&s390_gregset, regcache, regno, regp, - sizeof (gregset_t)); + sizeof (gdb_gregset_t)); } /* 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. */ @@ -272,7 +273,7 @@ s390_inferior_tid (void) static void fetch_regs (struct regcache *regcache, int tid) { - gregset_t regs; + gdb_gregset_t regs; ptrace_area parea; parea.len = sizeof (regs); @@ -281,7 +282,7 @@ fetch_regs (struct regcache *regcache, int tid) if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't get registers")); - supply_gregset (regcache, (const gregset_t *) ®s); + supply_gregset (regcache, ®s); } /* Store all valid general-purpose registers in GDB's register cache @@ -289,7 +290,7 @@ fetch_regs (struct regcache *regcache, int tid) static void store_regs (const struct regcache *regcache, int tid, int regnum) { - gregset_t regs; + gdb_gregset_t regs; ptrace_area parea; parea.len = sizeof (regs); @@ -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