package/gdb: handle xxhash optional dependency

Since gdb 9.x, gdb can optionally use the xxhash library. Since we
currently don't do anything about it, it's a potential "silent"
dependency.

In particular, for host-gdb, this means host-gdb might end up being
linked with the system-provided xxhash library if available.

This patch handles this dependency:

- For the target package, by looking at the value of
  BR2_PACKAGE_XXHASH

- For the host package, by looking at the value of a newly introduced
  BR2_PACKAGE_HOST_GDB_XXHASH

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Thomas Petazzoni
2026-08-24 23:33:14 +02:00
committed by Peter Korsgaard
parent c3adba81d1
commit 9dc567aa78
2 changed files with 21 additions and 0 deletions

View File

@@ -49,6 +49,11 @@ config BR2_PACKAGE_HOST_GDB_LZMA
help
This option enables lzma support in the cross gdb.
config BR2_PACKAGE_HOST_GDB_XXHASH
bool "xxhash support"
help
This option enables xxhash support in the cross gdb.
choice
prompt "GDB debugger Version"
default BR2_GDB_VERSION_16

View File

@@ -217,6 +217,14 @@ else
GDB_CONF_OPTS += --without-expat
endif
ifeq ($(BR2_PACKAGE_XXHASH),y)
GDB_CONF_OPTS += --with-xxhash
GDB_CONF_OPTS += --with-xxhash-prefix=$(STAGING_DIR)/usr
GDB_DEPENDENCIES += xxhash
else
GDB_CONF_OPTS += --without-xxhash
endif
ifeq ($(BR2_PACKAGE_XZ),y)
GDB_CONF_OPTS += --with-lzma
GDB_CONF_OPTS += --with-liblzma-prefix=$(STAGING_DIR)/usr
@@ -301,6 +309,14 @@ else
HOST_GDB_CONF_OPTS += --without-lzma
endif
ifeq ($(BR2_PACKAGE_HOST_GDB_XXHASH),y)
HOST_GDB_CONF_OPTS += --with-xxhash
HOST_GDB_CONF_OPTS += --with-xxhash-prefix=$(HOST_DIR)
HOST_GDB_DEPENDENCIES += host-xxhash
else
HOST_GDB_CONF_OPTS += --without-xxhash
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.