summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/rocksdb/files/rocksdb-6.14.6-libatomic.patch')
-rw-r--r--dev-libs/rocksdb/files/rocksdb-6.14.6-libatomic.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/dev-libs/rocksdb/files/rocksdb-6.14.6-libatomic.patch b/dev-libs/rocksdb/files/rocksdb-6.14.6-libatomic.patch
new file mode 100644
index 000000000000..5ffcc8eee9ff
--- /dev/null
+++ b/dev-libs/rocksdb/files/rocksdb-6.14.6-libatomic.patch
@@ -0,0 +1,29 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -325,6 +325,26 @@
+ add_definitions(-DROCKSDB_SUPPORT_THREAD_LOCAL)
+ endif()
+
++set(ATOMIC_TEST_SOURCE "
++#include <atomic>
++int main() {
++ std::atomic<bool> y (false);
++ std::atomic<uint64_t> x (0);
++ bool expected = true;
++ bool j = y.compare_exchange_weak(expected,false);
++ x++;
++ return 0;
++}")
++CHECK_CXX_SOURCE_COMPILES("${ATOMIC_TEST_SOURCE}" ATOMICS_ARE_BUILTIN)
++if (NOT ATOMICS_ARE_BUILTIN)
++ set(CMAKE_REQUIRED_LIBRARIES atomic)
++ check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMICS_REQUIRE_LIBATOMIC)
++ unset(CMAKE_REQUIRED_LIBRARIES)
++ if (ATOMICS_REQUIRE_LIBATOMIC)
++ string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -latomic")
++ endif ()
++endif ()
++
+ option(FAIL_ON_WARNINGS "Treat compile warnings as errors" ON)
+ if(FAIL_ON_WARNINGS)
+ if(MSVC)