diff options
Diffstat (limited to 'package/gdb')
12 files changed, 228 insertions, 131 deletions
diff --git a/package/gdb/8.2.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/10.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch index 1672ad2a15..9369a14d2c 100644 --- a/package/gdb/8.2.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch +++ b/package/gdb/10.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch @@ -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,21 +7,21 @@ 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" +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 - #include <elf.h> +#if !defined(__GLIBC__) +# define pt_regs uapi_pt_regs +#endif @@ -29,17 +29,17 @@ index 47428c1529c..841a5e02b9d 100644 +#if !defined(__GLIBC__) +# undef pt_regs +#endif + #include <asm/cputable.h> - #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 ---- 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 - + /* 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 @@ -47,9 +47,9 @@ index 3d4d4fdc563..5b93af8d3a3 100644 +#if !defined(__GLIBC__) +# undef pt_regs +#endif - #include <asm/cputable.h> - /* This sometimes isn't defined. */ + #include "arch/ppc-linux-common.h" + #include "arch/ppc-linux-tdesc.h" -- -2.14.4 +2.29.2 diff --git a/package/gdb/8.2.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/10.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch index ef2a94295c..2f96d29820 100644 --- a/package/gdb/8.2.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch +++ b/package/gdb/10.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch @@ -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 diff --git a/package/gdb/8.2.1/0003-use-asm-sgidefs.h.patch b/package/gdb/10.1/0003-use-asm-sgidefs.h.patch index 08146d3031..e04ebd1dd5 100644 --- a/package/gdb/8.2.1/0003-use-asm-sgidefs.h.patch +++ b/package/gdb/10.1/0003-use-asm-sgidefs.h.patch @@ -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 diff --git a/package/gdb/8.2.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/10.1/0004-gdbserver-fix-build-for-m68k.patch index c8f8ffb80c..846f7ed293 100644 --- a/package/gdb/8.2.1/0004-gdbserver-fix-build-for-m68k.patch +++ b/package/gdb/10.1/0004-gdbserver-fix-build-for-m68k.patch @@ -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 diff --git a/package/gdb/8.2.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/10.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch index a47dcf31e8..33dce4d940 100644 --- a/package/gdb/8.2.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch +++ b/package/gdb/10.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch @@ -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 diff --git a/package/gdb/8.2.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch b/package/gdb/8.2.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch deleted file mode 100644 index 989a5b1347..0000000000 --- a/package/gdb/8.2.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch +++ /dev/null @@ -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 - diff --git a/package/gdb/9.2/0006-sim-ppc-Fix-linker-error-with-fno-common.patch b/package/gdb/9.2/0006-sim-ppc-Fix-linker-error-with-fno-common.patch new file mode 100644 index 0000000000..813a1054a5 --- /dev/null +++ b/package/gdb/9.2/0006-sim-ppc-Fix-linker-error-with-fno-common.patch @@ -0,0 +1,101 @@ +From ad8464f799a4c96c7ab8bdfec3f95846cf54f9b0 Mon Sep 17 00:00:00 2001 +From: Sebastian Huber <sebastian.huber@embedded-brains.de> +Date: Wed, 1 Jul 2020 19:29:55 +0200 +Subject: [PATCH] sim/ppc: Fix linker error with -fno-common + +GCC 10 enables -fno-common by default. This resulted in a multiple +definition linker error since global variables were declared and defined +in a header file: + + ld: ld-insn.o:sim/ppc/ld-insn.h:221: multiple definition of + `max_model_fields_len'; igen.o:sim/ppc/ld-insn.h:221: first defined here + +sim/ppc + + * ld-insn.h (last_model, last_model_data, last_model_function, + last_model_internal, last_model_macro, last_model_static): + Delete. + (max_model_fields_len, model_data, model_functions, + model_internal, model_macros, model_static, models): Declare, but do not + define. + * ld-insn.c (last_model, last_model_data, last_model_function, + last_model_internal, last_model_macro, last_model_static, + max_model_fields_len, model_data, model_functions, + model_internal, model_macros, model_static, models): Define. + +Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> +Fetch from: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=ad8464f799a4c96c7ab8bdfec3f95846cf54f9b0 +--- + sim/ppc/ld-insn.c | 18 ++++++++++++++++++ + sim/ppc/ld-insn.h | 24 +++++++----------------- + 2 files changed, 25 insertions(+), 17 deletions(-) + +diff --git a/sim/ppc/ld-insn.c b/sim/ppc/ld-insn.c +index e39131ca133..585071a861f 100644 +--- a/sim/ppc/ld-insn.c ++++ b/sim/ppc/ld-insn.c +@@ -28,6 +28,24 @@ + + #include "igen.h" + ++static model *last_model; ++ ++static insn *last_model_macro; ++static insn *last_model_function; ++static insn *last_model_internal; ++static insn *last_model_static; ++static insn *last_model_data; ++ ++model *models; ++ ++insn *model_macros; ++insn *model_functions; ++insn *model_internal; ++insn *model_static; ++insn *model_data; ++ ++int max_model_fields_len; ++ + static void + update_depth(insn_table *entry, + lf *file, +diff --git a/sim/ppc/ld-insn.h b/sim/ppc/ld-insn.h +index 88318ffa2b3..52baeaa2d84 100644 +--- a/sim/ppc/ld-insn.h ++++ b/sim/ppc/ld-insn.h +@@ -200,25 +200,15 @@ extern insn_table *load_insn_table + table_include *includes, + cache_table **cache_rules); + +-model *models; +-model *last_model; ++extern model *models; + +-insn *model_macros; +-insn *last_model_macro; ++extern insn *model_macros; ++extern insn *model_functions; ++extern insn *model_internal; ++extern insn *model_static; ++extern insn *model_data; + +-insn *model_functions; +-insn *last_model_function; +- +-insn *model_internal; +-insn *last_model_internal; +- +-insn *model_static; +-insn *last_model_static; +- +-insn *model_data; +-insn *last_model_data; +- +-int max_model_fields_len; ++extern int max_model_fields_len; + + extern void insn_table_insert_insn + (insn_table *table, +-- +2.18.4 + diff --git a/package/gdb/Config.in b/package/gdb/Config.in index 4c787d49a1..b1aa5e47d9 100644 --- a/package/gdb/Config.in +++ b/package/gdb/Config.in @@ -49,11 +49,6 @@ config BR2_PACKAGE_GDB_SERVER bool "gdbserver" depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY depends on !BR2_riscv - # Simultaneous build of gdbserver and full gdb is not possible - # with arc-2019.09. This bug comes from upstream GDB. So - # simultaneous usage of full gdb and gdbserver is temporaly - # disabled for ARC until a fix becomes available. - depends on !(BR2_arc && BR2_PACKAGE_GDB_DEBUGGER) help Build the gdbserver stub to run on the target. A full gdb is needed to debug the progam. @@ -85,8 +80,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_PYTHON || BR2_PACKAGE_PYTHON3 help This option enables Python support in the target gdb. diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host index 42021b8086..9ac939ec1e 100644 --- a/package/gdb/Config.in.host +++ b/package/gdb/Config.in.host @@ -63,21 +63,21 @@ config BR2_PACKAGE_HOST_GDB_SIM choice prompt "GDB debugger Version" - default BR2_GDB_VERSION_8_3 + default BR2_GDB_VERSION_9_2 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" +config BR2_GDB_VERSION_10 + bool "gdb 10.x" + endchoice endif @@ -85,9 +85,9 @@ endif # If cross-gdb is not enabled, the latest working 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 "9.2" if BR2_GDB_VERSION_9_2 || !BR2_PACKAGE_HOST_GDB + default "10.1" if BR2_GDB_VERSION_10 depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB diff --git a/package/gdb/gdb-python-config b/package/gdb/gdb-python-config index 0f002281d7..640c358305 100755 --- a/package/gdb/gdb-python-config +++ b/package/gdb/gdb-python-config @@ -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 diff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash index 03e2afe102..3b4845d64c 100644 --- a/package/gdb/gdb.hash +++ b/package/gdb/gdb.hash @@ -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 0dc54380435c6853db60f1e388b94836d294dfa9ad7f518385a27db4edd03cb970f8717d5f1e9c9a0d4a33d7fcf91bc2e5d6c9cf9e4b561dcc74e65b806c1537 gdb-10.1.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 diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 6b63a6214b..17e10e8b16 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -8,10 +8,19 @@ GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION)) GDB_SITE = $(BR2_GNU_MIRROR)/gdb GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz +# recent gdb versions (>= 10) have gdbserver moved at the top-level, +# which requires a different build logic. +ifeq ($(BR2_GDB_VERSION_10),y) +GDB_GDBSERVER_TOPLEVEL = y +endif + 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) @@ -22,24 +31,24 @@ 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 -# We only want gdbserver and not the entire debugger. -ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),) +# 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),) GDB_SUBDIR = gdb/gdbserver + +# When we want to build the full gdb, or for very recent versions of +# gdb with gdbserver at the top-level, out of tree build is mandatory, +# so we create a 'build' subdirectory in the gdb sources, and build +# from there. else -GDB_DEPENDENCIES = ncurses \ - $(if $(BR2_PACKAGE_LIBICONV),libiconv) GDB_SUBDIR = build - -# Since gdb 9, in-tree builds for GDB are not allowed anymore, -# so we create a 'build' subdirectory in the gdb sources, and -# build from there. define GDB_CONFIGURE_SYMLINK mkdir -p $(@D)/$(GDB_SUBDIR) ln -sf ../configure $(@D)/$(GDB_SUBDIR)/configure endef GDB_PRE_CONFIGURE_HOOKS += GDB_CONFIGURE_SYMLINK - endif # For the host variant, we really want to build with XML support, @@ -79,7 +88,8 @@ GDB_DISABLE_BINUTILS_CONF_OPTS = \ --disable-binutils \ --disable-install-libbfd \ --disable-ld \ - --disable-gas + --disable-gas \ + --disable-gprof GDB_CONF_ENV = \ ac_cv_type_uintptr_t=yes \ @@ -137,13 +147,29 @@ GDB_CONF_OPTS = \ --without-x \ --disable-sim \ $(GDB_DISABLE_BINUTILS_CONF_OPTS) \ - $(if $(BR2_PACKAGE_GDB_SERVER),--enable-gdbserver,--disable-gdbserver) \ - --with-curses \ --without-included-gettext \ --disable-werror \ --enable-static \ --without-mpfr +ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y) +GDB_CONF_OPTS += \ + --enable-gdb \ + --with-curses +GDB_DEPENDENCIES = ncurses \ + $(if $(BR2_PACKAGE_LIBICONV),libiconv) +else +GDB_CONF_OPTS += \ + --disable-gdb \ + --without-curses +endif + +ifeq ($(BR2_PACKAGE_GDB_SERVER),y) +GDB_CONF_OPTS += --enable-gdbserver +else +GDB_CONF_OPTS += --disable-gdbserver +endif + # When gdb is built as C++ application for ARC it segfaults at runtime # So we pass --disable-build-with-cxx config option to force gdb not to # be built as C++ app. @@ -169,8 +195,18 @@ GDB_CONF_OPTS += --disable-tui endif ifeq ($(BR2_PACKAGE_GDB_PYTHON),y) -GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config +ifeq ($(BR2_PACKAGE_PYTHON3),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 +else +# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure. +GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR) +GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR) GDB_DEPENDENCIES += python +endif +GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config else GDB_CONF_OPTS += --without-python endif |