[PATCH] build/cmake: Link libatomic where needed for 64-bit atomic ops.
authorAmin Bandali <amin.bandali@savoirfairelinux.com>
Sun, 5 Feb 2023 17:56:24 +0000 (12:56 -0500)
committerAmin Bandali <bandali@gnu.org>
Wed, 22 Feb 2023 20:20:06 +0000 (15:20 -0500)
From 9155a8401d79a69a68052e3c8145da1187240d20 Mon Sep 17 00:00:00 2001
Forwarded: https://github.com/savoirfairelinux/opendht/pull/653
Last-Update: 2023-02-05

Link against libatomic also on architectures that need it for 64-bit
atomic operations.  ARM EABI (armel) and little-endian MIPS (mipsel)
are two such architectures.

Gbp-Pq: Name 1000-cmake-fix-no-atomic-64.patch

CMakeLists.txt

index 6e434bb532821da4fb2946c0b27b840a6f20e9ee..3869af4dca014ce8e5b3e388cad18331a3ed35a2 100644 (file)
@@ -48,7 +48,9 @@ set (CMAKE_CXX_STANDARD 17)
 set (CMAKE_CXX_STANDARD_REQUIRED on)
 
 # Dependencies
-if (NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
+if (NOT HAVE_CXX_ATOMICS_WITHOUT_LIB
+        # For ARM EABI (armel), little-endian MIPS (mipsel), etc.
+        OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
     link_libraries (atomic)
 endif ()