bump version to 2022.02.9

add miyoo_defconfig
This commit is contained in:
tiopex
2023-01-31 13:11:45 +01:00
parent 1fa746c353
commit dcdaa3599c
8423 changed files with 184305 additions and 91107 deletions

View File

@@ -1,4 +1,4 @@
From 72ee19f54fd35595465b2e35eccf1f3d65fe21c6 Mon Sep 17 00:00:00 2001
From 64b8ab56118d2fea027adfb7ebbc01668b29528e 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
@@ -10,30 +10,12 @@ 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/gdbserver/linux-ppc-low.c | 6 ++++++
gdb/nat/ppc-linux.h | 6 ++++++
gdb/nat/ppc-linux.h | 6 ++++++
gdbserver/linux-ppc-low.cc | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 1b695e53fe9..1978347c02c 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -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"
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index f1561b3b357..40399361c09 100644
index d937a65b69c..1fd54b4a0e0 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -18,7 +18,13 @@
@@ -50,6 +32,24 @@ index f1561b3b357..40399361c09 100644
#include <asm/cputable.h>
/* 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 <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.21.0
2.29.2

View File

@@ -1,4 +1,4 @@
From 6fade51aa4efd700e4a4054aaddb22eda0de7576 Mon Sep 17 00:00:00 2001
From d205f398e1e36f9673f50f368a3f29fd1dfaa794 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
@@ -15,14 +15,14 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Rebase on gdb 8.0]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-sh-low.c | 8 ++++++++
gdbserver/linux-sh-low.cc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index 76876f08078..ec4491474ac 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
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 <sys/reg.h>
#endif
@@ -39,5 +39,5 @@ index 76876f08078..ec4491474ac 100644
#define sh_num_regs 41
--
2.14.4
2.29.2

View File

@@ -1,4 +1,4 @@
From 19a0f664809b6858e69aa98188eb739415de044c Mon Sep 17 00:00:00 2001
From 65acc8800dba7e10da882871d4648241805c47ce 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>
@@ -23,7 +23,7 @@ Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index e68ed1e4da9..bc42aa59685 100644
index 38ff461a35b..b6cf194b2bf 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -31,7 +31,7 @@
@@ -36,5 +36,5 @@ index e68ed1e4da9..bc42aa59685 100644
#include <asm/ptrace.h>
#include "inf-ptrace.h"
--
2.21.0
2.29.2

View File

@@ -1,4 +1,4 @@
From 448e481aab86c823d908530038e20a14213db0a2 Mon Sep 17 00:00:00 2001
From 90ebe548922538b854de52e8b687384f44360984 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
@@ -28,14 +28,14 @@ Fix this by moving <sys/reg.h> on top of "linux-low.h".
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-m68k-low.c | 9 +++++----
gdbserver/linux-m68k-low.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index 16f639d02fc..969d9973737 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -17,16 +17,17 @@
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 <http://www.gnu.org/licenses/>. */
#include "server.h"
@@ -46,7 +46,8 @@ index 16f639d02fc..969d9973737 100644
+
#include "linux-low.h"
/* Defined in auto-generated file reg-m68k.c. */
/* 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;
@@ -58,5 +59,5 @@ index 16f639d02fc..969d9973737 100644
#define m68k_num_gregs 18
--
2.21.0
2.29.2

View File

@@ -1,4 +1,4 @@
From d84ecfa3a8c8fbade89229ac66c09f2a97ab00fb Mon Sep 17 00:00:00 2001
From c8454711eca2e79437e17ed1e1e68b48b4c8d927 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
@@ -37,17 +37,17 @@ Signed-off-by: Romain Naour <romain.naour@gmail.com>
1 file changed, 1 insertion(+)
diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
index fe9360a5039..626fe7c1fbf 100644
index 7ba0126871d..53e1ec72f09 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -27,6 +27,7 @@
#include "common/pathstuff.h"
#include "common/signals-state-save-restore.h"
#include "common/gdb_tilde_expand.h"
#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.21.0
2.29.2

View File

@@ -0,0 +1,39 @@
From bb894a9cfb1c3cf0e0a174c496ad848f589ee7da 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 030a78b..7b24350 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.33.1

View File

@@ -0,0 +1,60 @@
From c3fdbc0a24c83246f951ba79c7167547da979ae5 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 837b1707e0f..667c013006a 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 8bf97ea4aa3..1142dbc7b16 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.33.0

View File

@@ -0,0 +1,38 @@
From c098500aee945ee7a3021649eb0a2655b004103c 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 71c3c4ad959..e69fbc4dae4 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -383,7 +383,7 @@ $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
$(SILENCE) rm -f $(IPA_LIB)
$(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
- -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
+ -o $(IPA_LIB) ${IPA_OBJS} -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.33.0

View File

@@ -0,0 +1,57 @@
From 02d9e6a3bc47dfe138ef4511aaeeae26b7dbd1ba Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Sun, 28 Aug 2022 23:21:37 +0200
Subject: [PATCH] gdb: Fix native build on xtensa
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Apply a similar fix than for Alpha architecture on gdb 9:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=7a27b85f6d9b5eea9bd1493f903158fbea4b2231
Fixes:
../../gdb/xtensa-linux-nat.c: In function void fill_gregset(const regcache*, elf_greg_t (*)[128], int):
../../gdb/xtensa-linux-nat.c:66:17: error: gdbarch_pc_regnum was not declared in this scope
66 | if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
| ^~~~~~~~~~~~~~~~~
CXX complaints.o
../../gdb/xtensa-linux-nat.c:68:17: error: gdbarch_ps_regnum was not declared in this scope
68 | if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
| ^~~~~~~~~~~~~~~~~
../../gdb/xtensa-linux-nat.c:71:38: error: no matching function for call to gdbarch_tdep::gdbarch_tdep(gdbarch*&)
71 | if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
| ^
In file included from ../../gdb/xtensa-linux-nat.c:38:
../../gdb/xtensa-tdep.h:160:8: note: candidate: gdbarch_tdep::gdbarch_tdep()
160 | struct gdbarch_tdep
| ^~~~~~~~~~~~
../../gdb/xtensa-tdep.h:160:8: note: candidate expects 0 arguments, 1 provided
../../gdb/xtensa-tdep.h:160:8: note: candidate: constexpr gdbarch_tdep::gdbarch_tdep(const gdbarch_tdep&)
../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from gdbarch* to const gdbarch_tdep&
../../gdb/xtensa-tdep.h:160:8: note: candidate: constexpr gdbarch_tdep::gdbarch_tdep(gdbarch_tdep&&)
../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from gdbarch* to gdbarch_tdep&&
../../gdb/xtensa-linux-nat.c:72:49: error: no matching function for call to gdbarch_tdep::gdbarch_tdep(gdbarch*&)
72 | regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum,
| ^
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/xtensa-linux-nat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index b2b3db182bc..b230e08b69f 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -36,6 +36,7 @@
#include "gregset.h"
#include "xtensa-tdep.h"
+#include "gdbarch.h"
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
--
2.37.2

View File

@@ -1,4 +1,4 @@
From 7dd846212d46b5d0930c938222181cd305254951 Mon Sep 17 00:00:00 2001
From 64b8ab56118d2fea027adfb7ebbc01668b29528e 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
@@ -7,38 +7,20 @@ 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.0]
[Rebase on gdb 8.3]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-ppc-low.c | 6 ++++++
gdb/nat/ppc-linux.h | 6 ++++++
gdb/nat/ppc-linux.h | 6 ++++++
gdbserver/linux-ppc-low.cc | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 47428c1529c..841a5e02b9d 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -21,7 +21,13 @@
#include "linux-low.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"
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index 3d4d4fdc563..5b93af8d3a3 100644
index d937a65b69c..1fd54b4a0e0 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -18,7 +18,13 @@
#ifndef PPC_LINUX_H
#define PPC_LINUX_H 1
#ifndef NAT_PPC_LINUX_H
#define NAT_PPC_LINUX_H
+#if !defined(__GLIBC__)
+# define pt_regs uapi_pt_regs
@@ -50,6 +32,24 @@ index 3d4d4fdc563..5b93af8d3a3 100644
#include <asm/cputable.h>
/* 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 <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.14.4
2.29.2

View File

@@ -1,4 +1,4 @@
From ef630288fdc2d4d22651702672f9d5c9cd767e5b Mon Sep 17 00:00:00 2001
From d205f398e1e36f9673f50f368a3f29fd1dfaa794 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
@@ -15,14 +15,14 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Rebase on gdb 8.0]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-sh-low.c | 8 ++++++++
gdbserver/linux-sh-low.cc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index 0953721a190..c331c1382f7 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
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 <sys/reg.h>
#endif
@@ -39,5 +39,5 @@ index 0953721a190..c331c1382f7 100644
#define sh_num_regs 41
--
2.21.0
2.29.2

View File

@@ -1,4 +1,4 @@
From b286989e94e09c992462771cdbd3dc684f660b4f Mon Sep 17 00:00:00 2001
From 65acc8800dba7e10da882871d4648241805c47ce 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>
@@ -23,7 +23,7 @@ Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 21b1f583b92..de525ae6b01 100644
index 38ff461a35b..b6cf194b2bf 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -31,7 +31,7 @@
@@ -36,5 +36,5 @@ index 21b1f583b92..de525ae6b01 100644
#include <asm/ptrace.h>
#include "inf-ptrace.h"
--
2.14.4
2.29.2

View File

@@ -1,4 +1,4 @@
From 69cbbbbbd425111428db5ae91767dae5436ba63d Mon Sep 17 00:00:00 2001
From 90ebe548922538b854de52e8b687384f44360984 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
@@ -28,14 +28,14 @@ Fix this by moving <sys/reg.h> on top of "linux-low.h".
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-m68k-low.c | 9 +++++----
gdbserver/linux-m68k-low.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index 5594f10f927..19b4ef7b259 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -17,16 +17,17 @@
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 <http://www.gnu.org/licenses/>. */
#include "server.h"
@@ -46,7 +46,8 @@ index 5594f10f927..19b4ef7b259 100644
+
#include "linux-low.h"
/* Defined in auto-generated file reg-m68k.c. */
/* 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;
@@ -58,5 +59,5 @@ index 5594f10f927..19b4ef7b259 100644
#define m68k_num_gregs 18
--
2.14.4
2.29.2

View File

@@ -1,4 +1,4 @@
From fa319a6202cfe6e0415d28d6995019b18c16cd60 Mon Sep 17 00:00:00 2001
From c8454711eca2e79437e17ed1e1e68b48b4c8d927 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
@@ -30,22 +30,24 @@ Fixes the following build issue:
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 ea71aad25f7..77b9e03878b 100644
index 7ba0126871d..53e1ec72f09 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -26,6 +26,7 @@
#include "common-gdbthread.h"
#include "signals-state-save-restore.h"
#include "gdb_tilde_expand.h"
@@ -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.14.4
2.29.2

View File

@@ -0,0 +1,39 @@
From 879008ef9a48aa1363671f5c1736b49f30c5a379 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 41212fb..0ad3f96 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.33.1

View File

@@ -0,0 +1,60 @@
From c3fdbc0a24c83246f951ba79c7167547da979ae5 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 837b1707e0f..667c013006a 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 8bf97ea4aa3..1142dbc7b16 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.33.0

View File

@@ -0,0 +1,38 @@
From c098500aee945ee7a3021649eb0a2655b004103c 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 71c3c4ad959..e69fbc4dae4 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.33.0

View File

@@ -0,0 +1,57 @@
From d3bb361eb0b6cbf0257f515f9d5e64add89e6bfa Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Sun, 28 Aug 2022 23:21:37 +0200
Subject: [PATCH] gdb: Fix native build on xtensa
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Apply a similar fix than for Alpha architecture on gdb 9:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=7a27b85f6d9b5eea9bd1493f903158fbea4b2231
Fixes:
../../gdb/xtensa-linux-nat.c: In function void fill_gregset(const regcache*, elf_greg_t (*)[128], int):
../../gdb/xtensa-linux-nat.c:66:17: error: gdbarch_pc_regnum was not declared in this scope
66 | if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
| ^~~~~~~~~~~~~~~~~
CXX complaints.o
../../gdb/xtensa-linux-nat.c:68:17: error: gdbarch_ps_regnum was not declared in this scope
68 | if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
| ^~~~~~~~~~~~~~~~~
../../gdb/xtensa-linux-nat.c:71:38: error: no matching function for call to gdbarch_tdep::gdbarch_tdep(gdbarch*&)
71 | if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
| ^
In file included from ../../gdb/xtensa-linux-nat.c:38:
../../gdb/xtensa-tdep.h:160:8: note: candidate: gdbarch_tdep::gdbarch_tdep()
160 | struct gdbarch_tdep
| ^~~~~~~~~~~~
../../gdb/xtensa-tdep.h:160:8: note: candidate expects 0 arguments, 1 provided
../../gdb/xtensa-tdep.h:160:8: note: candidate: constexpr gdbarch_tdep::gdbarch_tdep(const gdbarch_tdep&)
../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from gdbarch* to const gdbarch_tdep&
../../gdb/xtensa-tdep.h:160:8: note: candidate: constexpr gdbarch_tdep::gdbarch_tdep(gdbarch_tdep&&)
../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from gdbarch* to gdbarch_tdep&&
../../gdb/xtensa-linux-nat.c:72:49: error: no matching function for call to gdbarch_tdep::gdbarch_tdep(gdbarch*&)
72 | regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum,
| ^
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/xtensa-linux-nat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index ec33f4a10f2..73f35eac683 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -36,6 +36,7 @@
#include "gregset.h"
#include "xtensa-tdep.h"
+#include "gdbarch.h"
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
--
2.37.2

View File

@@ -0,0 +1,193 @@
From 8342feee01e4e8d38affcf35e47ad900567f42e0 Mon Sep 17 00:00:00 2001
From: Kevin Buettner <kevinb@redhat.com>
Date: Wed, 27 May 2020 20:05:40 -0700
Subject: [PATCH] Fix Python3.9 related runtime problems
Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support
can be built using the configure switch -with-python=/usr/bin/python3.9.
Attempting to run gdb/Python3.9 segfaults on startup:
#0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
#1 0x000000000069ccbf in do_start_initialization ()
at worktree-test1/gdb/python/python.c:1789
#2 _initialize_python ()
at worktree-test1/gdb/python/python.c:1877
#3 0x00000000007afb0a in initialize_all_files () at init.c:237
...
Consulting the the documentation...
https://docs.python.org/3/c-api/init.html
...we find that PyEval_ReleaseLock() has been deprecated since version
3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread()
instead. In do_start_initialization, in gdb/python/python.c, we
can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock()
with a single call to PyEval_SaveThread. (Thanks to Keith Seitz
for working this out.)
With that in place, GDB gets a little bit further. It still dies
on startup, but the backtrace is different:
#0 0x00007ffff7b04306 in PyOS_InterruptOccurred ()
from /lib64/libpython3.9.so.1.0
#1 0x0000000000576e86 in check_quit_flag ()
at worktree-test1/gdb/extension.c:776
#2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 <extension_language_python>)
at worktree-test1/gdb/extension.c:705
#3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0,
gdbarch=0x0, language=0x0)
at worktree-test1/gdb/python/python.c:211
#4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10)
at worktree-test1/gdb/python/py-inferior.c:251
#5 0x00000000005d9fb9 in std::function<void (inferior*)>::operator()(inferior*) const (__args#0=<optimized out>, this=0xccad20)
at /usr/include/c++/10/bits/std_function.h:617
#6 gdb::observers::observable<inferior*>::notify (args#0=0xddeb10,
this=<optimized out>)
at worktree-test1/gdb/../gdbsupport/observable.h:106
#7 add_inferior_silent (pid=0)
at worktree-test1/gdb/inferior.c:113
#8 0x00000000005dbcb8 in initialize_inferiors ()
at worktree-test1/gdb/inferior.c:947
...
We checked with some Python Developers and were told that we should
acquire the GIL prior to calling any Python C API function. We
definitely don't have the GIL for calls of PyOS_InterruptOccurred().
I moved class_gdbpy_gil earlier in the file and use it in
gdbpy_check_quit_flag() to acquire (and automatically release) the
GIL.
With those changes in place, I was able to run to a GDB prompt. But,
when trying to quit, it segfaulted again due to due to some other
problems with gdbpy_check_quit_flag():
Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
(top-gdb) bt 8
#0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
#1 0x00007ffff7afa5ea in PyGILState_Ensure.cold ()
from /lib64/libpython3.9.so.1.0
#2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>)
at worktree-test1/gdb/python/python.c:278
#3 gdbpy_check_quit_flag (extlang=<optimized out>)
at worktree-test1/gdb/python/python.c:278
#4 0x0000000000576e96 in check_quit_flag ()
at worktree-test1/gdb/extension.c:776
#5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050)
at worktree-test1/gdb/extension.c:729
#6 0x000000000088913a in do_my_cleanups (
pmy_chain=0xc31870 <final_cleanup_chain>,
old_chain=0xae5720 <sentinel_cleanup>)
at worktree-test1/gdbsupport/cleanups.cc:131
#7 do_final_cleanups ()
at worktree-test1/gdbsupport/cleanups.cc:143
In this case, we're trying to call a Python C API function after
Py_Finalize() has been called from finalize_python(). I made
finalize_python set gdb_python_initialized to false and then cause
check_quit_flag() to return early when it's false.
With these changes in place, GDB seems to be working again with
Python3.9b1. I think it likely that there are other problems lurking.
I wouldn't be surprised to find that there are other calls into Python
where we don't first make sure that we have the GIL. Further changes
may well be needed.
I see no regressions testing on Rawhide using a GDB built with the
default Python version (3.8.3) versus one built using Python 3.9b1.
I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using
the default (though updated) system installed versions of Python on
those OSes. This means that I've tested against Python versions
2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB
still builds without problem and shows no regressions after applying
this patch.
gdb/ChangeLog:
2020-MM-DD Kevin Buettner <kevinb@redhat.com>
Keith Seitz <keiths@redhat.com>
* python/python.c (do_start_initialization): For Python 3.9 and
later, call PyEval_SaveThread instead of PyEval_ReleaseLock.
(class gdbpy_gil): Move to earlier in file.
(finalize_python): Set gdb_python_initialized.
(gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early
when not initialized.
[import into Buildroot, removing ChangeLog change to avoid conflict]
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
gdb/python/python.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index b00b70be85b..0eee3f0397c 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -268,6 +268,30 @@ ensure_python_env (struct gdbarch *gdbarch,
return make_cleanup (restore_python_env, env);
}
+/* A helper class to save and restore the GIL, but without touching
+ the other globals that are handled by gdbpy_enter. */
+
+class gdbpy_gil
+{
+public:
+
+ gdbpy_gil ()
+ : m_state (PyGILState_Ensure ())
+ {
+ }
+
+ ~gdbpy_gil ()
+ {
+ PyGILState_Release (m_state);
+ }
+
+ DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
+
+private:
+
+ PyGILState_STATE m_state;
+};
+
/* Set the quit flag. */
static void
@@ -281,6 +305,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang)
static int
gdbpy_check_quit_flag (const struct extension_language_defn *extlang)
{
+ if (!gdb_python_initialized)
+ return 0;
+
+ gdbpy_gil gil;
return PyOS_InterruptOccurred ();
}
@@ -1620,6 +1648,7 @@ finalize_python (void *ignore)
Py_Finalize ();
+ gdb_python_initialized = false;
restore_active_ext_lang (previous_active);
}
#endif
@@ -1854,8 +1883,7 @@ message == an error message without a stack will be printed."),
goto fail;
/* Release the GIL while gdb runs. */
- PyThreadState_Swap (NULL);
- PyEval_ReleaseLock ();
+ PyEval_SaveThread ();
make_final_cleanup (finalize_python, NULL);
--
2.31.1

View File

@@ -1,42 +0,0 @@
From e00c211d51bec301cf04719b77076a8783ef44b5 Mon Sep 17 00:00:00 2001
From: Raul Tambre <raul@tambre.ee>
Date: Sat, 4 May 2019 15:48:17 -0400
Subject: [PATCH] Fix incorrect use of 'is' operator for comparison in
python/lib/gdb/command/prompt.py
The 'is' operator is not meant to be used for comparisons. It currently working
is an implementation detail of CPython. CPython 3.8 has added a SyntaxWarning
for this.
(cherry picked from commit b6484282f85bf7f11451b2441599c241d302ad9d)
[Romain: backport to gdb 8.x]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/python/lib/gdb/command/prompt.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py
index 3d662a7d3f..04b9e49c22 100644
--- a/gdb/python/lib/gdb/command/prompt.py
+++ b/gdb/python/lib/gdb/command/prompt.py
@@ -45,7 +45,7 @@ The currently defined substitutions are:
self.hook_set = False
def get_show_string (self, pvalue):
- if self.value is not '':
+ if self.value:
return "The extended prompt is: " + self.value
else:
return "The extended prompt is not set."
@@ -57,7 +57,7 @@ The currently defined substitutions are:
return ""
def before_prompt_hook(self, current):
- if self.value is not '':
+ if self.value:
return gdb.prompt.substitute_prompt(self.value)
else:
return None
--
2.25.4

View File

@@ -1,42 +0,0 @@
From e00c211d51bec301cf04719b77076a8783ef44b5 Mon Sep 17 00:00:00 2001
From: Raul Tambre <raul@tambre.ee>
Date: Sat, 4 May 2019 15:48:17 -0400
Subject: [PATCH] Fix incorrect use of 'is' operator for comparison in
python/lib/gdb/command/prompt.py
The 'is' operator is not meant to be used for comparisons. It currently working
is an implementation detail of CPython. CPython 3.8 has added a SyntaxWarning
for this.
(cherry picked from commit b6484282f85bf7f11451b2441599c241d302ad9d)
[Romain: backport to gdb 8.x]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/python/lib/gdb/command/prompt.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py
index 3d662a7d3f..04b9e49c22 100644
--- a/gdb/python/lib/gdb/command/prompt.py
+++ b/gdb/python/lib/gdb/command/prompt.py
@@ -45,7 +45,7 @@ The currently defined substitutions are:
self.hook_set = False
def get_show_string (self, pvalue):
- if self.value is not '':
+ if self.value:
return "The extended prompt is: " + self.value
else:
return "The extended prompt is not set."
@@ -57,7 +57,7 @@ The currently defined substitutions are:
return ""
def before_prompt_hook(self, current):
- if self.value is not '':
+ if self.value:
return gdb.prompt.substitute_prompt(self.value)
else:
return None
--
2.25.4

View File

@@ -0,0 +1,227 @@
From c47bae859a5af0d95224d90000df0e529f7c5aa0 Mon Sep 17 00:00:00 2001
From: Kevin Buettner <kevinb@redhat.com>
Date: Wed, 27 May 2020 20:05:40 -0700
Subject: [PATCH] Fix Python3.9 related runtime problems
Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support
can be built using the configure switch -with-python=/usr/bin/python3.9.
Attempting to run gdb/Python3.9 segfaults on startup:
#0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
#1 0x000000000069ccbf in do_start_initialization ()
at worktree-test1/gdb/python/python.c:1789
#2 _initialize_python ()
at worktree-test1/gdb/python/python.c:1877
#3 0x00000000007afb0a in initialize_all_files () at init.c:237
...
Consulting the the documentation...
https://docs.python.org/3/c-api/init.html
...we find that PyEval_ReleaseLock() has been deprecated since version
3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread()
instead. In do_start_initialization, in gdb/python/python.c, we
can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock()
with a single call to PyEval_SaveThread. (Thanks to Keith Seitz
for working this out.)
With that in place, GDB gets a little bit further. It still dies
on startup, but the backtrace is different:
#0 0x00007ffff7b04306 in PyOS_InterruptOccurred ()
from /lib64/libpython3.9.so.1.0
#1 0x0000000000576e86 in check_quit_flag ()
at worktree-test1/gdb/extension.c:776
#2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 <extension_language_python>)
at worktree-test1/gdb/extension.c:705
#3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0,
gdbarch=0x0, language=0x0)
at worktree-test1/gdb/python/python.c:211
#4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10)
at worktree-test1/gdb/python/py-inferior.c:251
#5 0x00000000005d9fb9 in std::function<void (inferior*)>::operator()(inferior*) const (__args#0=<optimized out>, this=0xccad20)
at /usr/include/c++/10/bits/std_function.h:617
#6 gdb::observers::observable<inferior*>::notify (args#0=0xddeb10,
this=<optimized out>)
at worktree-test1/gdb/../gdbsupport/observable.h:106
#7 add_inferior_silent (pid=0)
at worktree-test1/gdb/inferior.c:113
#8 0x00000000005dbcb8 in initialize_inferiors ()
at worktree-test1/gdb/inferior.c:947
...
We checked with some Python Developers and were told that we should
acquire the GIL prior to calling any Python C API function. We
definitely don't have the GIL for calls of PyOS_InterruptOccurred().
I moved class_gdbpy_gil earlier in the file and use it in
gdbpy_check_quit_flag() to acquire (and automatically release) the
GIL.
With those changes in place, I was able to run to a GDB prompt. But,
when trying to quit, it segfaulted again due to due to some other
problems with gdbpy_check_quit_flag():
Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
(top-gdb) bt 8
#0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
#1 0x00007ffff7afa5ea in PyGILState_Ensure.cold ()
from /lib64/libpython3.9.so.1.0
#2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>)
at worktree-test1/gdb/python/python.c:278
#3 gdbpy_check_quit_flag (extlang=<optimized out>)
at worktree-test1/gdb/python/python.c:278
#4 0x0000000000576e96 in check_quit_flag ()
at worktree-test1/gdb/extension.c:776
#5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050)
at worktree-test1/gdb/extension.c:729
#6 0x000000000088913a in do_my_cleanups (
pmy_chain=0xc31870 <final_cleanup_chain>,
old_chain=0xae5720 <sentinel_cleanup>)
at worktree-test1/gdbsupport/cleanups.cc:131
#7 do_final_cleanups ()
at worktree-test1/gdbsupport/cleanups.cc:143
In this case, we're trying to call a Python C API function after
Py_Finalize() has been called from finalize_python(). I made
finalize_python set gdb_python_initialized to false and then cause
check_quit_flag() to return early when it's false.
With these changes in place, GDB seems to be working again with
Python3.9b1. I think it likely that there are other problems lurking.
I wouldn't be surprised to find that there are other calls into Python
where we don't first make sure that we have the GIL. Further changes
may well be needed.
I see no regressions testing on Rawhide using a GDB built with the
default Python version (3.8.3) versus one built using Python 3.9b1.
I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using
the default (though updated) system installed versions of Python on
those OSes. This means that I've tested against Python versions
2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB
still builds without problem and shows no regressions after applying
this patch.
gdb/ChangeLog:
2020-MM-DD Kevin Buettner <kevinb@redhat.com>
Keith Seitz <keiths@redhat.com>
* python/python.c (do_start_initialization): For Python 3.9 and
later, call PyEval_SaveThread instead of PyEval_ReleaseLock.
(class gdbpy_gil): Move to earlier in file.
(finalize_python): Set gdb_python_initialized.
(gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early
when not initialized.
[import into Buildroot, removing ChangeLog change to avoid conflict]
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
gdb/ChangeLog | 10 ++++++++
gdb/python/python.c | 56 ++++++++++++++++++++++++---------------------
2 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 67f362b852d..4bdd2201abc 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -238,6 +238,30 @@ gdbpy_enter::~gdbpy_enter ()
PyGILState_Release (m_state);
}
+/* A helper class to save and restore the GIL, but without touching
+ the other globals that are handled by gdbpy_enter. */
+
+class gdbpy_gil
+{
+public:
+
+ gdbpy_gil ()
+ : m_state (PyGILState_Ensure ())
+ {
+ }
+
+ ~gdbpy_gil ()
+ {
+ PyGILState_Release (m_state);
+ }
+
+ DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
+
+private:
+
+ PyGILState_STATE m_state;
+};
+
/* Set the quit flag. */
static void
@@ -251,6 +275,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang)
static int
gdbpy_check_quit_flag (const struct extension_language_defn *extlang)
{
+ if (!gdb_python_initialized)
+ return 0;
+
+ gdbpy_gil gil;
return PyOS_InterruptOccurred ();
}
@@ -943,30 +971,6 @@ gdbpy_source_script (const struct extension_language_defn *extlang,
/* Posting and handling events. */
-/* A helper class to save and restore the GIL, but without touching
- the other globals that are handled by gdbpy_enter. */
-
-class gdbpy_gil
-{
-public:
-
- gdbpy_gil ()
- : m_state (PyGILState_Ensure ())
- {
- }
-
- ~gdbpy_gil ()
- {
- PyGILState_Release (m_state);
- }
-
- DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
-
-private:
-
- PyGILState_STATE m_state;
-};
-
/* A single event. */
struct gdbpy_event
{
@@ -1616,6 +1620,7 @@ finalize_python (void *ignore)
Py_Finalize ();
+ gdb_python_initialized = false;
restore_active_ext_lang (previous_active);
}
@@ -1785,8 +1790,7 @@ do_start_initialization ()
return false;
/* Release the GIL while gdb runs. */
- PyThreadState_Swap (NULL);
- PyEval_ReleaseLock ();
+ PyEval_SaveThread ();
make_final_cleanup (finalize_python, NULL);
--
2.26.3

View File

@@ -0,0 +1,41 @@
From 808601f075fe3dd8ca101e31c9121a4e87f0bfc7 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Thu, 6 May 2021 07:45:00 +0200
Subject: [PATCH] gdb/configure.tgt: build gdbserver with m68k and
uclibc
Allow to build gdbserver with m68k and uclibc:
checking whether gdbserver is supported on this host... no
configure: error: Automatic gdbserver build is not supported for this configuration
Fixes:
- http://autobuild.buildroot.org/results/f4d6d9d8418c0da48a3db4ad5a82e19bd16eae34
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
gdb/configure.tgt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index caa42be1c01..8666bc5d0bf 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -372,12 +372,12 @@ m68hc11*-*-*|m6811*-*-*)
gdb_sim=../sim/m68hc11/libsim.a
;;
-m68*-*-aout* | m68*-*-coff* | m68*-*-elf* | m68*-*-rtems* | m68*-*-uclinux* | \
+m68*-*-aout* | m68*-*-coff* | m68*-*-elf* | m68*-*-rtems* | \
fido-*-elf*)
# Target: Motorola m68k embedded
gdb_target_obs="m68k-tdep.o"
;;
-m68*-*-linux*)
+m68*-*-*linux*)
# Target: Motorola m68k with a.out and ELF
gdb_target_obs="m68k-tdep.o m68k-linux-tdep.o solib-svr4.o \
linux-tdep.o glibc-tdep.o symfile-mem.o"
--
2.30.2

View File

@@ -0,0 +1,57 @@
From 222cb32acf044fe90e8534b064f9168ad0d8c705 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Sun, 28 Aug 2022 23:21:37 +0200
Subject: [PATCH] gdb: Fix native build on xtensa
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Apply a similar fix than for Alpha architecture on gdb 9:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=7a27b85f6d9b5eea9bd1493f903158fbea4b2231
Fixes:
../../gdb/xtensa-linux-nat.c: In function void fill_gregset(const regcache*, elf_greg_t (*)[128], int):
../../gdb/xtensa-linux-nat.c:66:17: error: gdbarch_pc_regnum was not declared in this scope
66 | if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
| ^~~~~~~~~~~~~~~~~
CXX complaints.o
../../gdb/xtensa-linux-nat.c:68:17: error: gdbarch_ps_regnum was not declared in this scope
68 | if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
| ^~~~~~~~~~~~~~~~~
../../gdb/xtensa-linux-nat.c:71:38: error: no matching function for call to gdbarch_tdep::gdbarch_tdep(gdbarch*&)
71 | if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
| ^
In file included from ../../gdb/xtensa-linux-nat.c:38:
../../gdb/xtensa-tdep.h:160:8: note: candidate: gdbarch_tdep::gdbarch_tdep()
160 | struct gdbarch_tdep
| ^~~~~~~~~~~~
../../gdb/xtensa-tdep.h:160:8: note: candidate expects 0 arguments, 1 provided
../../gdb/xtensa-tdep.h:160:8: note: candidate: constexpr gdbarch_tdep::gdbarch_tdep(const gdbarch_tdep&)
../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from gdbarch* to const gdbarch_tdep&
../../gdb/xtensa-tdep.h:160:8: note: candidate: constexpr gdbarch_tdep::gdbarch_tdep(gdbarch_tdep&&)
../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from gdbarch* to gdbarch_tdep&&
../../gdb/xtensa-linux-nat.c:72:49: error: no matching function for call to gdbarch_tdep::gdbarch_tdep(gdbarch*&)
72 | regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum,
| ^
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/xtensa-linux-nat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 097d7bd6f96..4e4290fe038 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -36,6 +36,7 @@
#include "gregset.h"
#include "xtensa-tdep.h"
+#include "gdbarch.h"
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
--
2.37.2

View File

@@ -3,7 +3,6 @@ config BR2_PACKAGE_GDB_ARCH_SUPPORTS
default y
depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT)
depends on !BR2_microblaze
depends on !BR2_nios2
depends on !BR2_or1k
depends on !BR2_nds32
@@ -20,8 +19,7 @@ config BR2_PACKAGE_GDB
depends on BR2_PACKAGE_GDB_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
depends on BR2_INSTALL_LIBSTDCPP
# no gdbserver on riscv
select BR2_PACKAGE_GDB_DEBUGGER if BR2_riscv
select BR2_PACKAGE_ZLIB
# When the external toolchain gdbserver is copied to the
# target, we don't allow building a separate gdbserver. The
# one from the external toolchain should be used.
@@ -48,7 +46,6 @@ if BR2_PACKAGE_GDB
config BR2_PACKAGE_GDB_SERVER
bool "gdbserver"
depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
depends on !BR2_riscv
help
Build the gdbserver stub to run on the target.
A full gdb is needed to debug the progam.
@@ -58,6 +55,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
depends on BR2_USE_WCHAR
depends on !BR2_sh
depends on !BR2_csky
select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11
select BR2_PACKAGE_NCURSES
comment "full gdb on target needs a toolchain w/ wchar"
@@ -80,8 +78,7 @@ config BR2_PACKAGE_GDB_TUI
config BR2_PACKAGE_GDB_PYTHON
bool "Python support"
# Only Python 2.x is supported by gdb for now
depends on BR2_PACKAGE_PYTHON
depends on BR2_PACKAGE_PYTHON3
help
This option enables Python support in the target gdb.

View File

@@ -3,9 +3,7 @@ config BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS
default y
depends on !((BR2_arm || BR2_armeb) && BR2_BINFMT_FLAT)
depends on !BR2_microblaze
depends on !BR2_nios2
depends on !BR2_or1k
depends on !BR2_riscv
depends on !BR2_nds32
comment "Host GDB Options"
@@ -32,29 +30,11 @@ config BR2_PACKAGE_HOST_GDB_TUI
help
This option enables terminal user interface (TUI) for gdb
choice
prompt "Python support"
default BR2_PACKAGE_HOST_GDB_NOPYTHON
help
Select the version of Python you wish to use
config BR2_PACKAGE_HOST_GDB_NOPYTHON
bool "None"
help
This option disables Python support in the cross gdb.
config BR2_PACKAGE_HOST_GDB_PYTHON
bool "Python 2"
help
This option enables the Python 2 support in the cross gdb.
config BR2_PACKAGE_HOST_GDB_PYTHON3
bool "Python 3"
bool "Python support"
help
This option enables the Python 3 support in the cross gdb.
endchoice
config BR2_PACKAGE_HOST_GDB_SIM
bool "Simulator support"
depends on !BR2_arc
@@ -63,31 +43,43 @@ config BR2_PACKAGE_HOST_GDB_SIM
choice
prompt "GDB debugger Version"
default BR2_GDB_VERSION_8_3
default BR2_GDB_VERSION_10
depends on !BR2_arc
depends on !BR2_csky
help
Select the version of gdb you wish to use.
config BR2_GDB_VERSION_8_2
bool "gdb 8.2.x"
config BR2_GDB_VERSION_8_3
bool "gdb 8.3.x"
config BR2_GDB_VERSION_9_2
bool "gdb 9.2.x"
# gdbserver support missing
depends on !BR2_riscv
config BR2_GDB_VERSION_10
bool "gdb 10.x"
config BR2_GDB_VERSION_11
bool "gdb 11.x"
endchoice
endif
# If cross-gdb is not enabled, the latest working version is chosen.
# If cross-gdb is not enabled, the latest stable version is chosen.
config BR2_GDB_VERSION
string
default "arc-2020.03-release-gdb" if BR2_arc
default "arc-2020.09-release-gdb" if BR2_arc
default "4ecb98fbc2f94dbe01b69384afbc515107de73df" if BR2_csky
default "8.2.1" if BR2_GDB_VERSION_8_2 || !BR2_PACKAGE_HOST_GDB
default "8.3.1" if BR2_GDB_VERSION_8_3
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
depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
# recent gdb versions (>= 10) have gdbserver moved at the top-level,
# which requires a different build logic.
config BR2_PACKAGE_GDB_TOPLEVEL
bool
default y if BR2_arc
default y if BR2_GDB_VERSION_10
default y if BR2_GDB_VERSION_11
default y if !BR2_PACKAGE_HOST_GDB
depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB

View File

@@ -17,20 +17,25 @@ if [ $# -ne 2 ] ; then
exit 1
fi
if [ -z "${BR_PYTHON_VERSION}" ]; then
echo "Environment variable BR_PYTHON_VERSION not set." >&2
exit 1
fi
# The first argument is the path to python-config.py, ignore it.
case "$2" in
--includes)
echo "-I${STAGING_DIR}/usr/include/python2.7"
;;
echo "-I${STAGING_DIR}/usr/include/python${BR_PYTHON_VERSION}"
;;
--ldflags)
echo "-lpthread -ldl -lutil -lm -lpython2.7"
;;
echo "-lpthread -ldl -lutil -lm -lpython${BR_PYTHON_VERSION}"
;;
--exec-prefix)
echo "/usr"
;;
echo "/usr"
;;
*)
echo "Bad arg $2." >&2
exit 1
;;
echo "Bad arg $2." >&2
exit 1
;;
esac

View File

@@ -1,10 +1,10 @@
# From ftp://gcc.gnu.org/pub/gdb/releases/sha512.sum
sha512 2aa81cfd389bb48c35d7d9f95cc10e88b4f7ad4597bdde0f8f1fd312f60f10d9fb2cc6e5a9355227d89ff328f7feb0fc411a69394560cafeb9fa75d35d896d11 gdb-8.2.1.tar.xz
sha512 9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a gdb-8.3.1.tar.xz
sha512 73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274 gdb-9.2.tar.xz
sha512 3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa gdb-10.2.tar.xz
sha512 07e9026423438049b11f4f784d57401ece4e940570f613bd6958b3714fe7fbc2c048470bcce3e7d7d9f93331cdf3881d30dcc964cb113a071143a02b28e5b127 gdb-11.2.tar.xz
# Locally calculated (fetched from Github)
sha512 74346a2a2b2082d35377711946b12c824222005c66813d5648350b101697eac67d3d01617e1daea03e41c196c2b7b4a4b225d1ee58af91dc69731bffed0e5d51 gdb-arc-2020.03-release-gdb.tar.gz
sha512 5a2acf2fd33ab2ff589e1037ca40abda54328997dcff26b2b49b874bd3be980be5a63342962254f3c3bda98e32ce7a33af704d37353352833dee193135600458 gdb-arc-2020.09-release-gdb.tar.gz
# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
sha512 c421e1f3c0d6cfb3c04544573c0c4b0075c8d8e3d563c6c234fcc1e4c2167ab203d1e57aec3b58abd348dc46f8cf9b47b753d3a43dba3ea970c9c9a6bd78c07b gdb-4ecb98fbc2f94dbe01b69384afbc515107de73df.tar.gz

View File

@@ -12,9 +12,6 @@ ifeq ($(BR2_arc),y)
GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION))
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
GDB_FROM_GIT = y
# recent gdb versions (>= 10) have gdbserver moved at the top-level,
# which requires a different build logic.
GDB_GDBSERVER_TOPLEVEL = y
endif
ifeq ($(BR2_csky),y)
@@ -25,10 +22,11 @@ endif
GDB_LICENSE = GPL-2.0+, LGPL-2.0+, GPL-3.0+, LGPL-3.0+
GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
GDB_CPE_ID_VENDOR = gnu
# On gdb < 10, if you want to build only gdbserver, you need to
# configure only gdb/gdbserver.
ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(GDB_GDBSERVER_TOPLEVEL),)
ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(BR2_PACKAGE_GDB_TOPLEVEL),)
GDB_SUBDIR = gdb/gdbserver
# When we want to build the full gdb, or for very recent versions of
@@ -49,7 +47,8 @@ endif
# also need ncurses.
# As for libiberty, gdb may use a system-installed one if present, so
# we must ensure ours is installed first.
HOST_GDB_DEPENDENCIES = host-expat host-libiberty host-ncurses
GDB_DEPENDENCIES = zlib
HOST_GDB_DEPENDENCIES = host-expat host-libiberty host-ncurses host-zlib
# Disable building documentation
GDB_MAKE_OPTS += MAKEINFO=true
@@ -73,6 +72,12 @@ 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)
HOST_GDB_DEPENDENCIES += host-gmp
endif
# When gdb sources are fetched from the binutils-gdb repository, they
# also contain the binutils sources, but binutils shouldn't be built,
# so we disable it (additionally the option --disable-install-libbfd
@@ -141,6 +146,7 @@ GDB_CONF_OPTS = \
--disable-sim \
$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
--without-included-gettext \
--with-system-zlib \
--disable-werror \
--enable-static \
--without-mpfr
@@ -149,7 +155,7 @@ ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y)
GDB_CONF_OPTS += \
--enable-gdb \
--with-curses
GDB_DEPENDENCIES = ncurses \
GDB_DEPENDENCIES += ncurses \
$(if $(BR2_PACKAGE_LIBICONV),libiconv)
else
GDB_CONF_OPTS += \
@@ -157,8 +163,19 @@ 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
# dependency. For now the default gdb version in Buildroot doesn't
# require gmp.
ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
GDB_CONF_OPTS += \
--with-libgmp-prefix=$(STAGING_DIR)/usr
GDB_DEPENDENCIES += gmp
endif
ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
GDB_CONF_OPTS += --enable-gdbserver
GDB_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
else
GDB_CONF_OPTS += --disable-gdbserver
endif
@@ -188,8 +205,11 @@ GDB_CONF_OPTS += --disable-tui
endif
ifeq ($(BR2_PACKAGE_GDB_PYTHON),y)
# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
GDB_DEPENDENCIES += python3
GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
GDB_DEPENDENCIES += python
else
GDB_CONF_OPTS += --without-python
endif
@@ -210,13 +230,6 @@ else
GDB_CONF_OPTS += --without-lzma
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
GDB_CONF_OPTS += --with-zlib
GDB_DEPENDENCIES += zlib
else
GDB_CONF_OPTS += --without-zlib
endif
ifeq ($(BR2_PACKAGE_GDB_PYTHON),)
# This removes some unneeded Python scripts and XML target description
# files that are not useful for a normal usage of the debugger.
@@ -254,6 +267,7 @@ HOST_GDB_CONF_OPTS = \
--enable-threads \
--disable-werror \
--without-included-gettext \
--with-system-zlib \
--with-curses \
--without-mpfr \
$(GDB_DISABLE_BINUTILS_CONF_OPTS)
@@ -264,10 +278,7 @@ else
HOST_GDB_CONF_OPTS += --disable-tui
endif
ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y)
HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python2
HOST_GDB_DEPENDENCIES += host-python
else ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python3
HOST_GDB_DEPENDENCIES += host-python3
else