diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-04 08:52:07 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-05 23:52:41 +0200 |
commit | 2c999beb94c8fdada1211eb676f7e69c42ac0405 (patch) | |
tree | 8bee6d0b73d864cd235b0c2582ed2032308596e5 | |
parent | f1ca2420a503c47e5fadae6f7431634797bc0cf8 (diff) | |
download | ptxdist-2c999beb94c8fdada1211eb676f7e69c42ac0405.tar.gz ptxdist-2c999beb94c8fdada1211eb676f7e69c42ac0405.tar.xz |
gdb: optionally use toolchain gdb version
This requires switching to tar.xz archives. Otherwise, the md5 does not
match.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | rules/gdb-menu.in | 18 | ||||
-rw-r--r-- | rules/gdb.make | 6 | ||||
-rw-r--r-- | rules/gdbserver.make | 6 | ||||
-rw-r--r-- | rules/pre/gdb.make | 27 |
4 files changed, 50 insertions, 7 deletions
diff --git a/rules/gdb-menu.in b/rules/gdb-menu.in index cc00ba197..907d23942 100644 --- a/rules/gdb-menu.in +++ b/rules/gdb-menu.in @@ -6,13 +6,29 @@ menu "gdb " if GDB || GDBSERVER +config GDB_TOOLCHAIN_VERSION + bool + default y if GDBSERVER + prompt "use toolchain gdb version" + help + Use the same version as the gdb in the toolchain to make sure that + gdb and gdbserver work correctly. + +if !GDB_TOOLCHAIN_VERSION + config GDB_VERSION string "gdb version" default "7.6.1" +endif config GDB_MD5 string "gdb source md5sum" - default "d42841167fd061d90fddf9a7212a1f9f" + default "d42841167fd061d90fddf9a7212a1f9f" if !GDB_TOOLCHAIN_VERSION + help + md5sum for the gdb source archive. If the version is provided by + the toolchain and the toolchain is a OSELAS.Toolchain then this + can be left empty and the md5sum from the toolchain ptxconfig is + used. endif diff --git a/rules/gdb.make b/rules/gdb.make index c0a36831c..c1b35b1f0 100644 --- a/rules/gdb.make +++ b/rules/gdb.make @@ -18,10 +18,10 @@ PACKAGES-$(PTXCONF_GDB) += gdb # # Paths and names # -GDB_VERSION := $(call remove_quotes,$(PTXCONF_GDB_VERSION)) -GDB_MD5 := $(call remove_quotes,$(PTXCONF_GDB_MD5)) +GDB_VERSION = $(SHARED_GDB_VERSION) +GDB_MD5 = $(SHARED_GDB_MD5) GDB := gdb-$(GDB_VERSION) -GDB_SUFFIX := tar.gz +GDB_SUFFIX := tar.xz GDB_SOURCE := $(SRCDIR)/$(GDB).$(GDB_SUFFIX) GDB_DIR := $(BUILDDIR)/$(GDB) GDB_LICENSE := GPL-3.0-or-later diff --git a/rules/gdbserver.make b/rules/gdbserver.make index c0ef56e80..2430e75b8 100644 --- a/rules/gdbserver.make +++ b/rules/gdbserver.make @@ -15,10 +15,10 @@ # PACKAGES-$(PTXCONF_GDBSERVER) += gdbserver -GDBSERVER_VERSION := $(call remove_quotes,$(PTXCONF_GDB_VERSION)) -GDBSERVER_MD5 := $(call remove_quotes,$(PTXCONF_GDB_MD5)) +GDBSERVER_VERSION = $(SHARED_GDB_VERSION) +GDBSERVER_MD5 = $(SHARED_GDB_MD5) GDBSERVER := gdb-$(GDBSERVER_VERSION) -GDBSERVER_SUFFIX := tar.gz +GDBSERVER_SUFFIX := tar.xz GDBSERVER_SOURCE := $(SRCDIR)/$(GDBSERVER).$(GDBSERVER_SUFFIX) GDBSERVER_DIR := $(BUILDDIR)/gdbserver-$(GDBSERVER_VERSION) GDBSERVER_PKGDIR := $(PKGDIR)/gdbserver-$(GDBSERVER_VERSION) diff --git a/rules/pre/gdb.make b/rules/pre/gdb.make new file mode 100644 index 000000000..52e8e7545 --- /dev/null +++ b/rules/pre/gdb.make @@ -0,0 +1,27 @@ +# -*-makefile-*- +# +# Copyright (C) 2018 by Michael Olbrich <m.olbrich@pengutronix.de> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +SHARED_GDB_MD5 := $(call remove_quotes,$(PTXCONF_GDB_MD5)) + +ifdef PTXCONF_GDB_TOOLCHAIN_VERSION +TOOLCHAIN_CONFIG := $(PTXDIST_PLATFORMDIR)/selected_toolchain/ptxconfig +ifneq ($(wildcard $(TOOLCHAIN_CONFIG)),) +SHARED_GDB_VERSION = $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_VERSION)) +ifeq ($(SHARED_GDB_MD5),) +SHARED_GDB_MD5 = $(call remove_quotes,$(shell ptxd_get_kconfig $(TOOLCHAIN_CONFIG) PTXCONF_CROSS_GDB_MD5)) +endif +else +SHARED_GDB_VERSION := $(shell $(PTXCONF_COMPILER_PREFIX)gdb -v | sed -e 's/.* //;q') +endif +else +SHARED_GDB_VERSION := $(call remove_quotes,$(PTXCONF_GDB_VERSION)) +endif + +# vim: syntax=make |