{"id":2232193,"url":"http://patchwork.ozlabs.org/api/patches/2232193/?format=json","web_url":"http://patchwork.ozlabs.org/project/buildroot/patch/20260503144908.2807535-2-bernd@kuhls.net/","project":{"id":27,"url":"http://patchwork.ozlabs.org/api/projects/27/?format=json","name":"Buildroot development","link_name":"buildroot","list_id":"buildroot.buildroot.org","list_email":"buildroot@buildroot.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260503144908.2807535-2-bernd@kuhls.net>","list_archive_url":null,"date":"2026-05-03T14:49:06","name":"[2/4] package/gdb: add support for GDB 17.1","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"eb2b90dca5747d4586f5c3592da6b83c06e16cd0","submitter":{"id":86624,"url":"http://patchwork.ozlabs.org/api/people/86624/?format=json","name":"Bernd Kuhls","email":"bernd@kuhls.net"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/buildroot/patch/20260503144908.2807535-2-bernd@kuhls.net/mbox/","series":[{"id":502579,"url":"http://patchwork.ozlabs.org/api/series/502579/?format=json","web_url":"http://patchwork.ozlabs.org/project/buildroot/list/?series=502579","date":"2026-05-03T14:49:05","name":"[1/4] package/gdb: link with libatomic if needed","version":1,"mbox":"http://patchwork.ozlabs.org/series/502579/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2232193/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232193/checks/","tags":{},"related":[],"headers":{"Return-Path":"<buildroot-bounces@buildroot.org>","X-Original-To":["incoming-buildroot@patchwork.ozlabs.org","buildroot@buildroot.org"],"Delivered-To":["patchwork-incoming-buildroot@legolas.ozlabs.org","buildroot@buildroot.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=buildroot.org header.i=@buildroot.org\n header.a=rsa-sha256 header.s=default header.b=eg7DhCgu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org\n (client-ip=140.211.166.136; helo=smtp3.osuosl.org;\n envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org)"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g7nk40FBGz1xvV\n\tfor <incoming-buildroot@patchwork.ozlabs.org>;\n Mon, 04 May 2026 00:49:48 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 23C0560C1F;\n\tSun,  3 May 2026 14:49:45 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id zpd_y5gcbH8S; Sun,  3 May 2026 14:49:43 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 108BD60D78;\n\tSun,  3 May 2026 14:49:43 +0000 (UTC)","from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists1.osuosl.org (Postfix) with ESMTP id 8D736190\n for <buildroot@buildroot.org>; Sun,  3 May 2026 14:49:41 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 7148D406FA\n for <buildroot@buildroot.org>; Sun,  3 May 2026 14:49:41 +0000 (UTC)","from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id rJcmHr19-tBX for <buildroot@buildroot.org>;\n Sun,  3 May 2026 14:49:39 +0000 (UTC)","from dd20012.kasserver.com (dd20012.kasserver.com [85.13.140.57])\n by smtp2.osuosl.org (Postfix) with ESMTPS id CDA6A4046D\n for <buildroot@buildroot.org>; Sun,  3 May 2026 14:49:38 +0000 (UTC)","from fli4l.lan.fli4l (p4fd6c2eb.dip0.t-ipconnect.de\n [79.214.194.235])\n by dd20012.kasserver.com (Postfix) with ESMTPSA id D3A17A4C0A34\n for <buildroot@buildroot.org>; Sun,  3 May 2026 16:49:09 +0200 (CEST)","from bruckner.lan.fli4l ([192.168.1.1]:40976)\n by fli4l.lan.fli4l with esmtp (Exim 4.99.2)\n (envelope-from <bernd@kuhls.net>) id 1wJY85-000000001nT-28kH\n for buildroot@buildroot.org; Sun, 03 May 2026 14:49:09 +0000"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp3.osuosl.org 108BD60D78","OpenDKIM Filter v2.11.0 smtp2.osuosl.org CDA6A4046D"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=buildroot.org;\n\ts=default; t=1777819783;\n\tbh=hpwVaP5Vi5lRuZHKlTg68Baolmwzy0EFlmM6wJc8i2w=;\n\th=From:To:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=eg7DhCgu1fuTYSvjBHsSutPd8MLYrmzChLPSFw/dU4Bpg328S/NVxVrMijsLfivIH\n\t UJxYoHSyNiCKvoFGuI0JVyMqdFwO1oPDazJGvYLQQ0LFEl9Q2lIQdYKCsRHOGXQ3Kf\n\t OOQ16rrg/Nnd4M94M2Y/Js82pgZWGz4SOQEXSC/qSkNioxdgMu9e1rqLn114PAKEh/\n\t wM+/z8wy1kAas+XW5BDfGr8TZtj2c0MVL9cb6zxRBkiqAiIpmhmoCb86nXU47iGehm\n\t y+vZ665FE1Osrm/acQERpwo/xbdBTUkES8v/FVGYUleLZHz815vk9Zcgfv06ZjAC4U\n\t ZZ0YnKY+bFyBw==","Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=85.13.140.57;\n helo=dd20012.kasserver.com; envelope-from=bernd@kuhls.net;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp2.osuosl.org CDA6A4046D","From":"Bernd Kuhls <bernd@kuhls.net>","To":"buildroot@buildroot.org","Date":"Sun,  3 May 2026 16:49:06 +0200","Message-ID":"<20260503144908.2807535-2-bernd@kuhls.net>","X-Mailer":"git-send-email 2.47.3","In-Reply-To":"<20260503144908.2807535-1-bernd@kuhls.net>","References":"<20260503144908.2807535-1-bernd@kuhls.net>","MIME-Version":"1.0","X-Spamd-Bar":"-","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=kuhls.net;\n s=kas202511301023; t=1777819749;\n bh=rxJTr4TioJn5bUk074IjLzLiIxZtRHLLTvtwzuU9QM0=;\n h=From:To:Subject:Date:In-Reply-To:From;\n b=Ishb+3mmpuHbltn+CnxNMOGOZHIzsvl06rO+yIqnJ558/JKerKQYk9KKNMZ1NaAG/\n NXNDay9ODwtO/b6lKuUQf+RKPU8/+fc9kLADENK3ugk35H0F9rWzgYHcw9Fii/eMjR\n JEXb3/jVeLElFowFu/gkEmPZPbL7zB7iGbz8weZO0KDelwoImTKOKqSYdo/w9K7DsB\n HD0EYMPLuBj5/r0vssBg1HXPJCRqST1/3veNMua/zX3ksPjg36/SoJgnHJ5d4jvdHQ\n HWi55dNAg+3Y8D3/2XxU8YtTAsMOZBC+B1sTf5dXLP2D49c7KBNI+XRgr9OSBj793S\n 8F5kXm6j4C6cw==","X-Mailman-Original-Authentication-Results":["smtp2.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=kuhls.net","smtp2.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=kuhls.net header.i=@kuhls.net header.a=rsa-sha256\n header.s=kas202511301023 header.b=Ishb+3mm"],"Subject":"[Buildroot] [PATCH 2/4] package/gdb: add support for GDB 17.1","X-BeenThere":"buildroot@buildroot.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.buildroot.org>","List-Unsubscribe":"<https://lists.buildroot.org/mailman/options/buildroot>,\n <mailto:buildroot-request@buildroot.org?subject=unsubscribe>","List-Archive":"<http://lists.buildroot.org/pipermail/buildroot/>","List-Post":"<mailto:buildroot@buildroot.org>","List-Help":"<mailto:buildroot-request@buildroot.org?subject=help>","List-Subscribe":"<https://lists.buildroot.org/mailman/listinfo/buildroot>,\n <mailto:buildroot-request@buildroot.org?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"buildroot-bounces@buildroot.org","Sender":"\"buildroot\" <buildroot-bounces@buildroot.org>"},"content":"All patches that were applicable to GDB 16.1 are also applicable to\nGDB 17.1. Rebased patch 0005. Added upstream patch 0010 to fix build\nerror with musl and upstream patch 0011 to fix build error on sparc.\n\nDetails about the 17.1 release:\n\n  https://sourceware.org/gdb/download/ANNOUNCEMENT\n\nSigned-off-by: Bernd Kuhls <bernd@kuhls.net>\n---\n .checkpackageignore                           |   9 ++\n ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch |  55 +++++++++\n ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch |  43 ++++++++\n package/gdb/17.1/0003-use-asm-sgidefs.h.patch |  40 +++++++\n .../0004-gdbserver-fix-build-for-m68k.patch   |  64 +++++++++++\n ...fork-inferior-include-linux-ptrace.h.patch |  55 +++++++++\n ...getrandom-compile-for-uclibc-v1.0.35.patch |  39 +++++++\n .../17.1/0007-fix-musl-build-on-riscv.patch   |  60 ++++++++++\n ...-gdbserver-Makefile.in-fix-NLS-build.patch |  38 +++++++\n .../0009-gdb-Fix-native-build-on-xtensa.patch |  57 ++++++++++\n ...-musl-build-failure-when-setting-cus.patch | 104 ++++++++++++++++++\n ...k-around-conflicting-types-for-tcfla.patch |  77 +++++++++++++\n package/gdb/Config.in.host                    |   7 +-\n package/gdb/gdb.hash                          |   1 +\n 14 files changed, 648 insertions(+), 1 deletion(-)\n create mode 100644 package/gdb/17.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch\n create mode 100644 package/gdb/17.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch\n create mode 100644 package/gdb/17.1/0003-use-asm-sgidefs.h.patch\n create mode 100644 package/gdb/17.1/0004-gdbserver-fix-build-for-m68k.patch\n create mode 100644 package/gdb/17.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch\n create mode 100644 package/gdb/17.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch\n create mode 100644 package/gdb/17.1/0007-fix-musl-build-on-riscv.patch\n create mode 100644 package/gdb/17.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch\n create mode 100644 package/gdb/17.1/0009-gdb-Fix-native-build-on-xtensa.patch\n create mode 100644 package/gdb/17.1/0010-gdb-ser-unix-fix-musl-build-failure-when-setting-cus.patch\n create mode 100644 package/gdb/17.1/0011-gdb-ser-unix-work-around-conflicting-types-for-tcfla.patch","diff":"diff --git a/.checkpackageignore b/.checkpackageignore\nindex b2d5320045..0799b0ad7a 100644\n--- a/.checkpackageignore\n+++ b/.checkpackageignore\n@@ -390,6 +390,15 @@ package/gdb/16.3/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch lib_patch.U\n package/gdb/16.3/0007-fix-musl-build-on-riscv.patch lib_patch.Upstream\n package/gdb/16.3/0008-gdbserver-Makefile.in-fix-NLS-build.patch lib_patch.Upstream\n package/gdb/16.3/0009-gdb-Fix-native-build-on-xtensa.patch lib_patch.Upstream\n+package/gdb/17.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch lib_patch.Upstream\n+package/gdb/17.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch lib_patch.Upstream\n+package/gdb/17.1/0003-use-asm-sgidefs.h.patch lib_patch.Upstream\n+package/gdb/17.1/0004-gdbserver-fix-build-for-m68k.patch lib_patch.Upstream\n+package/gdb/17.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch lib_patch.Upstream\n+package/gdb/17.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch lib_patch.Upstream\n+package/gdb/17.1/0007-fix-musl-build-on-riscv.patch lib_patch.Upstream\n+package/gdb/17.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch lib_patch.Upstream\n+package/gdb/17.1/0009-gdb-Fix-native-build-on-xtensa.patch lib_patch.Upstream\n package/genpart/0001-fix-return-code.patch lib_patch.Upstream\n package/gensio/0001-Fix-missing-EVP_PKEY_ED25519-build-error-on-libressl.patch lib_patch.Upstream\n package/gerbera/S99gerbera lib_sysv.Indent\ndiff --git a/package/gdb/17.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/17.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch\nnew file mode 100644\nindex 0000000000..5118e929df\n--- /dev/null\n+++ b/package/gdb/17.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch\n@@ -0,0 +1,55 @@\n+From 7fbcc55c3b2dac91dcb0a8dc6daa5514ff323185 Mon Sep 17 00:00:00 2001\n+From: Khem Raj <raj.khem@gmail.com>\n+Date: Sat, 6 Aug 2016 17:32:50 -0700\n+Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems\n+\n+Upstream-Status: Pending\n+\n+Signed-off-by: Khem Raj <raj.khem@gmail.com>\n+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>\n+[Rebase on gdb 8.3]\n+Signed-off-by: Romain Naour <romain.naour@gmail.com>\n+---\n+ gdb/nat/ppc-linux.h        | 6 ++++++\n+ gdbserver/linux-ppc-low.cc | 6 ++++++\n+ 2 files changed, 12 insertions(+)\n+\n+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h\n+index 3efc1b9a9bf..635d07486de 100644\n+--- a/gdb/nat/ppc-linux.h\n++++ b/gdb/nat/ppc-linux.h\n+@@ -18,7 +18,13 @@\n+ #ifndef GDB_NAT_PPC_LINUX_H\n+ #define GDB_NAT_PPC_LINUX_H\n+ \n++#if !defined(__GLIBC__)\n++# define pt_regs uapi_pt_regs\n++#endif\n+ #include <asm/ptrace.h>\n++#if !defined(__GLIBC__)\n++# undef pt_regs\n++#endif\n+ #include <asm/cputable.h>\n+ \n+ /* This sometimes isn't defined.  */\n+diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc\n+index 3ce978f4c7c..38534297cdf 100644\n+--- a/gdbserver/linux-ppc-low.cc\n++++ b/gdbserver/linux-ppc-low.cc\n+@@ -22,7 +22,13 @@\n+ #include \"elf/common.h\"\n+ #include <sys/uio.h>\n+ #include <elf.h>\n++#if !defined(__GLIBC__)\n++# define pt_regs uapi_pt_regs\n++#endif\n+ #include <asm/ptrace.h>\n++#if !defined(__GLIBC__)\n++# undef pt_regs\n++#endif\n+ \n+ #include \"arch/ppc-linux-common.h\"\n+ #include \"arch/ppc-linux-tdesc.h\"\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/17.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch\nnew file mode 100644\nindex 0000000000..878239a82e\n--- /dev/null\n+++ b/package/gdb/17.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch\n@@ -0,0 +1,43 @@\n+From ab3ce973d6423552de732a05ac9da04c22b21411 Mon Sep 17 00:00:00 2001\n+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>\n+Date: Sat, 3 Jun 2017 21:23:52 +0200\n+Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC\n+ systems\n+\n+Fixes a pt_{dsp,}regs redefinition when building with the musl C library\n+on SuperH.\n+\n+Inspired by\n+http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,\n+adapted for SuperH.\n+\n+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>\n+[Rebase\ton gdb 8.0]\n+Signed-off-by: Romain Naour <romain.naour@gmail.com>\n+---\n+ gdbserver/linux-sh-low.cc | 8 ++++++++\n+ 1 file changed, 8 insertions(+)\n+\n+diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc\n+index 64e6de3480b..4770e652614 100644\n+--- a/gdbserver/linux-sh-low.cc\n++++ b/gdbserver/linux-sh-low.cc\n+@@ -75,7 +75,15 @@ extern const struct target_desc *tdesc_sh;\n+ #include <sys/reg.h>\n+ #endif\n+ \n++#if !defined(__GLIBC__)\n++# define pt_regs uapi_pt_regs\n++# define pt_dspregs uapi_pt_dspregs\n++#endif\n+ #include <asm/ptrace.h>\n++#if !defined(__GLIBC__)\n++# undef pt_regs\n++# undef pt_dspregs\n++#endif\n+ \n+ #define sh_num_regs 41\n+ \n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0003-use-asm-sgidefs.h.patch b/package/gdb/17.1/0003-use-asm-sgidefs.h.patch\nnew file mode 100644\nindex 0000000000..b36d3730de\n--- /dev/null\n+++ b/package/gdb/17.1/0003-use-asm-sgidefs.h.patch\n@@ -0,0 +1,40 @@\n+From aa66834f88463c23a641c12e967bce68799cda47 Mon Sep 17 00:00:00 2001\n+From: Andre McCurdy <amccurdy@gmail.com>\n+Date: Sat, 30 Apr 2016 15:29:06 -0700\n+Subject: [PATCH] use <asm/sgidefs.h>\n+\n+Build fix for MIPS with musl libc\n+\n+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc\n+but not by musl. Regardless of the libc, the kernel headers provide\n+<asm/sgidefs.h> which provides the same definitions, so use that\n+instead.\n+\n+Upstream-Status: Pending\n+\n+[Vincent:\n+Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070]\n+\n+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>\n+Signed-off-by: Khem Raj <raj.khem@gmail.com>\n+Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>\n+---\n+ gdb/mips-linux-nat.c | 2 +-\n+ 1 file changed, 1 insertion(+), 1 deletion(-)\n+\n+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c\n+index 3d072ea935c..d763c9b8f7e 100644\n+--- a/gdb/mips-linux-nat.c\n++++ b/gdb/mips-linux-nat.c\n+@@ -30,7 +30,7 @@\n+ #include \"gdb_proc_service.h\"\n+ #include \"gregset.h\"\n+ \n+-#include <sgidefs.h>\n++#include <asm/sgidefs.h>\n+ #include \"nat/gdb_ptrace.h\"\n+ #include <asm/ptrace.h>\n+ #include \"inf-ptrace.h\"\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/17.1/0004-gdbserver-fix-build-for-m68k.patch\nnew file mode 100644\nindex 0000000000..8711190747\n--- /dev/null\n+++ b/package/gdb/17.1/0004-gdbserver-fix-build-for-m68k.patch\n@@ -0,0 +1,64 @@\n+From cec7ed0cb055f960a689f2403a871a7e3e852e6e Mon Sep 17 00:00:00 2001\n+From: Romain Naour <romain.naour@gmail.com>\n+Date: Fri, 22 Jun 2018 22:40:26 +0200\n+Subject: [PATCH] gdbserver: fix build for m68k\n+MIME-Version: 1.0\n+Content-Type: text/plain; charset=UTF-8\n+Content-Transfer-Encoding: 8bit\n+\n+As for strace [1], when <sys/reg.h> is included after <linux/ptrace.h>,\n+the build fails on m68k with the following diagnostics:\n+\n+In file included from ./../nat/linux-ptrace.h:28:0,\n+                 from linux-low.h:27,\n+                 from linux-m68k-low.c:20:\n+[...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant\n+   PT_D1 = 0,\n+   ^\n+[...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant\n+[...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant\n+In file included from linux-m68k-low.c:27:0:\n+[...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token\n+ };\n+ ^\n+\n+Fix this by moving <sys/reg.h> on top of \"linux-low.h\".\n+\n+[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92\n+\n+Signed-off-by: Romain Naour <romain.naour@gmail.com>\n+---\n+ gdbserver/linux-m68k-low.cc | 10 ++++++----\n+ 1 file changed, 6 insertions(+), 4 deletions(-)\n+\n+diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc\n+index 8020e49ac6e..d9ba6235288 100644\n+--- a/gdbserver/linux-m68k-low.cc\n++++ b/gdbserver/linux-m68k-low.cc\n+@@ -16,6 +16,12 @@\n+    You should have received a copy of the GNU General Public License\n+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */\n+ \n++#include \"server.h\"\n++\n++#ifdef HAVE_SYS_REG_H\n++#include <sys/reg.h>\n++#endif\n++\n+ #include \"linux-low.h\"\n+ \n+ /* Linux target op definitions for the m68k architecture.  */\n+@@ -79,10 +85,6 @@ m68k_target::low_decr_pc_after_break ()\n+ void init_registers_m68k (void);\n+ extern const struct target_desc *tdesc_m68k;\n+ \n+-#ifdef HAVE_SYS_REG_H\n+-#include <sys/reg.h>\n+-#endif\n+-\n+ #define m68k_num_regs 29\n+ #define m68k_num_gregs 18\n+ \n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/17.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch\nnew file mode 100644\nindex 0000000000..c5a08ad45c\n--- /dev/null\n+++ b/package/gdb/17.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch\n@@ -0,0 +1,55 @@\n+From 11b382a75cae8f4599e9d3f8b85815d2d95a58fa Mon Sep 17 00:00:00 2001\n+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>\n+Date: Sun, 24 Jun 2018 23:33:55 +0200\n+Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h\n+\n+To decide whether fork() or vfork() should be used, fork-inferior.c\n+uses the following test:\n+\n+  #if !(defined(__UCLIBC__) && defined(HAS_NOMMU))\n+\n+However, HAS_NOMMU is never defined, because it gets defined in\n+linux-ptrace.h, which is not included by fork-inferior.c. Due to this,\n+gdbserver fails to build on noMMU architectures. This commit fixes\n+that by simply including linux-ptrace.h.\n+\n+This bug was introduced by commit\n+2090129c36c7e582943b7d300968d19b46160d84 (\"Share fork_inferior et al\n+with gdbserver\"). Indeed, the same fork()/vfork() selection was done,\n+but in another file where linux-ptrace.h was included.\n+\n+Fixes the following build issue:\n+\n+../nat/fork-inferior.c: In function 'pid_t fork_inferior(const char*, const string&, char**, void (*)(), void (*)(int), void (*)(), const char*, void (*)(const char*, char* const*, char* const*))':\n+../nat/fork-inferior.c:376:11: error: 'fork' was not declared in this scope\n+     pid = fork ();\n+           ^~~~\n+../nat/fork-inferior.c:376:11: note: suggested alternative: 'vfork'\n+     pid = fork ();\n+           ^~~~\n+           vfork\n+\n+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>\n+[Romain: rebase on gdb 8.3]\n+Signed-off-by: Romain Naour <romain.naour@gmail.com>\n+[Bernd: rebased for version 17.1]\n+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>\n+---\n+ gdb/nat/fork-inferior.c | 1 +\n+ 1 file changed, 1 insertion(+)\n+\n+diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c\n+index 41765b102bc..a44a1d48722 100644\n+--- a/gdb/nat/fork-inferior.c\n++++ b/gdb/nat/fork-inferior.c\n+@@ -29,6 +29,7 @@\n+ #include \"gdbsupport/gdb_signals.h\"\n+ #include \"gdbsupport/buildargv.h\"\n+ #include \"gdbsupport/gdb_argv_vec.h\"\n++#include \"linux-ptrace.h\"\n+ #include <vector>\n+ \n+ extern char **environ;\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch b/package/gdb/17.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch\nnew file mode 100644\nindex 0000000000..6d205279da\n--- /dev/null\n+++ b/package/gdb/17.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch\n@@ -0,0 +1,39 @@\n+From 95d6a5a844083585f4f7b235cba14be94595b04a Mon Sep 17 00:00:00 2001\n+From: Peter Seiderer <ps.report@gmx.net>\n+Date: Sat, 6 Nov 2021 10:06:25 +0100\n+Subject: [PATCH] Fix getrandom compile for uclibc < v1.0.35\n+MIME-Version: 1.0\n+Content-Type: text/plain; charset=UTF-8\n+Content-Transfer-Encoding: 8bit\n+\n+- fix getrandom compile for uclibc < v1.0.35, add missing stddef.h\n+  include (fixed in uclibc since v1.0.35, see [1])\n+\n+Fixes:\n+\n+  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name ‘size_t’\n+     27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)\n+        |                                   ^~~~~~\n+\n+[1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=00972c02c2b6e0a95d5def4a71bdfb188e091782t\n+\n+Signed-off-by: Peter Seiderer <ps.report@gmx.net>\n+---\n+ gnulib/import/getrandom.c | 1 +\n+ 1 file changed, 1 insertion(+)\n+\n+diff --git a/gnulib/import/getrandom.c b/gnulib/import/getrandom.c\n+index e1468730933..3948d8d552a 100644\n+--- a/gnulib/import/getrandom.c\n++++ b/gnulib/import/getrandom.c\n+@@ -19,6 +19,7 @@\n+ \n+ #include <config.h>\n+ \n++#include <stddef.h>\n+ #include <sys/random.h>\n+ \n+ #include <errno.h>\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0007-fix-musl-build-on-riscv.patch b/package/gdb/17.1/0007-fix-musl-build-on-riscv.patch\nnew file mode 100644\nindex 0000000000..aea5eef84a\n--- /dev/null\n+++ b/package/gdb/17.1/0007-fix-musl-build-on-riscv.patch\n@@ -0,0 +1,60 @@\n+From 76bee99c13ab44949c25582f49528cd0c661cdb3 Mon Sep 17 00:00:00 2001\n+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n+Date: Wed, 10 Nov 2021 23:14:54 +0100\n+Subject: [PATCH] fix musl build on riscv\n+\n+Fix the following build failure raised with musl:\n+\n+../../gdbserver/linux-riscv-low.cc: In function 'void riscv_fill_fpregset(regcache*, void*)':\n+../../gdbserver/linux-riscv-low.cc:140:19: error: 'ELF_NFPREG' was not declared in this scope; did you mean 'ELF_NGREG'?\n+  140 |   for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)\n+      |                   ^~~~~~~~~~\n+      |                   ELF_NGREG\n+\n+musl fixed the issue with\n+https://git.musl-libc.org/cgit/musl/commit/?id=e5d2823631bbfebacf48e1a34ed28f28d7cb2570\n+\n+Fixes:\n+ - http://autobuild.buildroot.org/results/16b19198980ce9c81a618b3f6e8dc9fe28247a28\n+\n+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n+---\n+ gdb/nat/riscv-linux-tdesc.c  | 5 +++++\n+ gdbserver/linux-riscv-low.cc | 5 +++++\n+ 2 files changed, 10 insertions(+)\n+\n+diff --git a/gdb/nat/riscv-linux-tdesc.c b/gdb/nat/riscv-linux-tdesc.c\n+index 0cd38435b22..c1f39037ad7 100644\n+--- a/gdb/nat/riscv-linux-tdesc.c\n++++ b/gdb/nat/riscv-linux-tdesc.c\n+@@ -30,6 +30,11 @@\n+ # define NFPREG 33\n+ #endif\n+ \n++/* Work around musl breakage since version 1.1.24.  */\n++#ifndef ELF_NFPREG\n++# define ELF_NFPREG 33\n++#endif\n++\n+ /* See nat/riscv-linux-tdesc.h.  */\n+ \n+ struct riscv_gdbarch_features\n+diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc\n+index 44c805bb6d6..d43c3b9fe02 100644\n+--- a/gdbserver/linux-riscv-low.cc\n++++ b/gdbserver/linux-riscv-low.cc\n+@@ -29,6 +29,11 @@\n+ # define NFPREG 33\n+ #endif\n+ \n++/* Work around musl breakage since version 1.1.24.  */\n++#ifndef ELF_NFPREG\n++# define ELF_NFPREG 33\n++#endif\n++\n+ /* Linux target op definitions for the RISC-V architecture.  */\n+ \n+ class riscv_target : public linux_process_target\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch b/package/gdb/17.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch\nnew file mode 100644\nindex 0000000000..10156407cb\n--- /dev/null\n+++ b/package/gdb/17.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch\n@@ -0,0 +1,38 @@\n+From e5a09ecd2a222168a6c58eb57a171f64e75ad053 Mon Sep 17 00:00:00 2001\n+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n+Date: Thu, 18 Nov 2021 22:52:08 +0100\n+Subject: [PATCH] gdbserver/Makefile.in: fix NLS build\n+\n+Fix the following build failure raised since gdb version 10.1 and\n+https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a665d62266e75f0519f3a663784c458885b5c63:\n+\n+  CXXLD  libinproctrace.so\n+/home/buildroot/autobuild/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: gdbsupport/tdesc-ipa.o: in function `print_xml_feature::visit(tdesc_type_builtin const*)':\n+/home/buildroot/autobuild/instance-2/output-1/build/gdb-10.2/build/gdbserver/../../gdbserver/../gdbsupport/tdesc.cc:310: undefined reference to `libintl_gettext'\n+\n+Fixes:\n+ - http://autobuild.buildroot.org/results/faacc874fe9d32b74cb3d3dea988ef661cb0e3d0\n+\n+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n+[Upstream status:\n+https://sourceware.org/pipermail/gdb-patches/2021-November/183580.html]\n+---\n+ gdbserver/Makefile.in | 2 +-\n+ 1 file changed, 1 insertion(+), 1 deletion(-)\n+\n+diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in\n+index 365dcf23650..42e1b7bcf6d 100644\n+--- a/gdbserver/Makefile.in\n++++ b/gdbserver/Makefile.in\n+@@ -407,7 +407,7 @@ $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}\n+ \t$(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \\\n+ \t\t-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \\\n+ \t\t $(CXXFLAGS) \\\n+-\t\t-o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread\n++\t\t-o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread $(INTL)\n+ \n+ # Put the proper machine-specific files first, so M-. on a machine\n+ # specific routine gets the one for the correct machine.\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0009-gdb-Fix-native-build-on-xtensa.patch b/package/gdb/17.1/0009-gdb-Fix-native-build-on-xtensa.patch\nnew file mode 100644\nindex 0000000000..4d5a171aff\n--- /dev/null\n+++ b/package/gdb/17.1/0009-gdb-Fix-native-build-on-xtensa.patch\n@@ -0,0 +1,57 @@\n+From 43501f9838e7aefd7d5d19aede49491591c34c98 Mon Sep 17 00:00:00 2001\n+From: Romain Naour <romain.naour@gmail.com>\n+Date: Sun, 28 Aug 2022 23:21:37 +0200\n+Subject: [PATCH] gdb: Fix native build on xtensa\n+MIME-Version: 1.0\n+Content-Type: text/plain; charset=UTF-8\n+Content-Transfer-Encoding: 8bit\n+\n+Apply a similar fix than for Alpha architecture on gdb 9:\n+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=7a27b85f6d9b5eea9bd1493f903158fbea4b2231\n+\n+Fixes:\n+\n+../../gdb/xtensa-linux-nat.c: In function ‘void fill_gregset(const regcache*, elf_greg_t (*)[128], int)’:\n+../../gdb/xtensa-linux-nat.c:66:17: error: ‘gdbarch_pc_regnum’ was not declared in this scope\n+   66 |   if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)\n+      |                 ^~~~~~~~~~~~~~~~~\n+  CXX    complaints.o\n+../../gdb/xtensa-linux-nat.c:68:17: error: ‘gdbarch_ps_regnum’ was not declared in this scope\n+   68 |   if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)\n+      |                 ^~~~~~~~~~~~~~~~~\n+../../gdb/xtensa-linux-nat.c:71:38: error: no matching function for call to ‘gdbarch_tdep::gdbarch_tdep(gdbarch*&)’\n+   71 |   if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)\n+      |                                      ^\n+In file included from ../../gdb/xtensa-linux-nat.c:38:\n+../../gdb/xtensa-tdep.h:160:8: note: candidate: ‘gdbarch_tdep::gdbarch_tdep()’\n+  160 | struct gdbarch_tdep\n+      |        ^~~~~~~~~~~~\n+../../gdb/xtensa-tdep.h:160:8: note:   candidate expects 0 arguments, 1 provided\n+../../gdb/xtensa-tdep.h:160:8: note: candidate: ‘constexpr gdbarch_tdep::gdbarch_tdep(const gdbarch_tdep&)’\n+../../gdb/xtensa-tdep.h:160:8: note:   no known conversion for argument 1 from ‘gdbarch*’ to ‘const gdbarch_tdep&’\n+../../gdb/xtensa-tdep.h:160:8: note: candidate: ‘constexpr gdbarch_tdep::gdbarch_tdep(gdbarch_tdep&&)’\n+../../gdb/xtensa-tdep.h:160:8: note:   no known conversion for argument 1 from ‘gdbarch*’ to ‘gdbarch_tdep&&’\n+../../gdb/xtensa-linux-nat.c:72:49: error: no matching function for call to ‘gdbarch_tdep::gdbarch_tdep(gdbarch*&)’\n+   72 |     regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum,\n+      |                                                 ^\n+\n+Signed-off-by: Romain Naour <romain.naour@gmail.com>\n+---\n+ gdb/xtensa-linux-nat.c | 1 +\n+ 1 file changed, 1 insertion(+)\n+\n+diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c\n+index f8509b02e07..794be827f9a 100644\n+--- a/gdb/xtensa-linux-nat.c\n++++ b/gdb/xtensa-linux-nat.c\n+@@ -35,6 +35,7 @@\n+ \n+ #include \"gregset.h\"\n+ #include \"xtensa-tdep.h\"\n++#include \"gdbarch.h\"\n+ \n+ /* Defines ps_err_e, struct ps_prochandle.  */\n+ #include \"gdb_proc_service.h\"\n+-- \n+2.48.1\n+\ndiff --git a/package/gdb/17.1/0010-gdb-ser-unix-fix-musl-build-failure-when-setting-cus.patch b/package/gdb/17.1/0010-gdb-ser-unix-fix-musl-build-failure-when-setting-cus.patch\nnew file mode 100644\nindex 0000000000..593f9fcc4a\n--- /dev/null\n+++ b/package/gdb/17.1/0010-gdb-ser-unix-fix-musl-build-failure-when-setting-cus.patch\n@@ -0,0 +1,104 @@\n+From 56c4ba5d7b530fea8277704a231be5e64fca04fc Mon Sep 17 00:00:00 2001\n+From: Sunil Dora <sunilkumar.dora@windriver.com>\n+Date: Tue, 24 Mar 2026 09:45:26 -0700\n+Subject: [PATCH] gdb/ser-unix: fix musl build failure when setting custom baud\n+ rates\n+\n+On musl-based systems, <asm/termbits.h> may expose BOTHER even though\n+struct termios does not define c_ispeed/c_ospeed.  This causes the\n+Linux-specific custom baud rate path to be compiled and fail to build.\n+\n+Fix the problem at the macro level by requiring\n+HAVE_STRUCT_TERMIOS_C_OSPEED (obtained via AC_CHECK_MEMBERS) together\n+with BOTHER in the HAVE_CUSTOM_BAUDRATE_SUPPORT guard.  This prevents\n+the Linux-specific code from being compiled on musl while leaving\n+set_custom_baudrate_linux unchanged.\n+\n+This is a pure build fix with no functional or behavioural change on\n+any existing platform.\n+\n+Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk>\n+Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>\n+Approved-by: Kevin Buettner <kevinb@redhat.com>\n+(cherry picked from commit 94d58b3add01b6d29382fbb68a2e098166072ee2)\n+\n+Upstream: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=56c4ba5d7b530fea8277704a231be5e64fca04fc\n+\n+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>\n+---\n+ gdb/config.in    |  3 +++\n+ gdb/configure    | 13 +++++++++++++\n+ gdb/configure.ac |  3 +++\n+ gdb/ser-unix.c   |  4 +++-\n+ 4 files changed, 22 insertions(+), 1 deletion(-)\n+\n+diff --git a/gdb/config.in b/gdb/config.in\n+index efc3100cb9e..62ceb846824 100644\n+--- a/gdb/config.in\n++++ b/gdb/config.in\n+@@ -517,6 +517,9 @@\n+ /* Define to 1 if `st_blocks' is a member of `struct stat'. */\n+ #undef HAVE_STRUCT_STAT_ST_BLOCKS\n+ \n++/* Define to 1 if `c_ospeed' is a member of `struct termios'. */\n++#undef HAVE_STRUCT_TERMIOS_C_OSPEED\n++\n+ /* Define to 1 if `td_pcb' is a member of `struct thread'. */\n+ #undef HAVE_STRUCT_THREAD_TD_PCB\n+ \n+diff --git a/gdb/configure b/gdb/configure\n+index d0bdba6eb36..3c321d6220b 100755\n+--- a/gdb/configure\n++++ b/gdb/configure\n+@@ -27336,6 +27336,19 @@ if test \"$ac_res\" != no; then :\n+ fi\n+ \n+ \n++# Check for members required by the legacy Linux custom baud rate path.\n++ac_fn_c_check_member \"$LINENO\" \"struct termios\" \"c_ospeed\" \"ac_cv_member_struct_termios_c_ospeed\" \"#include <termios.h>\n++\"\n++if test \"x$ac_cv_member_struct_termios_c_ospeed\" = xyes; then :\n++\n++cat >>confdefs.h <<_ACEOF\n++#define HAVE_STRUCT_TERMIOS_C_OSPEED 1\n++_ACEOF\n++\n++\n++fi\n++\n++\n+ \n+ \n+ # Check whether --with-jit-reader-dir was given.\n+diff --git a/gdb/configure.ac b/gdb/configure.ac\n+index 52924106bca..9d3377f3c40 100644\n+--- a/gdb/configure.ac\n++++ b/gdb/configure.ac\n+@@ -733,6 +733,9 @@ AC_CONFIG_FILES([jit-reader.h:jit-reader.in])\n+ \n+ AC_SEARCH_LIBS(dlopen, dl)\n+ \n++# Check for members required by the legacy Linux custom baud rate path.\n++AC_CHECK_MEMBERS([struct termios.c_ospeed], [], [], [[#include <termios.h>]])\n++\n+ GDB_AC_WITH_DIR([JIT_READER_DIR], [jit-reader-dir],\n+                 [directory to load the JIT readers from],\n+                 [${libdir}/gdb])\n+diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c\n+index 6f2766518be..ffd721ad599 100644\n+--- a/gdb/ser-unix.c\n++++ b/gdb/ser-unix.c\n+@@ -53,7 +53,9 @@\n+ \n+ #include \"gdbsupport/scoped_ignore_sigttou.h\"\n+ \n+-#if defined(HAVE_SYS_IOCTL_H) && (defined(BOTHER) || defined(IOSSIOSPEED))\n++#if (defined(HAVE_SYS_IOCTL_H) \\\n++     && ((defined(BOTHER) && defined(HAVE_STRUCT_TERMIOS_C_OSPEED)) \\\n++\t  || defined(IOSSIOSPEED)))\n+ #  define HAVE_CUSTOM_BAUDRATE_SUPPORT 1\n+ #endif\n+ \n+-- \n+2.43.7\n+\ndiff --git a/package/gdb/17.1/0011-gdb-ser-unix-work-around-conflicting-types-for-tcfla.patch b/package/gdb/17.1/0011-gdb-ser-unix-work-around-conflicting-types-for-tcfla.patch\nnew file mode 100644\nindex 0000000000..a08d6c611a\n--- /dev/null\n+++ b/package/gdb/17.1/0011-gdb-ser-unix-work-around-conflicting-types-for-tcfla.patch\n@@ -0,0 +1,77 @@\n+From 6b84377e146794446f21371f8455b870a029cc8e Mon Sep 17 00:00:00 2001\n+From: Simon Marchi <simon.marchi@efficios.com>\n+Date: Mon, 17 Nov 2025 16:25:18 -0500\n+Subject: [PATCH] gdb/ser-unix: work around conflicting types for tcflag_t\n+MIME-Version: 1.0\n+Content-Type: text/plain; charset=utf8\n+Content-Transfer-Encoding: 8bit\n+\n+When trying to cross-compile GDB to sparc-buildroot-linux-uclibc, I get:\n+\n+      CXX    ser-unix.o\n+    In file included from /data1/smarchi/many-buildroots/toolchains/sparc/sparc-buildroot-linux-uclibc/sysroot/usr/include/termios.h:39,\n+                     from /home/smarchi/src/binutils-gdb/gdb/ser-unix.c:51:\n+    /data1/smarchi/many-buildroots/toolchains/sparc/sparc-buildroot-linux-uclibc/sysroot/usr/include/bits/termios.h:26:22: error: conflicting declaration âtypedef unsigned int tcflag_tâ\n+       26 | typedef unsigned int tcflag_t;\n+          |                      ^~~~~~~~\n+    In file included from /home/smarchi/src/binutils-gdb/gdb/ser-unix.c:46:\n+    /data1/smarchi/many-buildroots/toolchains/sparc/sparc-buildroot-linux-uclibc/sysroot/usr/include/asm/termbits.h:13:25: note: previous declaration as âtypedef long unsigned int tcflag_tâ\n+       13 | typedef unsigned long   tcflag_t;\n+          |                         ^~~~~~~~\n+\n+uClibc and the kernel don't agree on the definition of tcflag_t for this\n+architecture.  Here' uClibc [1]:\n+\n+    typedef unsigned int tcflag_t;\n+\n+And here's the kernel [2]:\n+\n+    #if defined(__sparc__) && defined(__arch64__)\n+    typedef unsigned int\ttcflag_t;\n+    #else\n+    typedef unsigned long\ttcflag_t; <--- that branch is take\n+    #endif\n+\n+glibc [3] has the same definition as uClibc, so we would get the same\n+problem.\n+\n+I propose to work around this the same way as we handle differences in\n+the termios structure, by renaming the version from the kernel.\n+\n+I opened a bug on the glibc bugzilla [4] to ask if this is something\n+that would need to be fixed on the libc side, but in the mean time we\n+need to work around it.\n+\n+[1] https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8/libc/sysdeps/linux/sparc/bits/termios.h#L26\n+[2] https://github.com/torvalds/linux/blob/e7c375b181600caf135cfd03eadbc45eb530f2cb/arch/sparc/include/uapi/asm/termbits.h#L7-L11\n+[3] https://gitlab.com/gnutools/glibc/-/blob/efc8642051e6c4fe5165e8986c1338ba2c180de6/bits/termios.h#L104\n+[4] https://sourceware.org/bugzilla/show_bug.cgi?id=33643\n+\n+Change-Id: I71c6e0df5ac8e2ff3db3233a2220faaf70c3df6d\n+Approved-By: Tom Tromey <tom@tromey.com>\n+\n+Upstream: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=6b84377e146794446f21371f8455b870a029cc8e\n+\n+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>\n+---\n+ gdb/ser-unix.c | 2 ++\n+ 1 file changed, 2 insertions(+)\n+\n+diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c\n+index 553220e5b08..f9ef8441629 100644\n+--- a/gdb/ser-unix.c\n++++ b/gdb/ser-unix.c\n+@@ -43,8 +43,10 @@\n+ /* Workaround to resolve conflicting declarations of termios\n+    in <asm/termbits.h> and <termios.h>.  */\n+ #  define termios asmtermios\n++#  define tcflag_t asmtcflag_t\n+ #  include <asm/termbits.h>\n+ #  undef termios\n++#  undef tcflag_t\n+ #endif\n+ \n+ #ifdef HAVE_TERMIOS_H\n+-- \n+2.43.7\n+\ndiff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host\nindex 963c46129d..a2caa3d58a 100644\n--- a/package/gdb/Config.in.host\n+++ b/package/gdb/Config.in.host\n@@ -61,7 +61,11 @@ config BR2_GDB_VERSION_16\n \tbool \"gdb 16.x\"\n \tdepends on BR2_HOST_GCC_AT_LEAST_9 && BR2_TOOLCHAIN_GCC_AT_LEAST_9\n \n-comment \"gdb 15.x/16.x need host and target gcc >= 9\"\n+config BR2_GDB_VERSION_17\n+\tbool \"gdb 17.x\"\n+\tdepends on BR2_HOST_GCC_AT_LEAST_9 && BR2_TOOLCHAIN_GCC_AT_LEAST_9\n+\n+comment \"gdb 15.x/16.x/17.x need host and target gcc >= 9\"\n \tdepends on !BR2_HOST_GCC_AT_LEAST_9 || \\\n \t\t!BR2_TOOLCHAIN_GCC_AT_LEAST_9\n \n@@ -76,4 +80,5 @@ config BR2_GDB_VERSION\n \tdefault \"14.2\"     if BR2_GDB_VERSION_14 || (!BR2_PACKAGE_HOST_GDB && !BR2_TOOLCHAIN_GCC_AT_LEAST_9)\n \tdefault \"15.2\"\t   if BR2_GDB_VERSION_15 || (!BR2_PACKAGE_HOST_GDB && BR2_TOOLCHAIN_GCC_AT_LEAST_9)\n \tdefault \"16.3\"\t   if BR2_GDB_VERSION_16\n+\tdefault \"17.1\"\t   if BR2_GDB_VERSION_17\n \tdepends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB\ndiff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash\nindex 7844b765e6..e2a250c0c7 100644\n--- a/package/gdb/gdb.hash\n+++ b/package/gdb/gdb.hash\n@@ -2,6 +2,7 @@\n sha512  7e07941f1fe661288cc571b4964012ceabc1760624fce20320db2f470c01439b2386f859b5288da13204b758e2e3b22a74c68c012178db93b9529b06f1e22ede  gdb-14.2.tar.xz\n sha512  624007deceb5b15ba89c0725883d1a699fa46714ef30887f3d0165e17c5d65d634671740a135aa69e437d916218abb08cfa2a38ed309ff19d48f51da56b2a8ba  gdb-15.2.tar.xz\n sha512  fffd6689c3405466a179670b04720dc825e4f210a761f63dd2b33027432f8cd5d1c059c431a5ec9e165eedd1901220b5329d73c522f9a444788888c731b29e9c  gdb-16.3.tar.xz\n+sha512  f1a6751e439a2128fecf3eae8b57c1608a0dc7cfe79b4356a937874e5a42bb2df0aba36eb6a9452c41966908b9a59076c7cad9720f684688ab956b65080f1d7c  gdb-17.1.tar.xz\n \n # Locally calculated (fetched from Github)\n sha512  a909a687abf6e9623c7ec99a8b2cbb03ab6fdeccee9ebd33ce34fffdb2bed5e4d519113aeb29ba3ca8db52e9bdbb63b59973914c74e3eebf4a4a2a6033b9e784  gdb-arc-2024.12-release-gdb.tar.gz\n","prefixes":["2/4"]}