kumquat-buildroot/package/gdb/gdb.mk

328 lines
10 KiB
Makefile
Raw Normal View History

################################################################################
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
#
# gdb
#
################################################################################
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION))
.mk files: bulk aligment and whitespace cleanup of assignments The Buildroot coding style defines one space around make assignments and does not align the assignment symbols. This patch does a bulk fix of offending packages. The package infrastructures (or more in general assignments to calculated variable names, like $(2)_FOO) are not touched. Alignment of line continuation characters (\) is kept as-is. The sed command used to do this replacement is: find * -name "*.mk" | xargs sed -i \ -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#' Brief explanation of this command: ^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line \([?:+]\?=\) any assignment character =, :=, ?=, += \([^\\]\+\) any string not containing a line continuation \([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a line continuation character \(\s*\\\) optional whitespace, followed by a line continuation character Hence, the first subexpression handles empty assignments, the second handles regular assignments, the third handles regular assignments with line continuation, and the fourth empty assignments with line continuation. This expression was tested on following test text: (initial tab not included) FOO = spaces before FOO = spaces before and after FOO = tab before FOO = tab and spaces before FOO = tab after FOO = tab and spaces after FOO = spaces and tab after FOO = \ FOO = bar \ FOO = bar space \ FOO = \ GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse FOO += spaces before FOO ?= spaces before and after FOO := FOO = FOO = FOO = FOO = $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C AT91BOOTSTRAP3_DEFCONFIG = \ AXEL_DISABLE_I18N=--i18n=0 After this bulk change, following manual fixups were done: - fix line continuation alignment in cegui06 and spice (the sed expression leaves the number of whitespace between the value and line continuation character intact, but the whitespace before that could have changed, causing misalignment. - qt5base was reverted, as this package uses extensive alignment which actually makes the code more readable. Finally, the end result was manually reviewed. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Cc: Yann E. Morin <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
GDB_SITE = $(BR2_GNU_MIRROR)/gdb
GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
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
endif
ifeq ($(BR2_csky),y)
GDB_SITE = $(call github,c-sky,binutils-gdb,$(GDB_VERSION))
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
GDB_FROM_GIT = y
endif
GDB_LICENSE = GPL-2.0+, LGPL-2.0+, GPL-3.0+, LGPL-3.0+
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
GDB_CPE_ID_VENDOR = gnu
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
package/gdb: fix build of gdbserver-only on the ARC gdb version The GDB version used on ARC is based on a recent gdb code base, post gdb 9.2. This recent gdb code base, which pre-figures what will be in gdb 10, has a significant change: gdbserver is not longer in gdb/gdbserver, but at the top-level, and the mechanism to build gdbserver only has changed. Due to this change, a build of ARC GDB for gdbserver only fails with: /bin/bash: line 0: cd: /opt/output/build/gdb-arc-2020.03-release-gdb/gdb/gdbserver: No such file or directory This commit adjusts gdb.mk to support four cases: - "old" gdb, gdbserver only - "old" gdb, with the gdb debugger (and optionally gdbserver as well) - "new" gdb, gdbserver only - "new" gdb, with the gdb debugger (and optionally gdbserver as well) A boolean GDB_GDBSERVER_TOPLEVEL is introduced to differentiate between the old and new gdb, it is set to "y" for gdb versions that have the gdbserver code at the top-level. For now, only the ARC version sets it, but in the future, upstream gdb version 10 will also have to set it. Here is the behavior, for each case: (1) "old" gdb, gdbserver only We set GDB_SUBDIR to gdb/gdbserver, so only the configure script in this folder gets called. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (2) "old" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. (3) "new" gdb, gdbserver only We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (4) "new" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. In addition to these changes, some related changes are done as well: - We re-enable building both gdb and gdbserver on ARC, as it works again. - We only pass --with-curses when curses is really provided, i.e when the full debugger is being built. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Tested-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-28 22:11:26 +02:00
# On gdb < 10, if you want to build only gdbserver, you need to
# configure only gdb/gdbserver.
ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(BR2_PACKAGE_GDB_TOPLEVEL),)
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
GDB_SUBDIR = gdb/gdbserver
package/gdb: fix build of gdbserver-only on the ARC gdb version The GDB version used on ARC is based on a recent gdb code base, post gdb 9.2. This recent gdb code base, which pre-figures what will be in gdb 10, has a significant change: gdbserver is not longer in gdb/gdbserver, but at the top-level, and the mechanism to build gdbserver only has changed. Due to this change, a build of ARC GDB for gdbserver only fails with: /bin/bash: line 0: cd: /opt/output/build/gdb-arc-2020.03-release-gdb/gdb/gdbserver: No such file or directory This commit adjusts gdb.mk to support four cases: - "old" gdb, gdbserver only - "old" gdb, with the gdb debugger (and optionally gdbserver as well) - "new" gdb, gdbserver only - "new" gdb, with the gdb debugger (and optionally gdbserver as well) A boolean GDB_GDBSERVER_TOPLEVEL is introduced to differentiate between the old and new gdb, it is set to "y" for gdb versions that have the gdbserver code at the top-level. For now, only the ARC version sets it, but in the future, upstream gdb version 10 will also have to set it. Here is the behavior, for each case: (1) "old" gdb, gdbserver only We set GDB_SUBDIR to gdb/gdbserver, so only the configure script in this folder gets called. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (2) "old" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. (3) "new" gdb, gdbserver only We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (4) "new" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. In addition to these changes, some related changes are done as well: - We re-enable building both gdb and gdbserver on ARC, as it works again. - We only pass --with-curses when curses is really provided, i.e when the full debugger is being built. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Tested-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-28 22:11:26 +02:00
# 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.
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
else
GDB_SUBDIR = build
define GDB_CONFIGURE_SYMLINK
mkdir -p $(@D)/$(GDB_SUBDIR)
ln -sf ../configure $(@D)/$(GDB_SUBDIR)/configure
endef
GDB_PRE_CONFIGURE_HOOKS += GDB_CONFIGURE_SYMLINK
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
endif
# For the host variant, we really want to build with XML support,
# which is needed to read XML descriptions of target architectures. We
# 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: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
# Disable building documentation
GDB_MAKE_OPTS += MAKEINFO=true
GDB_INSTALL_TARGET_OPTS += MAKEINFO=true DESTDIR=$(TARGET_DIR) install
HOST_GDB_MAKE_OPTS += MAKEINFO=true
HOST_GDB_INSTALL_OPTS += MAKEINFO=true install
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
# Apply the Xtensa specific patches
ifneq ($(ARCH_XTENSA_OVERLAY_FILE),)
define GDB_XTENSA_OVERLAY_EXTRACT
$(call arch-xtensa-overlay-extract,$(@D),gdb)
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
endef
GDB_POST_EXTRACT_HOOKS += GDB_XTENSA_OVERLAY_EXTRACT
GDB_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
HOST_GDB_POST_EXTRACT_HOOKS += GDB_XTENSA_OVERLAY_EXTRACT
HOST_GDB_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
endif
ifeq ($(GDB_FROM_GIT),y)
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 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_DEPENDENCIES += gmp
endif
binutils, gdb: support unified binutils-gdb git repository If Binutils and/or GDB are fetched from the unified binutils-gdb repository, then the tarball will contain both Binutils and GDB sources, unlike the "normal" tarballs that contain only the titular package. To keep packages separated in Buildroot we need to disable undesired components when configuring. Binutils and GDB migrated to a common Git repository in the October 2013 [1]. Previous Git repositories were incomplete copies of CVS repository which copied only the relevant files (no binutils files in GDB, and vice versa). In the new binutils-gdb repository there is no such separation and a result all files exist in directory after checkout. So if "configure" and "make" are used without explicit targets, all projects will be built: binutils, ld, gas, bfd, opcodes, gdb, etc. In case of Buildroot this would mean that selecting Binutils only, still will build both Binutils and GDB. And if GDB is selected as well, then both packages will be built two times, and Binutils from GDB directory will overwrite initial build of Binutils (or vice versa if Binutils will be built after the GDB). This is a serious problem, because binutils and GDB use separate branches in this common repository. In case of Buildroot this means that separate Git commits (or tags) should be used when downloading source from Git. This affects only Git repositories, because GNU release tarballs still contain only relevant packages. This change is backward compatible, because if "normal" tarball is used (without extra directories), than --disable-* configure options are just ignored by configure. [1] https://sourceware.org/ml/gdb/2013-10/msg00071.html [Thomas: use variables to factorize options, and add comments in the relevant .mk files to explain what's going on.] Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 14:54:37 +02:00
# 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
# prevents the un-wanted installation of libobcodes.so and libbfd.so).
GDB_DISABLE_BINUTILS_CONF_OPTS = \
binutils, gdb: support unified binutils-gdb git repository If Binutils and/or GDB are fetched from the unified binutils-gdb repository, then the tarball will contain both Binutils and GDB sources, unlike the "normal" tarballs that contain only the titular package. To keep packages separated in Buildroot we need to disable undesired components when configuring. Binutils and GDB migrated to a common Git repository in the October 2013 [1]. Previous Git repositories were incomplete copies of CVS repository which copied only the relevant files (no binutils files in GDB, and vice versa). In the new binutils-gdb repository there is no such separation and a result all files exist in directory after checkout. So if "configure" and "make" are used without explicit targets, all projects will be built: binutils, ld, gas, bfd, opcodes, gdb, etc. In case of Buildroot this would mean that selecting Binutils only, still will build both Binutils and GDB. And if GDB is selected as well, then both packages will be built two times, and Binutils from GDB directory will overwrite initial build of Binutils (or vice versa if Binutils will be built after the GDB). This is a serious problem, because binutils and GDB use separate branches in this common repository. In case of Buildroot this means that separate Git commits (or tags) should be used when downloading source from Git. This affects only Git repositories, because GNU release tarballs still contain only relevant packages. This change is backward compatible, because if "normal" tarball is used (without extra directories), than --disable-* configure options are just ignored by configure. [1] https://sourceware.org/ml/gdb/2013-10/msg00071.html [Thomas: use variables to factorize options, and add comments in the relevant .mk files to explain what's going on.] Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 14:54:37 +02:00
--disable-binutils \
--disable-install-libbfd \
binutils, gdb: support unified binutils-gdb git repository If Binutils and/or GDB are fetched from the unified binutils-gdb repository, then the tarball will contain both Binutils and GDB sources, unlike the "normal" tarballs that contain only the titular package. To keep packages separated in Buildroot we need to disable undesired components when configuring. Binutils and GDB migrated to a common Git repository in the October 2013 [1]. Previous Git repositories were incomplete copies of CVS repository which copied only the relevant files (no binutils files in GDB, and vice versa). In the new binutils-gdb repository there is no such separation and a result all files exist in directory after checkout. So if "configure" and "make" are used without explicit targets, all projects will be built: binutils, ld, gas, bfd, opcodes, gdb, etc. In case of Buildroot this would mean that selecting Binutils only, still will build both Binutils and GDB. And if GDB is selected as well, then both packages will be built two times, and Binutils from GDB directory will overwrite initial build of Binutils (or vice versa if Binutils will be built after the GDB). This is a serious problem, because binutils and GDB use separate branches in this common repository. In case of Buildroot this means that separate Git commits (or tags) should be used when downloading source from Git. This affects only Git repositories, because GNU release tarballs still contain only relevant packages. This change is backward compatible, because if "normal" tarball is used (without extra directories), than --disable-* configure options are just ignored by configure. [1] https://sourceware.org/ml/gdb/2013-10/msg00071.html [Thomas: use variables to factorize options, and add comments in the relevant .mk files to explain what's going on.] Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 14:54:37 +02:00
--disable-ld \
--disable-gas \
--disable-gprof
binutils, gdb: support unified binutils-gdb git repository If Binutils and/or GDB are fetched from the unified binutils-gdb repository, then the tarball will contain both Binutils and GDB sources, unlike the "normal" tarballs that contain only the titular package. To keep packages separated in Buildroot we need to disable undesired components when configuring. Binutils and GDB migrated to a common Git repository in the October 2013 [1]. Previous Git repositories were incomplete copies of CVS repository which copied only the relevant files (no binutils files in GDB, and vice versa). In the new binutils-gdb repository there is no such separation and a result all files exist in directory after checkout. So if "configure" and "make" are used without explicit targets, all projects will be built: binutils, ld, gas, bfd, opcodes, gdb, etc. In case of Buildroot this would mean that selecting Binutils only, still will build both Binutils and GDB. And if GDB is selected as well, then both packages will be built two times, and Binutils from GDB directory will overwrite initial build of Binutils (or vice versa if Binutils will be built after the GDB). This is a serious problem, because binutils and GDB use separate branches in this common repository. In case of Buildroot this means that separate Git commits (or tags) should be used when downloading source from Git. This affects only Git repositories, because GNU release tarballs still contain only relevant packages. This change is backward compatible, because if "normal" tarball is used (without extra directories), than --disable-* configure options are just ignored by configure. [1] https://sourceware.org/ml/gdb/2013-10/msg00071.html [Thomas: use variables to factorize options, and add comments in the relevant .mk files to explain what's going on.] Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 14:54:37 +02:00
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
GDB_CONF_ENV = \
ac_cv_type_uintptr_t=yes \
gt_cv_func_gettext_libintl=yes \
ac_cv_func_dcgettext=yes \
gdb_cv_func_sigsetjmp=yes \
bash_cv_func_strcoll_broken=no \
bash_cv_must_reinstall_sighandlers=no \
bash_cv_func_sigsetjmp=present \
bash_cv_have_mbstate_t=yes \
gdb_cv_func_sigsetjmp=yes
# Starting with gdb 7.11, the bundled gnulib tries to use
# rpl_gettimeofday (gettimeofday replacement) due to the code being
# unable to determine if the replacement function should be used or
# not when cross-compiling with uClibc or musl as C libraries. So use
# gl_cv_func_gettimeofday_clobber=no to not use rpl_gettimeofday,
# assuming musl and uClibc have a properly working gettimeofday
# implementation. It needs to be passed to GDB_CONF_ENV to build
# gdbserver only but also to GDB_MAKE_ENV, because otherwise it does
# not get passed to the configure script of nested packages while
# building gdbserver with full debugger.
GDB_CONF_ENV += gl_cv_func_gettimeofday_clobber=no
GDB_MAKE_ENV += gl_cv_func_gettimeofday_clobber=no
# Similarly, starting with gdb 8.1, the bundled gnulib tries to use
# rpl_strerror. Let's tell gnulib the C library implementation works
# well enough.
GDB_CONF_ENV += \
gl_cv_func_working_strerror=yes \
gl_cv_func_strerror_0_works=yes
GDB_MAKE_ENV += \
gl_cv_func_working_strerror=yes \
gl_cv_func_strerror_0_works=yes
# Starting with glibc 2.25, the proc_service.h header has been copied
# from gdb to glibc so other tools can use it. However, that makes it
# necessary to make sure that declaration of prfpregset_t declaration
# is consistent between gdb and glibc. In gdb, however, there is a
# workaround for a broken prfpregset_t declaration in glibc 2.3 which
# uses AC_TRY_RUN to detect if it's needed, which doesn't work in
# cross-compilation. So pass the cache option to configure.
# It needs to be passed to GDB_CONF_ENV to build gdbserver only but
# also to GDB_MAKE_ENV, because otherwise it does not get passed to the
# configure script of nested packages while building gdbserver with full
# debugger.
GDB_CONF_ENV += gdb_cv_prfpregset_t_broken=no
GDB_MAKE_ENV += gdb_cv_prfpregset_t_broken=no
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
# The shared only build is not supported by gdb, so enable static build for
# build-in libraries with --enable-static.
GDB_CONF_OPTS = \
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
--without-uiout \
--disable-gdbtk \
--without-x \
--disable-sim \
$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
--without-included-gettext \
--disable-werror \
--enable-static \
--without-mpfr
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
package/gdb: fix build of gdbserver-only on the ARC gdb version The GDB version used on ARC is based on a recent gdb code base, post gdb 9.2. This recent gdb code base, which pre-figures what will be in gdb 10, has a significant change: gdbserver is not longer in gdb/gdbserver, but at the top-level, and the mechanism to build gdbserver only has changed. Due to this change, a build of ARC GDB for gdbserver only fails with: /bin/bash: line 0: cd: /opt/output/build/gdb-arc-2020.03-release-gdb/gdb/gdbserver: No such file or directory This commit adjusts gdb.mk to support four cases: - "old" gdb, gdbserver only - "old" gdb, with the gdb debugger (and optionally gdbserver as well) - "new" gdb, gdbserver only - "new" gdb, with the gdb debugger (and optionally gdbserver as well) A boolean GDB_GDBSERVER_TOPLEVEL is introduced to differentiate between the old and new gdb, it is set to "y" for gdb versions that have the gdbserver code at the top-level. For now, only the ARC version sets it, but in the future, upstream gdb version 10 will also have to set it. Here is the behavior, for each case: (1) "old" gdb, gdbserver only We set GDB_SUBDIR to gdb/gdbserver, so only the configure script in this folder gets called. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (2) "old" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. (3) "new" gdb, gdbserver only We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (4) "new" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. In addition to these changes, some related changes are done as well: - We re-enable building both gdb and gdbserver on ARC, as it works again. - We only pass --with-curses when curses is really provided, i.e when the full debugger is being built. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Tested-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-28 22:11:26 +02:00
ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y)
GDB_CONF_OPTS += \
--enable-gdb \
--with-curses
GDB_DEPENDENCIES += ncurses \
package/gdb: fix build of gdbserver-only on the ARC gdb version The GDB version used on ARC is based on a recent gdb code base, post gdb 9.2. This recent gdb code base, which pre-figures what will be in gdb 10, has a significant change: gdbserver is not longer in gdb/gdbserver, but at the top-level, and the mechanism to build gdbserver only has changed. Due to this change, a build of ARC GDB for gdbserver only fails with: /bin/bash: line 0: cd: /opt/output/build/gdb-arc-2020.03-release-gdb/gdb/gdbserver: No such file or directory This commit adjusts gdb.mk to support four cases: - "old" gdb, gdbserver only - "old" gdb, with the gdb debugger (and optionally gdbserver as well) - "new" gdb, gdbserver only - "new" gdb, with the gdb debugger (and optionally gdbserver as well) A boolean GDB_GDBSERVER_TOPLEVEL is introduced to differentiate between the old and new gdb, it is set to "y" for gdb versions that have the gdbserver code at the top-level. For now, only the ARC version sets it, but in the future, upstream gdb version 10 will also have to set it. Here is the behavior, for each case: (1) "old" gdb, gdbserver only We set GDB_SUBDIR to gdb/gdbserver, so only the configure script in this folder gets called. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (2) "old" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. (3) "new" gdb, gdbserver only We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdbserver --disable-gdb are passed in CONF_OPTS. (4) "new" gdb, with the gdb debugger (and optionally gdbserver as well) We set GDB_SUBDIR to build/, an empty directory which allows to do an out of tree build, which is mandatory for a full gdb build since gdb 9.x. --enable-gdb is passed in CONF_OPTS as well as --enable-gdbserver or --disable-gdbserver depending on whether gdbserver is enabled as well. In addition to these changes, some related changes are done as well: - We re-enable building both gdb and gdbserver on ARC, as it works again. - We only pass --with-curses when curses is really provided, i.e when the full debugger is being built. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Tested-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-09-28 22:11:26 +02:00
$(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.
ifeq ($(BR2_arc),y)
GDB_CONF_OPTS += --disable-build-with-cxx
endif
# gdb 7.12+ by default builds with a C++ compiler, which doesn't work
# when we don't have C++ support in the toolchain
ifneq ($(BR2_INSTALL_LIBSTDCPP),y)
GDB_CONF_OPTS += --disable-build-with-cxx
endif
# inprocess-agent can't be built statically
ifeq ($(BR2_STATIC_LIBS),y)
GDB_CONF_OPTS += --disable-inprocess-agent
endif
ifeq ($(BR2_PACKAGE_GDB_TUI),y)
GDB_CONF_OPTS += --enable-tui
else
GDB_CONF_OPTS += --disable-tui
endif
ifeq ($(BR2_PACKAGE_GDB_PYTHON),y)
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
ifeq ($(BR2_PACKAGE_EXPAT),y)
GDB_CONF_OPTS += --with-expat
GDB_CONF_OPTS += --with-libexpat-prefix=$(STAGING_DIR)/usr
GDB_DEPENDENCIES += expat
else
GDB_CONF_OPTS += --without-expat
endif
ifeq ($(BR2_PACKAGE_XZ),y)
GDB_CONF_OPTS += --with-lzma
GDB_CONF_OPTS += --with-liblzma-prefix=$(STAGING_DIR)/usr
GDB_DEPENDENCIES += xz
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),)
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
# This removes some unneeded Python scripts and XML target description
# files that are not useful for a normal usage of the debugger.
define GDB_REMOVE_UNNEEDED_FILES
$(RM) -rf $(TARGET_DIR)/usr/share/gdb
endef
GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
endif
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
# This installs the gdbserver somewhere into the $(HOST_DIR) so that
# it becomes an integral part of the SDK, if the toolchain generated
# by Buildroot is later used as an external toolchain. We install it
# in debug-root/usr/bin/gdbserver so that it matches what Crosstool-NG
# does.
define GDB_SDK_INSTALL_GDBSERVER
$(INSTALL) -D -m 0755 $(TARGET_DIR)/usr/bin/gdbserver \
$(HOST_DIR)/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
endef
ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
GDB_POST_INSTALL_TARGET_HOOKS += GDB_SDK_INSTALL_GDBSERVER
endif
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
# A few notes:
# * --target, because we're doing a cross build rather than a real
# host build.
# * --enable-static because gdb really wants to use libbfd.a
HOST_GDB_CONF_OPTS = \
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
--target=$(GNU_TARGET_NAME) \
--enable-static \
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
--without-uiout \
--disable-gdbtk \
--without-x \
--enable-threads \
--disable-werror \
--without-included-gettext \
--with-curses \
--without-mpfr \
$(GDB_DISABLE_BINUTILS_CONF_OPTS)
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
ifeq ($(BR2_PACKAGE_HOST_GDB_TUI),y)
HOST_GDB_CONF_OPTS += --enable-tui
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)
HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python3
HOST_GDB_DEPENDENCIES += host-python3
else
HOST_GDB_CONF_OPTS += --without-python
endif
ifeq ($(BR2_PACKAGE_HOST_GDB_SIM),y)
HOST_GDB_CONF_OPTS += --enable-sim
else
HOST_GDB_CONF_OPTS += --disable-sim
endif
# 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.
HOST_GDB_SUBDIR = build
define HOST_GDB_CONFIGURE_SYMLINK
mkdir -p $(@D)/build
ln -sf ../configure $(@D)/build/configure
endef
HOST_GDB_PRE_CONFIGURE_HOOKS += HOST_GDB_CONFIGURE_SYMLINK
# legacy $arch-linux-gdb symlink
define HOST_GDB_ADD_SYMLINK
cd $(HOST_DIR)/bin && \
ln -snf $(GNU_TARGET_NAME)-gdb $(ARCH)-linux-gdb
endef
HOST_GDB_POST_INSTALL_HOOKS += HOST_GDB_ADD_SYMLINK
HOST_GDB_POST_INSTALL_HOOKS += gen_gdbinit_file
gdb: convert to the package infrastructure This commit converts gdb to the package infrastructure, and therefore moves it from toolchain/gdb to package/gdb. The target package is now visible in "Package selection for the target" => "Debugging, profiling and benchmark". The main option, "gdb", forcefully selects the "gdbserver" sub-option by default. Another sub-option, "full debugger" allows to install the complete gdb on the target. When this option is enabled, then "gdbserver" is no longer forcefully selected. This ensures that at least gdbserver or the full debugger gets built/installed, so that the package is not a no-op. The host debugger is still enabled through a configuration option in "Toolchain". It is now visible regardless of the toolchain type (it used to be hidden for External Toolchains). The configuration options relative to the host debugger are now in package/gdb/Config.in.host, similar to how we have package/binutils/Config.in.host. Since gdb is now a proper package, it is no longer allowed to 'select BR2_PTHREADS_DEBUG' to ensure thread debugging is available when needed. Instead, it now 'depends on BR2_TOOLCHAIN_HAS_THREADS_DEBUG'. This option, in turn, is selected by the different toolchain backends when appropriate. The 'BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED' option is removed, since we no longer need to know when it is allowed to 'select BR2_PTHREADS_DEBUG'. Also, the 'BR2_PTHREADS_DEBUG' option is moved to appear right below the thread implementation selection (in the case of the Buildroot toolchain backend). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-07 02:04:33 +02:00
$(eval $(autotools-package))
$(eval $(host-autotools-package))