From c2618a3018aa5a4d85c613dece3d76c51a3ab6ab Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 24 Aug 2026 23:33:13 +0200 Subject: [PATCH] package/gdb: handle lzma option for host-gdb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Peter Korsgaard (cherry picked from commit c3adba81d1dc20b2d030bfad45ae6e440947e117) Signed-off-by: Raphaël Mélotte --- package/gdb/Config.in.host | 5 +++++ package/gdb/gdb.mk | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host index d1aa2afcd7..7be53d9d2e 100644 --- a/package/gdb/Config.in.host +++ b/package/gdb/Config.in.host @@ -39,6 +39,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_15 diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 425619165e..2c7c61a238 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -286,6 +286,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.