From 71fff4edf79e819f703d95c55cb44c5fe4fb13df Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Thu, 2 Jun 2011 18:25:51 +0200 Subject: Toolchain: GDB: rework deeply the build infrastructure and add gdb-7.2 and associated patches Signed-off-by: Abdoulaye Walsimou Gaye --- packages/development/development.kconfig | 2 + packages/development/development.mk | 6 ++ packages/development/gdb/gdb.kconfig | 100 +++++++++++++++++++++++++ packages/development/gdb/gdb.mk | 123 +++++++++++++++++++++++++++++++ 4 files changed, 231 insertions(+) create mode 100644 packages/development/gdb/gdb.kconfig create mode 100644 packages/development/gdb/gdb.mk (limited to 'packages/development') diff --git a/packages/development/development.kconfig b/packages/development/development.kconfig index f12e035..cab2c9d 100644 --- a/packages/development/development.kconfig +++ b/packages/development/development.kconfig @@ -23,6 +23,8 @@ # \date October 2010 ################################################################################ +# GDB: already included from main kconfig + #libevent source packages/development/libevent/libevent.kconfig diff --git a/packages/development/development.mk b/packages/development/development.mk index 97025fa..2bd71af 100644 --- a/packages/development/development.mk +++ b/packages/development/development.mk @@ -23,6 +23,12 @@ # \date February 2010 ################################################################################ +#libevent +include $(EMBTK_ROOT)/packages/development/gdb/gdb.mk +ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDB) += gdbfull_install +ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_GDBSERVER) += gdbserver_install +HOSTTOOLS_COMPONENTS-$(CONFIG_EMBTK_HOST_HAVE_GDB) += gdb_host_install + #libevent include $(EMBTK_ROOT)/packages/development/libevent/libevent.mk ROOTFS_COMPONENTS-$(CONFIG_EMBTK_HAVE_LIBEVENT) += libevent_install diff --git a/packages/development/gdb/gdb.kconfig b/packages/development/gdb/gdb.kconfig new file mode 100644 index 0000000..73cdf8c --- /dev/null +++ b/packages/development/gdb/gdb.kconfig @@ -0,0 +1,100 @@ +################################################################################ +# Embtoolkit +# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +################################################################################ +# +# \file gdb.kconfig +# \brief gdb.kconfig of Embtoolkit +# \author Abdoulaye Walsimou GAYE +# \date July 2009 +################################################################################ + +config EMBTK_HAVE_GDB_SYSTEM + bool "Have GDB: Gnu debugging system" + select EMBTK_GDB_PKG_IS_TARBZ2 + help + Have GNU debugger components on your embedded target and/or on + your development machine. + +choice + prompt "GDB version to use" + depends on EMBTK_HAVE_GDB_SYSTEM + help + Choose which version of gdb to use. + + config EMBTK_GDB_VERSION_7_2 + bool "gdb-7.2" + select EMBTK_GDB_NEED_PATCH + config EMBTK_GDB_VERSION_6_8 + bool "gdb-6.8" +endchoice + +choice + prompt "GDB on your target embedded system" + depends on EMBTK_HAVE_ROOTFS + depends on EMBTK_HAVE_GDB_SYSTEM + config EMBTK_HAVE_GDBSERVER + bool "Have gdbserver on target" + select EMBTK_HAVE_NCURSES + select KEMBTK_UCLIBC_PTHREADS_DEBUG_SUPPORT if EMBTK_CLIB_UCLIBC + help + Say yes if you want to have only gdbserver on your + embedded system target. + + config EMBTK_HAVE_GDB + bool "Have gdb on target" + select EMBTK_HAVE_NCURSES + select KEMBTK_UCLIBC_PTHREADS_DEBUG_SUPPORT if EMBTK_CLIB_UCLIBC + help + Say yes if you want to have full gdb on your embedded + system target. +endchoice + +config EMBTK_HOST_HAVE_GDB + bool "Have gdb on host your development machine" + depends on EMBTK_HAVE_GDB_SYSTEM + help + Say yes if you want to have gdb on your host development + machine. + + +config EMBTK_GDB_VERSION_STRING + string + default "7.2" if EMBTK_GDB_VERSION_7_2 + default "6.8" if EMBTK_GDB_VERSION_6_8 + +config EMBTK_GDB_NEED_PATCH + bool + select EMBTK_GDB_HOST_NEED_PATCH +config EMBTK_GDB_NEED_AUTORECONF + bool + select EMBTK_GDB_HOST_NEED_AUTORECONF +config EMBTK_GDB_PKG_IS_TARGZ + bool + select EMBTK_GDB_HOST_PKG_IS_TARGZ +config EMBTK_GDB_PKG_IS_TARBZ2 + bool + select EMBTK_GDB_HOST_PKG_IS_TARBZ2 + +config EMBTK_GDB_HOST_NEED_PATCH + bool +config EMBTK_GDB_HOST_NEED_AUTORECONF + bool +config EMBTK_GDB_HOST_PKG_IS_TARGZ + bool +config EMBTK_GDB_HOST_PKG_IS_TARBZ2 + bool diff --git a/packages/development/gdb/gdb.mk b/packages/development/gdb/gdb.mk new file mode 100644 index 0000000..1fae170 --- /dev/null +++ b/packages/development/gdb/gdb.mk @@ -0,0 +1,123 @@ +################################################################################ +# Embtoolkit +# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +################################################################################ +# +# \file gdb.mk +# \brief gdb.mk of Embtoolkit +# \author Abdoulaye Walsimou GAYE +# \date July 2009 +################################################################################ + +GDB_NAME := gdb +GDB_VERSION := $(call EMBTK_GET_PKG_VERSION,GDB) +GDB_SITE := http://ftp.gnu.org/gnu/gdb +GDB_SITE_MIRROR3 := ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror +GDB_PATCH_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/gdb/$(GDB_VERSION) +GDB_PACKAGE := gdb-$(GDB_VERSION).tar.bz2 +GDB_SRC_DIR := $(PACKAGES_BUILD)/gdb-$(GDB_VERSION) +GDB_BUILD_DIR := $(PACKAGES_BUILD)/gdb-$(GDB_VERSION) + +# GDB installed files +GDBSERVER_BIN := $(if $(CONFIG_EMBTK_HAVE_GDBSERVER),,gdbserver) +GDB_BINS := gdb $(GDBSERVER_BIN) gdbtui run +GDB_SBINS := +GDB_INCLUDES := $(if $(CONFIG_EMBTK_HAVE_GDBSERVER), \ + ,,ansidecl.h bfd.h bfdlink.h dis-asm.h symcat.h) +GDB_LIBS := $(if $(CONFIG_EMBTK_HAVE_GDBSERVER), \ + ,,lib*-sim.a libbfd.* libiberty.* libopcodes.*) +GDB_LIBEXECS := +GDB_PKGCONFIGS := + +GDB_CONFIGURE_ENV := +GDB_CONFIGURE_OPTS := --disable-werror --disable-sim \ + --with-bugurl="$(EMBTK_BUGURL)" \ + --with-pkgversion="embtk-$(EMBTK_VERSION)" + +GDB_DEPS := ncurses_install + +# +# GDB for target +# +gdbfull_install: + $(call EMBTK_INSTALL_PKG,GDB) + +gdbserver_install: + @test -e $(GDB_BUILD_DIR)/.gdbserver_installed || \ + $(MAKE) $(GDB_BUILD_DIR)/.gdbserver_installed + +$(GDB_BUILD_DIR)/.gdbserver_installed: $(GDB_DEPS) \ + download_gdb \ + $(GDB_BUILD_DIR)/.gdbserver_decompressed \ + $(GDB_BUILD_DIR)/.gdbserver_configured + $(Q)$(MAKE) -C $(GDB_BUILD_DIR) $(J) + $(Q)$(MAKE) -C $(GDB_BUILD_DIR)/gdb/gdbserver \ + DESTDIR=$(SYSROOT)/$(GDB_SYSROOT_SUFFIX) install + $(Q)$(MAKE) libtool_files_adapt + @touch $@ + +$(GDB_BUILD_DIR)/.gdbserver_configured: + $(call EMBTK_CONFIGURE_PKG,GDB) + @touch $@ + +$(GDB_BUILD_DIR)/.gdbserver_decompressed: + $(call EMBTK_DECOMPRESS_PKG,GDB) + @touch $@ + +gdbserver_clean gdbfull_clean: + $(call EMBTK_CLEANUP_PKG,GDB) + +# +# GDB for host development machine +# +GDB_HOST_NAME := gdb +GDB_HOST_VERSION := $(GDB_VERSION) +GDB_HOST_SITE := $(GDB_SITE) +GDB_HOST_SITE_MIRROR3 := $(GDB_SITE_MIRROR3) +GDB_HOST_PATCH_SITE := $(GDB_PATCH_SITE) +GDB_HOST_PACKAGE := $(GDB_PACKAGE) +GDB_HOST_SRC_DIR := $(TOOLS_BUILD)/gdb-$(GDB_VERSION) +GDB_HOST_BUILD_DIR := $(TOOLS_BUILD)/gdb-$(GDB_VERSION) + +GDB_HOST_CONFIGURE_ENV := CC=$(HOSTCC_CACHED) +GDB_HOST_CONFIGURE_ENV += CXX=$(HOSTCXX_CACHED) +GDB_HOST_CONFIGURE_ENV += CC_FOR_TARGET=$(TARGETCC_CACHED) +GDB_HOST_CONFIGURE_ENV += CXX_FOR_TARGET=$(TARGETCXX_CACHED) +GDB_HOST_CONFIGURE_ENV += AR_FOR_TARGET=$(TARGETAR) +GDB_HOST_CONFIGURE_ENV += LD_FOR_TARGET=$(TARGETLD) +GDB_HOST_CONFIGURE_ENV += NM_FOR_TARGET=$(TARGETNM) +GDB_HOST_CONFIGURE_ENV += RANLIB_FOR_TARGET=$(TARGETRANLIB) +GDB_HOST_CONFIGURE_ENV += STRIP_FOR_TARGET=$(TARGETSTRIP) +GDB_HOST_CONFIGURE_ENV += OBJDUMP_FOR_TARGET=$(TARGETOBJDUMP) + +GDB_HOST_CONFIGURE_OPTS := --disable-werror --disable-sim \ + --with-bugurl="$(EMBTK_BUGURL)" \ + --with-pkgversion="embtk-$(EMBTK_VERSION)" \ + --target=$(STRICT_GNU_TARGET) +GDB_HOST_PREFIX := $(TOOLS) + +gdb_host_install: + $(call EMBTK_INSTALL_HOSTPKG,GDB_HOST) + +gdb_host_clean: + $(call EMBTK_GENERIC_MSG,"Clean up gdb host") + +# +# Common for target and host development machine +# +download_gdb: + $(call EMBTK_DOWNLOAD_PKG,GDB) -- cgit v1.2.3