Skip to contentSkip to conversation

package/gdb: handle lzma option for host-gdb

PATCH Applied Thomas Petazzoni via buildroot 2 participants 6 messages Aug 24 – Sep 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 package/gdb/Config.in.host | 5 +++++
 package/gdb/gdb.mk         | 8 ++++++++
 2 files changed, 13 insertions(+)
package/gdb/Config.in.host +5 -0
index 2e1eed6f50..823c2e9966 100644
@@ -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
package/gdb/gdb.mk +8 -0
index 685d1fe992..ebb80072cf 100644
@@ -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.
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 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

---
 package/gdb/Config.in.host |  5 +++++
 package/gdb/gdb.mk         | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)
package/gdb/Config.in.host +5 -0
index 823c2e9966..61fe32d8ff 100644
@@ -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
package/gdb/gdb.mk +16 -0
index ebb80072cf..cfec0585da 100644
@@ -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.
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] package/gdb: handle xxhash optional dependency

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

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:

Quoted 7 lines

- 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

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH 2/2] package/gdb: handle xxhash optional dependency

In reply to Thomas Petazzoni via buildroot

In reply of:

Quoted 9 lines

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:

Quoted 7 lines

- 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

Applied to 2025.02.x & 2026.05.x. Thanks

Quoted 62 lines
---
 package/gdb/Config.in.host |  5 +++++
 package/gdb/gdb.mk         | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)
package/gdb/Config.in.host +5 -0
index 823c2e9966..61fe32d8ff 100644
@@ -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
package/gdb/gdb.mk +16 -0
index ebb80072cf..cfec0585da 100644
@@ -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.
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

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.

Quoted 5 lines

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.

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
In reply to Thomas Petazzoni via buildroot

In reply of:

Quoted 7 lines

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.

Quoted 5 lines

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.

Applied to 2025.02.x & 2026.05.x. Thanks

Quoted 47 lines
---
 package/gdb/Config.in.host | 5 +++++
 package/gdb/gdb.mk         | 8 ++++++++
 2 files changed, 13 insertions(+)
package/gdb/Config.in.host +5 -0
index 2e1eed6f50..823c2e9966 100644
@@ -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
package/gdb/gdb.mk +8 -0
index 685d1fe992..ebb80072cf 100644
@@ -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.
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot