From c3adba81d1dc20b2d030bfad45ae6e440947e117 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 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 --- 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 2e1eed6f50..823c2e9966 100644 --- a/package/gdb/Config.in.host +++ b/package/gdb/Config.in.host @@ -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 diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 685d1fe992..ebb80072cf 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -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.