From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Buildroot List <buildroot@buildroot.org>
Cc: Romain Naour <romain.naour@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH 1/4] package/gdb: add support for version 12.1
Date: Sat, 13 Aug 2022 10:35:17 +0200 [thread overview]
Message-ID: <20220813083521.1382565-1-thomas.petazzoni@bootlin.com> (raw)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 55 ++++++++++++++++
...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 43 +++++++++++++
package/gdb/12.1/0003-use-asm-sgidefs.h.patch | 40 ++++++++++++
.../0004-gdbserver-fix-build-for-m68k.patch | 63 +++++++++++++++++++
...fork-inferior-include-linux-ptrace.h.patch | 53 ++++++++++++++++
...getrandom-compile-for-uclibc-v1.0.35.patch | 39 ++++++++++++
.../12.1/0007-fix-musl-build-on-riscv.patch | 60 ++++++++++++++++++
...-gdbserver-Makefile.in-fix-NLS-build.patch | 38 +++++++++++
package/gdb/Config.in | 1 +
package/gdb/Config.in.host | 5 ++
package/gdb/gdb.hash | 1 +
package/gdb/gdb.mk | 11 ++--
12 files changed, 403 insertions(+), 6 deletions(-)
create mode 100644 package/gdb/12.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
create mode 100644 package/gdb/12.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
create mode 100644 package/gdb/12.1/0003-use-asm-sgidefs.h.patch
create mode 100644 package/gdb/12.1/0004-gdbserver-fix-build-for-m68k.patch
create mode 100644 package/gdb/12.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
create mode 100644 package/gdb/12.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch
create mode 100644 package/gdb/12.1/0007-fix-musl-build-on-riscv.patch
create mode 100644 package/gdb/12.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch
diff --git a/package/gdb/12.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/12.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
new file mode 100644
index 0000000000..8821bb497b
--- /dev/null
+++ b/package/gdb/12.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -0,0 +1,55 @@
+From bca7617f325787550e2133fe082dbe4da7716fc6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Rebase on gdb 8.3]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ 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 1094f6b0be3..d8588a646c2 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 <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+
+ /* This sometimes isn't defined. */
+diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
+index 08824887003..69afbae5359 100644
+--- a/gdbserver/linux-ppc-low.cc
++++ b/gdbserver/linux-ppc-low.cc
+@@ -23,7 +23,13 @@
+ #include "elf/common.h"
+ #include <sys/uio.h>
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+
+ #include "arch/ppc-linux-common.h"
+ #include "arch/ppc-linux-tdesc.h"
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/12.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
new file mode 100644
index 0000000000..74769b7c57
--- /dev/null
+++ b/package/gdb/12.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
@@ -0,0 +1,43 @@
+From a3b84f1777bd75bdc5914f4ce5f52c55e723cd9a Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+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 <thomas.petazzoni@free-electrons.com>
+[Rebase on gdb 8.0]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ 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 966bdeb8ba7..1e3ce53b4d5 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 <sys/reg.h>
+ #endif
+
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++# define pt_dspregs uapi_pt_dspregs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++# undef pt_dspregs
++#endif
+
+ #define sh_num_regs 41
+
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0003-use-asm-sgidefs.h.patch b/package/gdb/12.1/0003-use-asm-sgidefs.h.patch
new file mode 100644
index 0000000000..637e4a29ee
--- /dev/null
+++ b/package/gdb/12.1/0003-use-asm-sgidefs.h.patch
@@ -0,0 +1,40 @@
+From 8c94bf2b40d51c500c364ac03a2da1e9f9a94287 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <amccurdy@gmail.com>
+Date: Sat, 30 Apr 2016 15:29:06 -0700
+Subject: [PATCH] use <asm/sgidefs.h>
+
+Build fix for MIPS with musl libc
+
+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
+but not by musl. Regardless of the libc, the kernel headers provide
+<asm/sgidefs.h> 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 <armccurdy@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
+---
+ 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 20e12b6889e..1e66e98a013 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 <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/12.1/0004-gdbserver-fix-build-for-m68k.patch
new file mode 100644
index 0000000000..435f705382
--- /dev/null
+++ b/package/gdb/12.1/0004-gdbserver-fix-build-for-m68k.patch
@@ -0,0 +1,63 @@
+From 48af20f76b468c5d274d286677a2887136c4c7c4 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+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 <sys/reg.h> is included after <linux/ptrace.h>,
+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 <sys/reg.h> on top of "linux-low.h".
+
+[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ 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 7a433ffab5e..bb3fbd69bd7 100644
+--- a/gdbserver/linux-m68k-low.cc
++++ b/gdbserver/linux-m68k-low.cc
+@@ -17,6 +17,11 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ #include "server.h"
++
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#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 <sys/reg.h>
+-#endif
+-
+ #define m68k_num_regs 29
+ #define m68k_num_gregs 18
+
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/12.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
new file mode 100644
index 0000000000..b1ecc2097c
--- /dev/null
+++ b/package/gdb/12.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
@@ -0,0 +1,53 @@
+From cbcb73a86dea0c0b9917b49b37095463155c5377 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+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 <thomas.petazzoni@bootlin.com>
+[Romain: rebase on gdb 8.3]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ 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 4df9a98047e..9bf0f6059f5 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 <vector>
+
+ extern char **environ;
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch b/package/gdb/12.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch
new file mode 100644
index 0000000000..ab936975e0
--- /dev/null
+++ b/package/gdb/12.1/0006-Fix-getrandom-compile-for-uclibc-v1.0.35.patch
@@ -0,0 +1,39 @@
+From 03efe04b5748703234516836cb0186d25b052556 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Sat, 6 Nov 2021 10:06:25 +0100
+Subject: [PATCH] Fix getrandom compile for uclibc < v1.0.35
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+- fix getrandom compile for uclibc < v1.0.35, add missing stddef.h
+ include (fixed in uclibc since v1.0.35, see [1])
+
+Fixes:
+
+ .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name ‘size_t’
+ 27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
+ | ^~~~~~
+
+[1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=00972c02c2b6e0a95d5def4a71bdfb188e091782t
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ gnulib/import/getrandom.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gnulib/import/getrandom.c b/gnulib/import/getrandom.c
+index 41212fb329d..0ad3f9648d2 100644
+--- a/gnulib/import/getrandom.c
++++ b/gnulib/import/getrandom.c
+@@ -19,6 +19,7 @@
+
+ #include <config.h>
+
++#include <stddef.h>
+ #include <sys/random.h>
+
+ #include <errno.h>
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0007-fix-musl-build-on-riscv.patch b/package/gdb/12.1/0007-fix-musl-build-on-riscv.patch
new file mode 100644
index 0000000000..7b4133341a
--- /dev/null
+++ b/package/gdb/12.1/0007-fix-musl-build-on-riscv.patch
@@ -0,0 +1,60 @@
+From f2dd94dce490d8e8301fba9e4684cfb8d7bc7756 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 10 Nov 2021 23:14:54 +0100
+Subject: [PATCH] fix musl build on riscv
+
+Fix the following build failure raised with musl:
+
+../../gdbserver/linux-riscv-low.cc: In function 'void riscv_fill_fpregset(regcache*, void*)':
+../../gdbserver/linux-riscv-low.cc:140:19: error: 'ELF_NFPREG' was not declared in this scope; did you mean 'ELF_NGREG'?
+ 140 | for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)
+ | ^~~~~~~~~~
+ | ELF_NGREG
+
+musl fixed the issue with
+https://git.musl-libc.org/cgit/musl/commit/?id=e5d2823631bbfebacf48e1a34ed28f28d7cb2570
+
+Fixes:
+ - http://autobuild.buildroot.org/results/16b19198980ce9c81a618b3f6e8dc9fe28247a28
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ gdb/nat/riscv-linux-tdesc.c | 5 +++++
+ gdbserver/linux-riscv-low.cc | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/gdb/nat/riscv-linux-tdesc.c b/gdb/nat/riscv-linux-tdesc.c
+index 07b49c0f16e..1ff58cce16f 100644
+--- a/gdb/nat/riscv-linux-tdesc.c
++++ b/gdb/nat/riscv-linux-tdesc.c
+@@ -31,6 +31,11 @@
+ # define NFPREG 33
+ #endif
+
++/* Work around musl breakage since version 1.1.24. */
++#ifndef ELF_NFPREG
++# define ELF_NFPREG 33
++#endif
++
+ /* See nat/riscv-linux-tdesc.h. */
+
+ struct riscv_gdbarch_features
+diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc
+index 6b2902e422d..ead54db09a8 100644
+--- a/gdbserver/linux-riscv-low.cc
++++ b/gdbserver/linux-riscv-low.cc
+@@ -30,6 +30,11 @@
+ # define NFPREG 33
+ #endif
+
++/* Work around musl breakage since version 1.1.24. */
++#ifndef ELF_NFPREG
++# define ELF_NFPREG 33
++#endif
++
+ /* Linux target op definitions for the RISC-V architecture. */
+
+ class riscv_target : public linux_process_target
+--
+2.37.1
+
diff --git a/package/gdb/12.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch b/package/gdb/12.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch
new file mode 100644
index 0000000000..355ac480ee
--- /dev/null
+++ b/package/gdb/12.1/0008-gdbserver-Makefile.in-fix-NLS-build.patch
@@ -0,0 +1,38 @@
+From 73487022cb629415c3b0c2d9e125035b6e5c2d32 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Thu, 18 Nov 2021 22:52:08 +0100
+Subject: [PATCH] gdbserver/Makefile.in: fix NLS build
+
+Fix the following build failure raised since gdb version 10.1 and
+https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a665d62266e75f0519f3a663784c458885b5c63:
+
+ CXXLD libinproctrace.so
+/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*)':
+/home/buildroot/autobuild/instance-2/output-1/build/gdb-10.2/build/gdbserver/../../gdbserver/../gdbsupport/tdesc.cc:310: undefined reference to `libintl_gettext'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/faacc874fe9d32b74cb3d3dea988ef661cb0e3d0
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status:
+https://sourceware.org/pipermail/gdb-patches/2021-November/183580.html]
+---
+ gdbserver/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
+index 47648b8d962..9d862bcb9c9 100644
+--- a/gdbserver/Makefile.in
++++ b/gdbserver/Makefile.in
+@@ -383,7 +383,7 @@ $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
+ $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
+ -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+ $(CXXFLAGS) \
+- -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread
++ -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread $(INTL)
+
+ # Put the proper machine-specific files first, so M-. on a machine
+ # specific routine gets the one for the correct machine.
+--
+2.37.1
+
diff --git a/package/gdb/Config.in b/package/gdb/Config.in
index 71fa6f6064..c50c3d517a 100644
--- a/package/gdb/Config.in
+++ b/package/gdb/Config.in
@@ -52,6 +52,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
depends on BR2_USE_WCHAR
depends on !BR2_sh
select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11
+ select BR2_PACKAGE_GMP if BR2_GDB_VERSION_12
select BR2_PACKAGE_NCURSES
comment "full gdb on target needs a toolchain w/ wchar"
diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index a294103ca3..9ee0b3f913 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -57,6 +57,9 @@ config BR2_GDB_VERSION_10
config BR2_GDB_VERSION_11
bool "gdb 11.x"
+config BR2_GDB_VERSION_12
+ bool "gdb 12.x"
+
endchoice
endif
@@ -68,6 +71,7 @@ config BR2_GDB_VERSION
default "9.2" if BR2_GDB_VERSION_9_2
default "10.2" if BR2_GDB_VERSION_10 || !BR2_PACKAGE_HOST_GDB
default "11.2" if BR2_GDB_VERSION_11
+ default "12.1" if BR2_GDB_VERSION_12
depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
# recent gdb versions (>= 10) have gdbserver moved at the top-level,
@@ -77,5 +81,6 @@ config BR2_PACKAGE_GDB_TOPLEVEL
default y if BR2_arc
default y if BR2_GDB_VERSION_10
default y if BR2_GDB_VERSION_11
+ default y if BR2_GDB_VERSION_12
default y if !BR2_PACKAGE_HOST_GDB
depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
diff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash
index cb7f4c805d..3a1027dbb5 100644
--- a/package/gdb/gdb.hash
+++ b/package/gdb/gdb.hash
@@ -2,6 +2,7 @@
sha512 73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274 gdb-9.2.tar.xz
sha512 3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa gdb-10.2.tar.xz
sha512 07e9026423438049b11f4f784d57401ece4e940570f613bd6958b3714fe7fbc2c048470bcce3e7d7d9f93331cdf3881d30dcc964cb113a071143a02b28e5b127 gdb-11.2.tar.xz
+sha512 425568d2e84672177d0fb87b1ad7daafdde097648d605e30cf0656970f66adc6a82ca2d83375ea4be583e9683a340e5bfdf5819668ddf66728200141ae50ff2d gdb-12.1.tar.xz
# Locally calculated (fetched from Github)
sha512 5a2acf2fd33ab2ff589e1037ca40abda54328997dcff26b2b49b874bd3be980be5a63342962254f3c3bda98e32ce7a33af704d37353352833dee193135600458 gdb-arc-2020.09-release-gdb.tar.gz
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 86e57481de..dd126b42ce 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -65,9 +65,8 @@ GDB_DEPENDENCIES += host-flex host-bison
HOST_GDB_DEPENDENCIES += host-flex host-bison
endif
-# When BR2_GDB_VERSION_11=y, we're going to build gdb 11.x for the
-# host (if enabled), so we add the necessary gmp dependency.
-ifeq ($(BR2_GDB_VERSION_11),y)
+# Add the necessary host-gmp dependency for the newer releases of GDB
+ifeq ($(BR2_GDB_VERSION_11)$(BR2_GDB_VERSION_12),y)
HOST_GDB_DEPENDENCIES += host-gmp
endif
@@ -155,11 +154,11 @@ GDB_CONF_OPTS += \
--without-curses
endif
-# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and
-# we're building the full gdb for the target, we need gmp as a
+# When GDB >= 11.x (because it's enabled for the host) and we're
+# building the full gdb for the target, we need gmp as a
# dependency. For now the default gdb version in Buildroot doesn't
# require gmp.
-ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
+ifeq ($(BR2_GDB_VERSION_11)$(BR2_GDB_VERSION_12):$(BR2_PACKAGE_GDB_DEBUGGER),y:y)
GDB_CONF_OPTS += \
--with-libgmp-prefix=$(STAGING_DIR)/usr
GDB_DEPENDENCIES += gmp
--
2.37.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2022-08-13 8:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-13 8:35 Thomas Petazzoni via buildroot [this message]
2022-08-13 8:35 ` [Buildroot] [PATCH 2/4] package/gdb: remove support for 9.2 Thomas Petazzoni via buildroot
2022-08-14 15:59 ` Yann E. MORIN
2022-08-13 8:35 ` [Buildroot] [PATCH 3/4] package/gdb: switch to GDB 11.x as the default version Thomas Petazzoni via buildroot
2022-08-14 15:58 ` Yann E. MORIN
2022-08-13 8:35 ` [Buildroot] [PATCH 4/4] package/gdb: remove BR2_PACKAGE_GDB_TOPLEVEL Thomas Petazzoni via buildroot
2022-08-14 16:08 ` Yann E. MORIN
2022-08-14 15:59 ` [Buildroot] [PATCH 1/4] package/gdb: add support for version 12.1 Yann E. MORIN
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=20220813083521.1382565-1-thomas.petazzoni@bootlin.com \
--to=buildroot@buildroot.org \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.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