libatomic
authorCeph Maintainers <ceph-maintainers@lists.ceph.com>
Fri, 5 Apr 2019 13:12:52 +0000 (14:12 +0100)
committerBernd Zeimetz <bzed@debian.org>
Fri, 5 Apr 2019 13:12:52 +0000 (14:12 +0100)
Gbp-Pq: Name libatomic.patch

23 files changed:
cmake/modules/CheckAtomic.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/client/CMakeLists.txt
src/dmclock/sim/src/CMakeLists.txt
src/dmclock/test/CMakeLists.txt
src/journal/CMakeLists.txt
src/kv/CMakeLists.txt
src/librados/CMakeLists.txt
src/librbd/CMakeLists.txt
src/os/CMakeLists.txt
src/osd/CMakeLists.txt
src/rgw/CMakeLists.txt
src/rocksdb/build_tools/build_detect_platform
src/test/CMakeLists.txt
src/test/common/CMakeLists.txt
src/test/libcephfs/CMakeLists.txt
src/test/librados_test_stub/CMakeLists.txt
src/test/msgr/CMakeLists.txt
src/test/objectstore/CMakeLists.txt
src/test/osdc/CMakeLists.txt
src/test/system/CMakeLists.txt
src/tools/rbd/CMakeLists.txt
src/tools/rbd_mirror/CMakeLists.txt

diff --git a/cmake/modules/CheckAtomic.cmake b/cmake/modules/CheckAtomic.cmake
new file mode 100644 (file)
index 0000000..67fde83
--- /dev/null
@@ -0,0 +1,67 @@
+# Checks if atomic operations are supported natively or if linking against
+# libatomic is needed.
+
+# Check inspired by LLVMs cmake/modules/CheckAtomic.cmake
+
+INCLUDE(CheckCXXSourceCompiles)
+INCLUDE(CheckLibraryExists)
+
+function(check_working_cxx_atomics varname)
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11")
+  CHECK_CXX_SOURCE_COMPILES("
+#include <atomic>
+std::atomic<int> x;
+int main() {
+  return x;
+}
+" ${varname})
+  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics)
+
+function(check_working_cxx_atomics64 varname)
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
+  CHECK_CXX_SOURCE_COMPILES("
+#include <atomic>
+#include <cstdint>
+std::atomic<uint64_t> x (0);
+int main() {
+  uint64_t i = x.load(std::memory_order_relaxed);
+  return 0;
+}
+" ${varname})
+  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics64)
+
+# Check if atomics work without libatomic
+check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
+
+if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
+  check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
+  if( HAVE_LIBATOMIC )
+    list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+    check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB)
+    if (NOT HAVE_CXX_ATOMICS_WITH_LIB)
+      message(FATAL_ERROR "Host compiler must support std::atomic!")
+    endif()
+  else()
+    message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+  endif()
+endif()
+
+# Check if 64bit atomics work without libatomic
+check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+
+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+  check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
+  if(HAVE_CXX_LIBATOMICS64)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+    check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
+    if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
+      message(FATAL_ERROR "Host compiler must support std::atomic!")
+    endif()
+  else()
+    message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+  endif()
+endif()
index b0837ab1d95ca2b2b49effb82dbd0756493752f8..465f9cb1279a2ce0069f95a46b822df268943626 100644 (file)
@@ -158,6 +158,12 @@ else()
   set(C_STANDARD_REQUIRED ON)
 endif()
 
+# check if linking against libatomic is necessary
+include(CheckAtomic)
+if(HAVE_CXX_ATOMIC_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
+  set(ATOMIC_LIBRARIES atomic)
+endif()
+
 ## Handle diagnostics color if compiler supports them.
 CHECK_C_COMPILER_FLAG("-fdiagnostics-color=always"
   COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
@@ -655,10 +661,10 @@ if(HAVE_ARMV8_CRC)
 endif(HAVE_ARMV8_CRC)
 
 add_library(common STATIC ${ceph_common_objs})
-target_link_libraries(common ${ceph_common_deps})
+target_link_libraries(common ${ceph_common_deps} ${ATOMIC_LIBRARIES})
 
 add_library(ceph-common SHARED ${ceph_common_objs})
-target_link_libraries(ceph-common ${ceph_common_deps})
+target_link_libraries(ceph-common ${ceph_common_deps} ${ATOMIC_LIBRARIES})
 # appease dpkg-shlibdeps
 set_target_properties(ceph-common PROPERTIES
   SOVERSION 0
@@ -867,7 +873,7 @@ if (NOT WITH_SYSTEM_ROCKSDB)
   add_library(rocksdb STATIC IMPORTED)
   add_dependencies(rocksdb rocksdb_ext)
   set_property(TARGET rocksdb PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/rocksdb/librocksdb.a")
-  set(ROCKSDB_LIBRARIES rocksdb)
+  set(ROCKSDB_LIBRARIES rocksdb ${ATOMIC_LIBRARIES})
 
 endif(NOT WITH_SYSTEM_ROCKSDB)
 
index 8897ada7b598725e35f9cada4402d19c6cb8bfc3..94bc99e152fdf713d615ac19d3964a0da1730ca9 100644 (file)
@@ -10,4 +10,4 @@ set(libclient_srcs
   posix_acl.cc
   Delegation.cc)
 add_library(client STATIC ${libclient_srcs})
-target_link_libraries(client osdc)
+target_link_libraries(client osdc ${ATOMIC_LIBRARIES})
index 426827b03f275d65c6b943e2dd2cacd4810b6807..c268c1953294ed536712bd52366671c2b4eb9374 100644 (file)
@@ -36,7 +36,7 @@ set_target_properties(ssched_sim dmc_sim
 
 add_dependencies(dmc_sim dmclock)
 
-target_link_libraries(ssched_sim LINK_PRIVATE pthread)
-target_link_libraries(dmc_sim LINK_PRIVATE pthread $<TARGET_FILE:dmclock>)
+target_link_libraries(ssched_sim LINK_PRIVATE pthread ${ATOMIC_LIBRARIES})
+target_link_libraries(dmc_sim LINK_PRIVATE pthread $<TARGET_FILE:dmclock> ${ATOMIC_LIBRARIES})
 
 add_custom_target(dmclock-sims DEPENDS ssched_sim dmc_sim)
index aff35d5d77581ccfd918ead823efd75beaa7fa4c..b8e7983a3f5d034e03c98470404a7e9571b0c602 100644 (file)
@@ -28,10 +28,15 @@ if (TARGET gtest AND TARGET gtest_main)
     LINK_PRIVATE $<TARGET_FILE:dmclock>
     pthread
     $<TARGET_FILE:gtest>
-    $<TARGET_FILE:gtest_main>)
+    $<TARGET_FILE:gtest_main>
+    ${ATOMICS_LIBRARIES})
 else()
   target_link_libraries(dmclock-tests
-    LINK_PRIVATE $<TARGET_FILE:dmclock> pthread ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
+    LINK_PRIVATE $<TARGET_FILE:dmclock>
+    pthread
+    ${GTEST_LIBRARIES}
+    ${GTEST_MAIN_LIBRARIES}
+    ${ATMOIC_LIBRARIES})
 endif()
   
 add_dependencies(dmclock-tests dmclock)
index 3632c1051ec2b5ed90dd4787aa8a5558d80f16a4..414f8600c1f4a3afc816edd4f1cc206cfad5cce4 100644 (file)
@@ -11,4 +11,4 @@ set(journal_srcs
   ObjectRecorder.cc
   Utils.cc)
 add_library(journal STATIC ${journal_srcs})
-target_link_libraries(journal cls_journal_client)
+target_link_libraries(journal cls_journal_client ${ATOMIC_LIBRARIES})
index 0b3ad2223ca5c86dc42f606255798048ffd19ed4..5176549775f330d9fad34c9a51ac7c965fef8b00 100644 (file)
@@ -13,7 +13,7 @@ add_library(kv_objs OBJECT ${kv_srcs})
 add_library(kv STATIC $<TARGET_OBJECTS:kv_objs>)
 target_include_directories(kv_objs BEFORE PUBLIC ${ROCKSDB_INCLUDE_DIR})
 target_include_directories(kv BEFORE PUBLIC ${ROCKSDB_INCLUDE_DIR})
-target_link_libraries(kv ${LEVELDB_LIBRARIES} ${ROCKSDB_LIBRARIES} ${ALLOC_LIBS} ${SNAPPY_LIBRARIES} ${ZLIB_LIBRARIES})
+target_link_libraries(kv ${LEVELDB_LIBRARIES} ${ROCKSDB_LIBRARIES} ${ATOMIC_LIBRARIES} ${ALLOC_LIBS} ${SNAPPY_LIBRARIES} ${ZLIB_LIBRARIES})
 
 # rocksdb detects bzlib and lz4 in its Makefile, which forces us to do the same.
 find_package(BZip2 QUIET)
index e9e402400d6885f1b2d0495d2ee61e013fcb2b49..f6e163798210c89bf317c16b323efdf4bd436c6c 100644 (file)
@@ -9,7 +9,7 @@ add_library(rados_a STATIC
   $<TARGET_OBJECTS:librados_objs>
   $<TARGET_OBJECTS:common_buffer_obj>)
 target_link_libraries(rados_a osdc ceph-common cls_lock_client
-    ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS})
+    ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS} ${ATOMIC_LIBRARIES})
 if(WITH_LTTNG)
   add_dependencies(librados_api_obj librados-tp)
 endif()
@@ -20,7 +20,7 @@ if(ENABLE_SHARED)
     $<TARGET_OBJECTS:common_buffer_obj>)
   # LINK_PRIVATE instead of PRIVATE is used to backward compatibility with cmake 2.8.11
   target_link_libraries(librados LINK_PRIVATE osdc ceph-common cls_lock_client
-    ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS})
+    ${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS} ${ATOMIC_LIBRARIES})
   set_target_properties(librados PROPERTIES
     OUTPUT_NAME rados
     VERSION 2.0.0
index 072eaed491fec88f8a6a88d22445caf62756ab9e..65e961f44342ab1006cc3b2e950557ef8a216a78 100644 (file)
@@ -125,7 +125,8 @@ target_link_libraries(librbd LINK_PRIVATE
   ceph-common
   pthread
   ${CMAKE_DL_LIBS}
-  ${EXTRALIBS})
+  ${EXTRALIBS}
+  ${ATOMIC_LIBRARIES})
 if(HAVE_UDEV)
   target_link_libraries(librbd LINK_PRIVATE
     udev)
index c4cae04307f39c7deeb136a5dcf9cb4484cb7133..79a582557c8178959202c2294ef96565e6d67e0a 100644 (file)
@@ -103,7 +103,7 @@ if(WITH_LTTNG)
   add_dependencies(os objectstore-tp)
 endif()
 
-target_link_libraries(os kv)
+target_link_libraries(os kv ${ATOMIC_LIBRARIES})
 
 add_dependencies(os compressor_plugins)
 add_dependencies(os crypto_plugins)
@@ -113,7 +113,7 @@ if(HAVE_LIBAIO)
   add_executable(ceph-bluestore-tool
     bluestore/bluestore_tool.cc)
   target_link_libraries(ceph-bluestore-tool
-    os global)
+    os global ${ATOMIC_LIBRARIES})
   install(TARGETS ceph-bluestore-tool
     DESTINATION bin)
 endif()
index 3ec6f31a604815dd29e8c43f52d62bc434073f15..227577b1a0b9a1970e0713438133ba65185d555c 100644 (file)
@@ -43,7 +43,7 @@ add_library(osd STATIC ${osd_srcs}
   $<TARGET_OBJECTS:cls_references_objs>
   $<TARGET_OBJECTS:global_common_objs>
   $<TARGET_OBJECTS:heap_profiler_objs>)
-target_link_libraries(osd ${LEVELDB_LIBRARIES} dmclock ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
+target_link_libraries(osd ${LEVELDB_LIBRARIES} dmclock ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${ATOMIC_LIBRARIES})
 if(WITH_LTTNG)
   add_dependencies(osd osd-tp pg-tp)
 endif()
index 57cb2a5b94ce90590cdc35efe8ebd3505096fce5..a58a1fce96b6e1ea21dbb6386c4503dc722d9ca3 100644 (file)
@@ -149,7 +149,7 @@ target_link_libraries(rgw_a librados cls_lock_client cls_rgw_client cls_refcount
   cls_replica_log_client cls_user_client ceph-common common_utf8 global
   ${CURL_LIBRARIES}
   ${EXPAT_LIBRARIES}
-  ${OPENLDAP_LIBRARIES} ${CRYPTO_LIBS})
+  ${OPENLDAP_LIBRARIES} ${CRYPTO_LIBS} ${ATMOIC_LIBRARIES})
 
 if (WITH_CURL_OPENSSL OR (WITH_RADOSGW_BEAST_FRONTEND AND WITH_RADOSGW_BEAST_OPENSSL))
   target_link_libraries(rgw_a ${OPENSSL_LIBRARIES})
@@ -188,7 +188,7 @@ target_link_libraries(radosgw radosgw_a librados
   cls_version_client cls_replica_log_client cls_user_client
   global ${FCGI_LIBRARY} ${LIB_RESOLV}
   ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES}
-  ${ALLOC_LIBS})
+  ${ALLOC_LIBS} ${ATMOIC_LIBRARIES})
 # radosgw depends on cls libraries at runtime, but not as link dependencies
 add_dependencies(radosgw cls_rgw cls_lock cls_refcount
   cls_log cls_statelog cls_timeindex
@@ -208,7 +208,7 @@ target_link_libraries(radosgw-admin rgw_a librados
   cls_log_client cls_statelog_client cls_timeindex_client
   cls_version_client cls_replica_log_client cls_user_client
   global ${FCGI_LIBRARY} ${LIB_RESOLV}
-  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${SSL_LIBRARIES} ${BLKID_LIBRARIES})
+  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${SSL_LIBRARIES} ${BLKID_LIBRARIES} ${ATMOIC_LIBRARIES})
 install(TARGETS radosgw-admin DESTINATION bin)
 
 set(radosgw_es_srcs
@@ -219,7 +219,7 @@ target_link_libraries(radosgw-es rgw_a librados
   cls_log_client cls_statelog_client cls_timeindex_client
   cls_version_client cls_replica_log_client cls_user_client
   global ${FCGI_LIBRARY} ${LIB_RESOLV}
-  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${SSL_LIBRARIES} ${BLKID_LIBRARIES})
+  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${SSL_LIBRARIES} ${BLKID_LIBRARIES}  ${ATMOIC_LIBRARIES})
 install(TARGETS radosgw-es DESTINATION bin)
 
 set(radosgw_token_srcs
@@ -237,7 +237,7 @@ target_link_libraries(radosgw-object-expirer rgw_a librados
   cls_log_client cls_statelog_client cls_timeindex_client
   cls_version_client cls_replica_log_client cls_user_client
   global ${FCGI_LIBRARY} ${LIB_RESOLV}
-  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES})
+  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${ATMOIC_LIBRARIES})
 install(TARGETS radosgw-object-expirer DESTINATION bin)
 
 set(librgw_srcs
@@ -259,7 +259,8 @@ target_link_libraries(rgw LINK_PRIVATE
   global
   ${LIB_RESOLV}
   ${CURL_LIBRARIES}
-  ${EXPAT_LIBRARIES})
+  ${EXPAT_LIBRARIES}
+  ${ATMOIC_LIBRARIES})
 set_target_properties(rgw PROPERTIES OUTPUT_NAME rgw VERSION 2.0.0
   SOVERSION 2)
 install(TARGETS rgw DESTINATION ${CMAKE_INSTALL_LIBDIR})
index 4358d9df9bb0abaa2188824818430c0acfe36716..e18c80b3ae47217d660919aeecb6aba1748c36cd 100755 (executable)
@@ -451,6 +451,10 @@ elif test -z "$PORTABLE"; then
   fi
 fi
 
+if [ "$TARGET_ARCHITECTURE" = "mips" ] ; then
+  PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -latomic"
+fi
+
 PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
 PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS $COMMON_FLAGS"
 
index 66e24b8bc96d0fb6df1e8b2b74cc756f4e5b028a..bbb73f6eef2be2e2d93c9cf11eac0f9db6f63a9a 100644 (file)
@@ -410,7 +410,7 @@ if(PERF_LOCAL_FLAGS)
   set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS
     ${PERF_LOCAL_FLAGS})
 endif()
-target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS})
+target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS} ${ATMOIC_LIBRARIES})
 
 # ceph_xattr_bench
 add_executable(ceph_xattr_bench
@@ -483,6 +483,7 @@ target_link_libraries(ceph_test_stress_watch
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
+  ${ATMOIC_LIBRARIES}
   )
 install(TARGETS
   ceph_test_stress_watch
index 041f127ced82a79fbaed4d177db30be955bc2c93..83d009948d44627282dc94ca6ea6079316e9c15c 100644 (file)
@@ -43,7 +43,7 @@ add_ceph_unittest(unittest_prioritized_queue ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/u
 target_link_libraries(unittest_prioritized_queue global ${BLKID_LIBRARIES})
 
 # unittest_mclock_priority_queue
-add_executable(unittest_mclock_priority_queue
+add_executable(unittest_mclock_priority_queue EXCLUDE_FROM_ALL
   test_mclock_priority_queue.cc
   )
 add_ceph_unittest(unittest_mclock_priority_queue ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mclock_priority_queue)
@@ -101,7 +101,7 @@ add_executable(unittest_throttle
   $<TARGET_OBJECTS:unit-main>
   )
 add_ceph_unittest(unittest_throttle ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_throttle)
-target_link_libraries(unittest_throttle global
+target_link_libraries(unittest_throttle global ${ATMOIC_LIBRARIES})
 
 # unittest_lru
 add_executable(unittest_lru
index 5d3f963484e250248f7b0499de835bfdfca1e28d..a7b8084a482932752cdb303167c54d68e3d51a8b 100644 (file)
@@ -17,6 +17,7 @@ if(${WITH_CEPHFS})
     ${UNITTEST_LIBS}
     ${EXTRALIBS}
     ${CMAKE_DL_LIBS}
+    ${ATMOIC_LIBRARIES}
     )
   install(TARGETS ceph_test_libcephfs
     DESTINATION ${CMAKE_INSTALL_BINDIR})
index ba30a4356c9b2b76496366ecdcb54e240ae42ed8..0a55fb833b4c41d0a57b9ac46cfd9cfbfdb0bc2a 100644 (file)
@@ -8,4 +8,4 @@ set(librados_test_stub_srcs
   TestRadosClient.cc
   TestWatchNotify.cc)
 add_library(rados_test_stub STATIC ${librados_test_stub_srcs})
-
+target_link_libraries(rados_test_stub ${ATMOIC_LIBRARIES})
index 6222087c464bf8990974e87ca028142e63a98bdf..38f945c4e80c2c0428cb5ba314f53e67cfd66fe6 100644 (file)
@@ -5,7 +5,7 @@ add_executable(ceph_test_async_driver
   )
 set_target_properties(ceph_test_async_driver PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
-target_link_libraries(ceph_test_async_driver os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${UNITTEST_LIBS})
+target_link_libraries(ceph_test_async_driver os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${ATMOIC_LIBRARIES})
 
 # ceph_test_msgr
 add_executable(ceph_test_msgr
@@ -13,7 +13,7 @@ add_executable(ceph_test_msgr
   )
 set_target_properties(ceph_test_msgr PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
-target_link_libraries(ceph_test_msgr os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${UNITTEST_LIBS})
+target_link_libraries(ceph_test_msgr os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${ATMOIC_LIBRARIES})
 
 # ceph_test_async_networkstack
 add_executable(ceph_test_async_networkstack
@@ -22,7 +22,7 @@ add_executable(ceph_test_async_networkstack
   )
 set_target_properties(ceph_test_async_networkstack PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
-target_link_libraries(ceph_test_async_networkstack global ${CRYPTO_LIBS} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${UNITTEST_LIBS})
+target_link_libraries(ceph_test_async_networkstack global ${CRYPTO_LIBS} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${ATMOIC_LIBRARIES})
 
 #ceph_perf_msgr_server
 add_executable(ceph_perf_msgr_server perf_msgr_server.cc)
@@ -34,7 +34,7 @@ target_link_libraries(ceph_perf_msgr_server os global ${UNITTEST_LIBS})
 add_executable(ceph_perf_msgr_client perf_msgr_client.cc)
 set_target_properties(ceph_perf_msgr_client PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
-target_link_libraries(ceph_perf_msgr_client os global ${UNITTEST_LIBS})
+target_link_libraries(ceph_perf_msgr_client os global ${UNITTEST_LIBS} ${ATMOIC_LIBRARIES})
 
 # test_userspace_event
 if(HAVE_DPDK)
index 71248d1acc7d01d78abe9856f924d843aa00097e..a8347ef3a6beea56fd2911f787a41c698f28c020 100644 (file)
@@ -59,6 +59,7 @@ target_link_libraries(ceph_test_objectstore_workloadgen
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
+  ${ATMOIC_LIBRARIES}
   )
 
 # ceph_test_filestore_idempotent
index 297c2672c638786fbb0e00c3aba8c9fc3f830237..6d7a509c7f6d3d660212e9405ad46bf4bc46598a 100644 (file)
@@ -8,6 +8,7 @@ target_link_libraries(ceph_test_objectcacher_stress
   global
   ${EXTRALIBS}
   ${CMAKE_DL_LIBS}
+  ${ATMOIC_LIBRARIES}
   )
 install(TARGETS ceph_test_objectcacher_stress
   DESTINATION ${CMAKE_INSTALL_BINDIR})
index f59ed3e79c632ee85d3e01ce62c4cf9f396644c1..a76955ddb6672e08ba6bb469973d836e71164ddd 100644 (file)
@@ -10,6 +10,7 @@ set(libsystest_srcs
   st_rados_watch.cc
   st_rados_notify.cc)
 add_library(systest STATIC ${libsystest_srcs})
+target_link_libraries(systest ${ATMOIC_LIBRARIES})
 
 # test_rados_list_parallel
 add_executable(ceph_test_rados_list_parallel
index 7aa42e9efdbdb6d671b5a51bae18cc6738bc7048..443afbee61c07586d345cf5754da1076e2d40c47 100644 (file)
@@ -47,7 +47,7 @@ target_link_libraries(rbd librbd librados
   rbd_types
   journal
   ceph-common global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ATMOIC_LIBRARIES})
 if(WITH_KRBD)
   target_link_libraries(rbd 
     krbd)
index ae1503e7b951770e0aa8f6e57632156633e2d51f..ae510fa63df696f6a07b8f6c2a4e97951760cac9 100644 (file)
@@ -41,6 +41,7 @@ set(rbd_mirror_internal
   service_daemon/Types.cc)
 add_library(rbd_mirror_internal STATIC
   ${rbd_mirror_internal})
+target_link_libraries(rbd_mirror_internal ${ATMOIC_LIBRARIES})
 
 add_executable(rbd-mirror
   main.cc)