From patchwork Thu Sep 30 08:59:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Fischer X-Patchwork-Id: 1534739 X-Patchwork-Delegate: thomas.petazzoni@free-electrons.com Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HKnJT5Yywz9sRK for ; Thu, 30 Sep 2021 19:00:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 84EC3613C1; Thu, 30 Sep 2021 09:00:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VAXEiWd5NYIE; Thu, 30 Sep 2021 09:00:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id F2EA0613C2; Thu, 30 Sep 2021 09:00:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7CDA41BF21A for ; Thu, 30 Sep 2021 08:59:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 79EB383F2E for ; Thu, 30 Sep 2021 08:59:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eFdYNoqa16ZR for ; Thu, 30 Sep 2021 08:59:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) by smtp1.osuosl.org (Postfix) with ESMTPS id AE71784067 for ; Thu, 30 Sep 2021 08:59:48 +0000 (UTC) Received: from [84.191.225.2] (helo=exchange.go-sys.de) by smtprelay03.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (Exim 4.94.2) (envelope-from ) id 1mVrv2-00025V-BL for buildroot@busybox.net; Thu, 30 Sep 2021 10:59:56 +0200 Received: from exchange.go-sys.local (192.168.1.17) by exchange.go-sys.local (192.168.1.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2106.2; Thu, 30 Sep 2021 10:59:43 +0200 Received: from go-sys.de (192.168.1.112) by exchange.go-sys.de (192.168.1.17) with Microsoft SMTP Server id 15.1.2106.2 via Frontend Transport; Thu, 30 Sep 2021 10:59:43 +0200 From: Michael Fischer To: Date: Thu, 30 Sep 2021 10:59:17 +0200 Message-ID: <20210930085917.19799-1-mf@go-sys.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-C2ProcessedOrg: 77b28032-c882-4527-ad15-de6c89cb71cd X-CrossPremisesHeadersFilteredBySendConnector: exchange.go-sys.local X-OrganizationHeadersPreserved: exchange.go-sys.local X-Df-Sender: c21hcnRob3N0QGdvLXN5cy5kZQ== Subject: [Buildroot] [PATCH 1/1] package/gdb: add support for gdb 11.x X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Fischer Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" All patch from gdb 10.2 are kept. Signed-off-by: Michael Fischer --- ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 55 ++++++++++++++++ ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 43 +++++++++++++ package/gdb/11.1/0003-use-asm-sgidefs.h.patch | 40 ++++++++++++ .../0004-gdbserver-fix-build-for-m68k.patch | 63 +++++++++++++++++++ ...fork-inferior-include-linux-ptrace.h.patch | 53 ++++++++++++++++ package/gdb/Config.in.host | 5 ++ package/gdb/gdb.hash | 1 + 7 files changed, 260 insertions(+) create mode 100644 package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch create mode 100644 package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch create mode 100644 package/gdb/11.1/0003-use-asm-sgidefs.h.patch create mode 100644 package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch create mode 100644 package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch diff --git a/package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch new file mode 100644 index 0000000000..9369a14d2c --- /dev/null +++ b/package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch @@ -0,0 +1,55 @@ +From 64b8ab56118d2fea027adfb7ebbc01668b29528e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 6 Aug 2016 17:32:50 -0700 +Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +Signed-off-by: Thomas Petazzoni +[Rebase on gdb 8.3] +Signed-off-by: Romain Naour +--- + gdb/nat/ppc-linux.h | 6 ++++++ + gdbserver/linux-ppc-low.cc | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h +index d937a65b69c..1fd54b4a0e0 100644 +--- a/gdb/nat/ppc-linux.h ++++ b/gdb/nat/ppc-linux.h +@@ -18,7 +18,13 @@ + #ifndef NAT_PPC_LINUX_H + #define NAT_PPC_LINUX_H + ++#if !defined(__GLIBC__) ++# define pt_regs uapi_pt_regs ++#endif + #include ++#if !defined(__GLIBC__) ++# undef pt_regs ++#endif + #include + + /* This sometimes isn't defined. */ +diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc +index 337d555aee7..5d518f37268 100644 +--- a/gdbserver/linux-ppc-low.cc ++++ b/gdbserver/linux-ppc-low.cc +@@ -23,7 +23,13 @@ + #include "elf/common.h" + #include + #include ++#if !defined(__GLIBC__) ++# define pt_regs uapi_pt_regs ++#endif + #include ++#if !defined(__GLIBC__) ++# undef pt_regs ++#endif + + #include "arch/ppc-linux-common.h" + #include "arch/ppc-linux-tdesc.h" +-- +2.29.2 + diff --git a/package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch new file mode 100644 index 0000000000..2f96d29820 --- /dev/null +++ b/package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch @@ -0,0 +1,43 @@ +From d205f398e1e36f9673f50f368a3f29fd1dfaa794 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 3 Jun 2017 21:23:52 +0200 +Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC + systems + +Fixes a pt_{dsp,}regs redefinition when building with the musl C library +on SuperH. + +Inspired by +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, +adapted for SuperH. + +Signed-off-by: Thomas Petazzoni +[Rebase on gdb 8.0] +Signed-off-by: Romain Naour +--- + gdbserver/linux-sh-low.cc | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc +index a6d3fc60047..b83cce6b9fe 100644 +--- a/gdbserver/linux-sh-low.cc ++++ b/gdbserver/linux-sh-low.cc +@@ -76,7 +76,15 @@ extern const struct target_desc *tdesc_sh; + #include + #endif + ++#if !defined(__GLIBC__) ++# define pt_regs uapi_pt_regs ++# define pt_dspregs uapi_pt_dspregs ++#endif + #include ++#if !defined(__GLIBC__) ++# undef pt_regs ++# undef pt_dspregs ++#endif + + #define sh_num_regs 41 + +-- +2.29.2 + diff --git a/package/gdb/11.1/0003-use-asm-sgidefs.h.patch b/package/gdb/11.1/0003-use-asm-sgidefs.h.patch new file mode 100644 index 0000000000..e04ebd1dd5 --- /dev/null +++ b/package/gdb/11.1/0003-use-asm-sgidefs.h.patch @@ -0,0 +1,40 @@ +From 65acc8800dba7e10da882871d4648241805c47ce Mon Sep 17 00:00:00 2001 +From: Andre McCurdy +Date: Sat, 30 Apr 2016 15:29:06 -0700 +Subject: [PATCH] use + +Build fix for MIPS with musl libc + +The MIPS specific header is provided by glibc and uclibc +but not by musl. Regardless of the libc, the kernel headers provide + which provides the same definitions, so use that +instead. + +Upstream-Status: Pending + +[Vincent: +Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070] + +Signed-off-by: Andre McCurdy +Signed-off-by: Khem Raj +Signed-off-by: Vicente Olivert Riera +--- + gdb/mips-linux-nat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c +index 38ff461a35b..b6cf194b2bf 100644 +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -31,7 +31,7 @@ + #include "gdb_proc_service.h" + #include "gregset.h" + +-#include ++#include + #include "nat/gdb_ptrace.h" + #include + #include "inf-ptrace.h" +-- +2.29.2 + diff --git a/package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch new file mode 100644 index 0000000000..846f7ed293 --- /dev/null +++ b/package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch @@ -0,0 +1,63 @@ +From 90ebe548922538b854de52e8b687384f44360984 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Fri, 22 Jun 2018 22:40:26 +0200 +Subject: [PATCH] gdbserver: fix build for m68k +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As for strace [1], when is included after , +the build fails on m68k with the following diagnostics: + +In file included from ./../nat/linux-ptrace.h:28:0, + from linux-low.h:27, + from linux-m68k-low.c:20: +[...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant + PT_D1 = 0, + ^ +[...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant +[...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant +In file included from linux-m68k-low.c:27:0: +[...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token + }; + ^ + +Fix this by moving on top of "linux-low.h". + +[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92 + +Signed-off-by: Romain Naour +--- + gdbserver/linux-m68k-low.cc | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc +index 838ba353b0b..36679682b9a 100644 +--- a/gdbserver/linux-m68k-low.cc ++++ b/gdbserver/linux-m68k-low.cc +@@ -17,6 +17,11 @@ + along with this program. If not, see . */ + + #include "server.h" ++ ++#ifdef HAVE_SYS_REG_H ++#include ++#endif ++ + #include "linux-low.h" + + /* Linux target op definitions for the m68k architecture. */ +@@ -80,10 +85,6 @@ m68k_target::low_decr_pc_after_break () + void init_registers_m68k (void); + extern const struct target_desc *tdesc_m68k; + +-#ifdef HAVE_SYS_REG_H +-#include +-#endif +- + #define m68k_num_regs 29 + #define m68k_num_gregs 18 + +-- +2.29.2 + diff --git a/package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch new file mode 100644 index 0000000000..33dce4d940 --- /dev/null +++ b/package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch @@ -0,0 +1,53 @@ +From c8454711eca2e79437e17ed1e1e68b48b4c8d927 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 24 Jun 2018 23:33:55 +0200 +Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h + +To decide whether fork() or vfork() should be used, fork-inferior.c +uses the following test: + + #if !(defined(__UCLIBC__) && defined(HAS_NOMMU)) + +However, HAS_NOMMU is never defined, because it gets defined in +linux-ptrace.h, which is not included by fork-inferior.c. Due to this, +gdbserver fails to build on noMMU architectures. This commit fixes +that by simply including linux-ptrace.h. + +This bug was introduced by commit +2090129c36c7e582943b7d300968d19b46160d84 ("Share fork_inferior et al +with gdbserver"). Indeed, the same fork()/vfork() selection was done, +but in another file where linux-ptrace.h was included. + +Fixes the following build issue: + +../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*))': +../nat/fork-inferior.c:376:11: error: 'fork' was not declared in this scope + pid = fork (); + ^~~~ +../nat/fork-inferior.c:376:11: note: suggested alternative: 'vfork' + pid = fork (); + ^~~~ + vfork + +Signed-off-by: Thomas Petazzoni +[Romain: rebase on gdb 8.3] +Signed-off-by: Romain Naour +--- + gdb/nat/fork-inferior.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c +index 7ba0126871d..53e1ec72f09 100644 +--- a/gdb/nat/fork-inferior.c ++++ b/gdb/nat/fork-inferior.c +@@ -27,6 +27,7 @@ + #include "gdbsupport/pathstuff.h" + #include "gdbsupport/signals-state-save-restore.h" + #include "gdbsupport/gdb_tilde_expand.h" ++#include "linux-ptrace.h" + #include + + extern char **environ; +-- +2.29.2 + diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host index 142bf1458a..b05450bece 100644 --- a/package/gdb/Config.in.host +++ b/package/gdb/Config.in.host @@ -80,6 +80,10 @@ config BR2_GDB_VERSION_9_2 config BR2_GDB_VERSION_10 bool "gdb 10.x" +config BR2_GDB_VERSION_11 + bool "gdb 11.x" + select BR2_PACKAGE_GMP + endchoice endif @@ -92,6 +96,7 @@ config BR2_GDB_VERSION default "8.3.1" if BR2_GDB_VERSION_8_3 default "9.2" if BR2_GDB_VERSION_9_2 || (!BR2_PACKAGE_HOST_GDB && !BR2_riscv) default "10.2" if BR2_GDB_VERSION_10 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv) + default "11.1" if BR2_GDB_VERSION_11 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv) depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB # recent gdb versions (>= 10) have gdbserver moved at the top-level, diff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash index c45ee7329f..e3b867b042 100644 --- a/package/gdb/gdb.hash +++ b/package/gdb/gdb.hash @@ -2,6 +2,7 @@ sha512 9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a gdb-8.3.1.tar.xz sha512 73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274 gdb-9.2.tar.xz sha512 3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa gdb-10.2.tar.xz +sha512 c40bf970e2f7c2107b29c5aa6a7150daa709d75ddadb73ac20742419d4637d158e3063a4c6ff6e47fae8ca8e1d36253973f85ea15445d004be6d5d7a2dd9bd46 gdb-11.1.tar.xz # Locally calculated (fetched from Github) sha512 5a2acf2fd33ab2ff589e1037ca40abda54328997dcff26b2b49b874bd3be980be5a63342962254f3c3bda98e32ce7a33af704d37353352833dee193135600458 gdb-arc-2020.09-release-gdb.tar.gz