tbb/add-cmake-check-for-libatomic-requirement-when-build.patch
Dirk Mueller 4979ce178a Accepting request 1055995 from home:glaubitz:branches:devel:libraries:c_c++
- Update to v2021.8.0
  * Fixed oneapi::tbb::concurrent_bounded_queue::pop return type (GitHub* #807).
  * Fixed oneapi::tbb::concurrent_queue and oneapi::tbb::concurrent_bounded_queue
    with non-default constructible value types (GitHub* #885).
  * Fixed incorrect splitting of iteration space in case there is no
    support for proportional splitting in custom ranges.
- Add patch to link against libatomic where necessary
  * add-cmake-check-for-libatomic-requirement-when-build.patch
- Drop 5cb212d44732947396abdd39eae1229c7cd51644.patch, merged upstream
- Use correct changelog entries for v2021.7.0

  * Memory allocator crash when allocating ~1TB on 64-bit systems (GitHub* #838).
  * Thread Distribution over NUMA Nodes on Windows OS systems.
  * For oneapi::tbb::suspend it is now guaranteed that the user-specified
    callable object is executed by the calling thread.

OBS-URL: https://build.opensuse.org/request/show/1055995
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/tbb?expand=0&rev=81
2023-01-04 21:26:10 +00:00

42 lines
1.4 KiB
Diff

From faea2c59a95ff609d23a4e4f859edef83d02f417 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Fri, 9 Dec 2022 12:36:11 +0100
Subject: [PATCH] Add cmake check for libatomic requirement when building with
gcc (#980)
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
cmake/compilers/GNU.cmake | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
index cd76acfe..59f4e693 100644
--- a/cmake/compilers/GNU.cmake
+++ b/cmake/compilers/GNU.cmake
@@ -44,6 +44,22 @@ if (NOT MINGW)
set(TBB_COMMON_LINK_LIBS dl)
endif()
+# Check whether code with full atomics can be built without libatomic
+# see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
+include(CheckCXXSourceCompiles)
+check_cxx_source_compiles("#include <atomic>
+int main() {
+ std::atomic<uint8_t> w1;
+ std::atomic<uint16_t> w2;
+ std::atomic<uint32_t> w4;
+ std::atomic<uint64_t> w8;
+ return ++w1 + ++w2 + ++w4 + ++w8;
+}" TBB_BUILDS_WITHOUT_LIBATOMIC)
+
+if(NOT TBB_BUILDS_WITHOUT_LIBATOMIC)
+ set(TBB_COMMON_LINK_LIBS ${TBB_COMMON_LINK_LIBS} atomic)
+endif()
+
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
tbb_remove_compile_flag(-Werror)
--
2.30.2