0001-link-with-latomic-if-needed-again.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 692abb6d751a41c7f0206771ecd454933750256e Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Wed, 2 Nov 2022 13:28:02 +0100
  4. Subject: [PATCH] link with -latomic if needed (again ...)
  5. numactl unconditionally uses __atomic_fetch_and but some architectures
  6. (e.g. sparc) needs to link with -latomic to be able to use it. So check
  7. if -latomic is needed and update numa.pc accordingly.
  8. This linking was made by e0de0d9e981ddb53bdeb4a4b9dc43046c9ff4ff9 but
  9. wrongly reverted by 10c277c20768be9a563f75265bcd7e73954763ad resulting
  10. in the following build failure on sparc or microblaze:
  11. /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':
  12. libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'
  13. Fixes:
  14. - http://autobuild.buildroot.org/results/54b7567d804d9abff56f47cd26bae774c1e38669
  15. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  16. [Upstream status: https://github.com/numactl/numactl/pull/144]
  17. ---
  18. configure.ac | 2 ++
  19. 1 file changed, 2 insertions(+)
  20. diff --git a/configure.ac b/configure.ac
  21. index 8510fc5..ebf9917 100644
  22. --- a/configure.ac
  23. +++ b/configure.ac
  24. @@ -27,6 +27,8 @@ AM_CONDITIONAL([RISCV64], [test x"${target_cpu}" = x"riscv64"])
  25. AC_CONFIG_FILES([Makefile])
  26. +AC_SEARCH_LIBS([__atomic_fetch_and_1], [atomic])
  27. +
  28. # GCC tries to be "helpful" and only issue a warning for unrecognized
  29. # attributes. So we compile the test with Werror, so that if the
  30. # attribute is not recognized the compilation fails
  31. --
  32. 2.35.1