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
a9a56ab6fd so a backport to LTS branches
should be considered.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit 10d428f9c3)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
Bernd Kuhls
2026-05-03 16:49:05 +02:00
committed by Thomas Perale
parent 1748c12fbd
commit 7fcea9d89e

View File

@@ -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