From 7fcea9d89e5e640155fed001fe40e6eb58ddcb61 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sun, 3 May 2026 16:49:05 +0200 Subject: [PATCH] package/gdb: link with libatomic if needed Fixes: gdb-14.2: https://autobuild.buildroot.net/results/32f/32f5715285ca46370df2ab35c38d16dbdbde5d21/ gdb-15.2: https://autobuild.buildroot.net/results/386/38645389cc5fdb1d5fdfa5d6f6eef417a975ea41/ Support for gdb 14.x was added to buildroot with commit a9a56ab6fd98125ca09078bdeb7c8d55d53aa35e so a backport to LTS branches should be considered. Signed-off-by: Bernd Kuhls Signed-off-by: Arnout Vandecappelle (cherry picked from commit 10d428f9c36204ab2262ac6c34ac227fb9f377a5) Signed-off-by: Thomas Perale --- package/gdb/gdb.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index b39b103d00..4a00a29ef7 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -116,6 +116,14 @@ GDB_MAKE_ENV += \ GDB_CONF_ENV += gdb_cv_prfpregset_t_broken=no GDB_MAKE_ENV += gdb_cv_prfpregset_t_broken=no +GDB_LDFLAGS = $(TARGET_LDFLAGS) +# Uses __atomic_compare_exchange_1 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +GDB_LDFLAGS += -latomic +endif +GDB_CONF_ENV += \ + LDFLAGS="$(GDB_LDFLAGS)" + # We want the built-in libraries of gdb (libbfd, libopcodes) to be # built and linked statically, as we do not install them on the # target, to not clash with the ones potentially installed by