gdb: Upgrade 16.3 -> 17.1
PATCH v3 1/1 gdb: Upgrade 16.3 -> 17.1
From: Sunil Dora <[email protected]>
GDB 17.1 includes the following changes and enhancements:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-17.1-release
* x86-64 CET shadow stack support
* Debugging Linux programs that use AArch64 Guarded Control Stacks
* GDB record feature now supports rv64gc architectures
* 'info threads' command support for two new options '-stopped' and '-running' to limit the list of displayed threads.
* On Linux and FreeBSD, the addresses shown by the 'info sharedlibrary' command are now for the full memory range allocated to the shared library.
* Linux checkpoints now work with multiple inferiors
* Improved linker namespace support
* Warnings and error messages now start with an emoji (warning sign, or cross mark) if supported by the host charset. Configurable.
* Built-in support for TLS on Linux as backup when libthread_db is not available. Supported on the x86_64, aarch64, ppc64, s390x, and riscv architectures, when compiled with GLIBC or MUSL.
* New command "set riscv numeric-register-names" to display risc-v registers using their numeric names instead of their ABI names.
* The Alpha target now supports target descriptions.
* Python API enhancements
* Support for Python versions older than 3.4 has been removed.
Dropped 0009-Readline-8.3-alpha-release.patch
Added 0009-PR-gdb-33747-gdb-ser-unix-Avoid-musl-build-failure-w.patch
---
changes in v3:
- Added musl build fix patch (PR gdb/33747)
- musl currently does not expose c_ospeed/c_ispeed or Linux termios2/BOTHER interfaces
- Ref: [https://www.openwall.com/lists/musl/2026/02/12/1]
changes in v2:
- gdb: Upgrade 16.3 -> 17.1
...ian_16.3.bb => gdb-cross-canadian_17.1.bb} | 0
.../{gdb-cross_16.3.bb => gdb-cross_17.1.bb} | 0
meta/recipes-devtools/gdb/gdb.inc | 4 +-
...-ser-unix-Avoid-musl-build-failure-w.patch | 190 ++++++++++++++++++
.../gdb/0009-Readline-8.3-alpha-release.patch | 164 ---------------
.../gdb/{gdb_16.3.bb => gdb_17.1.bb} | 0
6 files changed, 192 insertions(+), 166 deletions(-)
rename meta/recipes-devtools/gdb/{gdb-cross-canadian_16.3.bb => gdb-cross-canadian_17.1.bb} (100%)
rename meta/recipes-devtools/gdb/{gdb-cross_16.3.bb => gdb-cross_17.1.bb} (100%)
create mode 100644 meta/recipes-devtools/gdb/gdb/0009-PR-gdb-33747-gdb-ser-unix-Avoid-musl-build-failure-w.patch
delete mode 100644 meta/recipes-devtools/gdb/gdb/0009-Readline-8.3-alpha-release.patch
rename meta/recipes-devtools/gdb/{gdb_16.3.bb => gdb_17.1.bb} (100%)meta/recipes-devtools/gdb/gdb-cross-canadian_17.1.bb renamed from meta/recipes-devtools/gdb/gdb-cross-canadian_16.3.bb +0 -0
meta/recipes-devtools/gdb/gdb-cross_17.1.bb renamed from meta/recipes-devtools/gdb/gdb-cross_16.3.bb +0 -0
meta/recipes-devtools/gdb/gdb.inc +2 -2
@@ -13,6 +13,6 @@ SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \ file://0006-Fix-invalid-sigprocmask-call.patch \ file://0007-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \ file://0008-Add-fix-for-packages-that-are-not-compatible-with-C2.patch \ - file://0009-Readline-8.3-alpha-release.patch \ + file://0009-PR-gdb-33747-gdb-ser-unix-Avoid-musl-build-failure-w.patch \ " -SRC_URI[sha256sum] = "bcfcd095528a987917acf9fff3f1672181694926cc18d609c99d0042c00224c5" +SRC_URI[sha256sum] = "14996f5f74c9f68f5a543fdc45bca7800207f91f92aeea6c2e791822c7c6d876"
meta/recipes-devtools/gdb/gdb/0009-PR-gdb-33747-gdb-ser-unix-Avoid-musl-build-failure-w.patch new file +190 -0
190 lines not on this page · raw message
meta/recipes-devtools/gdb/gdb/0009-Readline-8.3-alpha-release.patch deleted +0 -164
164 lines not on this page · raw message
meta/recipes-devtools/gdb/gdb_17.1.bb renamed from meta/recipes-devtools/gdb/gdb_16.3.bb +0 -0
Signature · 1 line
2.49.0
Quoted 25 lines · Sunil Kumar via lists.openembedded.org Dora
From: Sunil Dora <[email protected]>
GDB 17.1 includes the following changes and enhancements:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-17.1-release* x86-64 CET shadow stack support
* Debugging Linux programs that use AArch64 Guarded Control Stacks
* GDB record feature now supports rv64gc architectures
* 'info threads' command support for two new options '-stopped' and '-running' to limit the list of displayed threads.
* On Linux and FreeBSD, the addresses shown by the 'info sharedlibrary' command are now for the full memory range allocated to the shared library.
* Linux checkpoints now work with multiple inferiors
* Improved linker namespace support
* Warnings and error messages now start with an emoji (warning sign, or cross mark) if supported by the host charset. Configurable.
* Built-in support for TLS on Linux as backup whenlibthread_dbis not available. Supported on thex86_64, aarch64, ppc64, s390x, and riscv architectures, when compiled with GLIBC or MUSL.
* New command "set riscv numeric-register-names" to display risc-v registers using their numeric names instead of their ABI names.
* The Alpha target now supports target descriptions.
* Python API enhancements
* Support for Python versions older than 3.4 has been removed.
Quoted 6 lines
Dropped 0009-Readline-8.3-alpha-release.patch
Added 0009-PR-gdb-33747-gdb-ser-unix-Avoid-musl-build-failure-w.patchSigned-off-by Sunil Dora <[email protected]>Co-authored-by Sundeep Kokkonda <[email protected]>---
Hi Sunil,
Thanks for the new version.
It looks like we still have a musl issue, but specifically while building for qemuarm64 machine:
ERROR: gdb-17.1-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/gdb/17.1/temp/run.do_compile.2065169' failed with exit code 1
...
| In file included from ../../sources/gdb-17.1/gdbserver/linux-aarch64-low.cc:42:
| ../../sources/gdb-17.1/gdbserver/../gdb/arch/aarch64-gcs-linux.h:35:8: error: redefinition of 'struct user_gcs'
| 35 | struct user_gcs
| | ^~~~~~~~
| In file included from ../../sources/gdb-17.1/gdbserver/linux-aarch64-low.cc:35:
| /srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/gdb/17.1/recipe-sysroot/usr/include/asm/ptrace.h:329:8: note: previous definition of 'struct user_gcs'
| 329 | struct user_gcs {
| | ^~~~~~~~https://autobuilder.yoctoproject.org/valkyrie/#/builders/111/builds/1970
Can you have a look at it?
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 23 lines · Mathieu Dubois-Briand
Hi Sunil,
Thanks for the new version.
It looks like we still have a musl issue, but specifically while building for qemuarm64 machine:
ERROR: gdb-17.1-r0
do_compile: Execution of '/srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/gdb/17.1/temp/run.do_compile.2065169' failed with exit code 1
...
| In file included from
../../sources/gdb-17.1/gdbserver/linux-aarch64-low.cc:42:
|../../sources/gdb-17.1/gdbserver/../gdb/arch/aarch64-gcs-linux.h:35:8:
error: redefinition of 'structuser_gcs'| 35 | struct user_gcs | | ^~~~~~~~ | In file included from../../sources/gdb-17.1/gdbserver/linux-aarch64-low.cc:35:
|/srv/pokybuild/yocto-worker/musl-qemuarm64/build/build/tmp/work/cortexa57-poky-linux-musl/gdb/17.1/recipe-sysroot/usr/include/asm/ptrace.h:329:8:
note: previous definition of 'structuser_gcs'
Quoted 6 lines
| 329 | struct user_gcs { | | ^~~~~~~~https://autobuilder.yoctoproject.org/valkyrie/#/builders/111/builds/1970
Can you have a look at it?
Hi Mathieu,
Thanks for the report.
I’ve checked the failure. It’s another musl-specific issue with the new AArch64 GCS support in GDB 17.1. struct user_gcs is now provided by musl via <asm/ptrace.h> , while GDB still has its own fallback definition in aarch64-gcs-linux.h , which causes the duplicate definition error.
GDB has guards around the fallback definition, but they don’t work correctly with musl’s header layout. This does not happen with glibc due to different header inclusion behavior.
I’m working on a fix and will send an updated patch shortly.
Thanks,
Sunil
Quoted 4 lines
Thanks,
Mathieu
I’ve filed a bug upstream(GDB) to track it:
https://sourceware.org/bugzilla/show_bug.cgi?id=33926
The discussion is ongoing there, and a fix is already being worked on for mainline. I’ll follow up here once we have either an upstream patch or a suitable backport for 17.1.
Thanks,
Sunil