package/gdb: handle lzma option for host-gdb

For target gdb, we properly enable/disable lzma support depending on
BR2_PACKAGE_XZ.

However, for host-gdb we don't do anything, which can lead the gdb
configure script to detect and use a system-provided xz library, which
is not desired.

Instead, add an explicit option BR2_PACKAGE_HOST_GDB_LZMA, which when
enabled pulls in host-xz, but also when disabled ensures gdb doesn't
try to use a system-provided xz library.

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:13 +02:00
committed by Peter Korsgaard
parent a7072372c6
commit c3adba81d1
2 changed files with 13 additions and 0 deletions

View File

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

View File

@@ -293,6 +293,14 @@ else
HOST_GDB_CONF_OPTS += --disable-sim
endif
ifeq ($(BR2_PACKAGE_HOST_GDB_LZMA),y)
HOST_GDB_CONF_OPTS += --with-lzma
HOST_GDB_CONF_OPTS += --with-liblzma-prefix=$(HOST_DIR)
HOST_GDB_DEPENDENCIES += host-xz
else
HOST_GDB_CONF_OPTS += --without-lzma
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.