Browse Source

package/gdb: zlib is mandatory, not optional

zlib is a mandatory dependency of gdb and by default, gdb will use its
internal one. Moreover, --with-zlib has been replaced by
--with-system-zlib since version 7.10 and
https://github.com/bminor/binutils-gdb/commit/fa1f5da0b6ff3622f9bf60e348e149b76920abba

Fixes:
 - https://bugs.buildroot.org/show_bug.cgi?id=15131

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 3341ceb1e58536cf43a4c000e4bb3cdbff3f6de5)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Fabrice Fontaine 2 years ago
parent
commit
25ab5d22e6
2 changed files with 5 additions and 8 deletions
  1. 1 0
      package/gdb/Config.in
  2. 4 8
      package/gdb/gdb.mk

+ 1 - 0
package/gdb/Config.in

@@ -19,6 +19,7 @@ config BR2_PACKAGE_GDB
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_INSTALL_LIBSTDCPP
 	# no gdbserver on or1k
 	# no gdbserver on or1k
 	select BR2_PACKAGE_GDB_DEBUGGER if BR2_or1k
 	select BR2_PACKAGE_GDB_DEBUGGER if BR2_or1k
+	select BR2_PACKAGE_ZLIB
 	# When the external toolchain gdbserver is copied to the
 	# When the external toolchain gdbserver is copied to the
 	# target, we don't allow building a separate gdbserver. The
 	# target, we don't allow building a separate gdbserver. The
 	# one from the external toolchain should be used.
 	# one from the external toolchain should be used.

+ 4 - 8
package/gdb/gdb.mk

@@ -41,7 +41,8 @@ endif
 # also need ncurses.
 # also need ncurses.
 # As for libiberty, gdb may use a system-installed one if present, so
 # As for libiberty, gdb may use a system-installed one if present, so
 # we must ensure ours is installed first.
 # we must ensure ours is installed first.
-HOST_GDB_DEPENDENCIES = host-expat host-libiberty host-ncurses
+GDB_DEPENDENCIES = zlib
+HOST_GDB_DEPENDENCIES = host-expat host-libiberty host-ncurses host-zlib
 
 
 # Disable building documentation
 # Disable building documentation
 GDB_MAKE_OPTS += MAKEINFO=true
 GDB_MAKE_OPTS += MAKEINFO=true
@@ -139,6 +140,7 @@ GDB_CONF_OPTS = \
 	--disable-sim \
 	--disable-sim \
 	$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
 	$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
 	--without-included-gettext \
 	--without-included-gettext \
+	--with-system-zlib \
 	--disable-werror \
 	--disable-werror \
 	--enable-static \
 	--enable-static \
 	--without-mpfr
 	--without-mpfr
@@ -222,13 +224,6 @@ else
 GDB_CONF_OPTS += --without-lzma
 GDB_CONF_OPTS += --without-lzma
 endif
 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),)
 ifeq ($(BR2_PACKAGE_GDB_PYTHON),)
 # This removes some unneeded Python scripts and XML target description
 # This removes some unneeded Python scripts and XML target description
 # files that are not useful for a normal usage of the debugger.
 # files that are not useful for a normal usage of the debugger.
@@ -266,6 +261,7 @@ HOST_GDB_CONF_OPTS = \
 	--enable-threads \
 	--enable-threads \
 	--disable-werror \
 	--disable-werror \
 	--without-included-gettext \
 	--without-included-gettext \
+	--with-system-zlib \
 	--with-curses \
 	--with-curses \
 	--without-mpfr \
 	--without-mpfr \
 	$(GDB_DISABLE_BINUTILS_CONF_OPTS)
 	$(GDB_DISABLE_BINUTILS_CONF_OPTS)