kumquat-buildroot/package/numactl/0001-link-with-latomic-if-needed-again.patch
Fabrice Fontaine a353cf8736 package/numactl: link with -latomic if needed
Fix the following build failure raised since bump to version 2.0.16 in
commit e9bc980d93:

/nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'

Fixes:
 - http://autobuild.buildroot.org/results/a92c1c60518d3fe08f3f808f9cc812031e85a4e9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-11-03 22:12:33 +01:00

42 lines
1.6 KiB
Diff

From 692abb6d751a41c7f0206771ecd454933750256e Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Wed, 2 Nov 2022 13:28:02 +0100
Subject: [PATCH] link with -latomic if needed (again ...)
numactl unconditionally uses __atomic_fetch_and but some architectures
(e.g. sparc) needs to link with -latomic to be able to use it. So check
if -latomic is needed and update numa.pc accordingly.
This linking was made by e0de0d9e981ddb53bdeb4a4b9dc43046c9ff4ff9 but
wrongly reverted by 10c277c20768be9a563f75265bcd7e73954763ad resulting
in the following build failure on sparc or microblaze:
/nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'
Fixes:
- http://autobuild.buildroot.org/results/54b7567d804d9abff56f47cd26bae774c1e38669
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/numactl/numactl/pull/144]
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index 8510fc5..ebf9917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,8 @@ AM_CONDITIONAL([RISCV64], [test x"${target_cpu}" = x"riscv64"])
AC_CONFIG_FILES([Makefile])
+AC_SEARCH_LIBS([__atomic_fetch_and_1], [atomic])
+
# GCC tries to be "helpful" and only issue a warning for unrecognized
# attributes. So we compile the test with Werror, so that if the
# attribute is not recognized the compilation fails
--
2.35.1