mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
tbb: update to version 2022.3.0. (#13176)
Remove unused 2021.10.0 version. Clean up recipe a bit, reworked the .patchset more extensibly. Still leaving it disabled until further testing. Note: it should be possible to build this without the `hwloc` dependency. In that case, libtbbbind_*.so* are not generated. Kudos to Begasus for his help in testing this, and previous patchset!
This commit is contained in:
@@ -1,224 +0,0 @@
|
||||
From 2d93c4810d95aae37dbf105475e824ef45d8e95a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Wed, 6 Jan 2021 11:20:09 +0100
|
||||
Subject: Haiku patches
|
||||
|
||||
|
||||
diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake
|
||||
index a128e13..c56a1b2 100644
|
||||
--- a/cmake/compilers/Clang.cmake
|
||||
+++ b/cmake/compilers/Clang.cmake
|
||||
@@ -54,7 +54,9 @@ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-secur
|
||||
-fstack-protector-strong -fPIC)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now)
|
||||
|
||||
-set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
+if (NOT HAIKU)
|
||||
+ set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
+endif()
|
||||
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
|
||||
|
||||
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
|
||||
index b60172c..1be47fe 100644
|
||||
--- a/cmake/compilers/GNU.cmake
|
||||
+++ b/cmake/compilers/GNU.cmake
|
||||
@@ -40,7 +40,7 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
|
||||
endif()
|
||||
|
||||
-if (NOT MINGW)
|
||||
+if (NOT MINGW AND NOT HAIKU)
|
||||
set(TBB_COMMON_LINK_LIBS dl)
|
||||
endif()
|
||||
|
||||
diff --git a/include/oneapi/tbb/detail/_config.h b/include/oneapi/tbb/detail/_config.h
|
||||
index ad9f0f3..49e3d67 100644
|
||||
--- a/include/oneapi/tbb/detail/_config.h
|
||||
+++ b/include/oneapi/tbb/detail/_config.h
|
||||
@@ -274,7 +274,7 @@
|
||||
#define __TBB_CPP20_COMPARISONS_PRESENT 0
|
||||
#endif
|
||||
|
||||
-#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
|
||||
+#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__HAIKU__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
|
||||
|
||||
/* This macro marks incomplete code or comments describing ideas which are considered for the future.
|
||||
* See also for plain comment with TODO and FIXME marks for small improvement opportunities.
|
||||
@@ -490,6 +490,11 @@
|
||||
#define TBB_ALLOCATOR_TRAITS_BROKEN 1
|
||||
#endif
|
||||
|
||||
+// HAIKU build fix
|
||||
+#if defined(__HAIKU__)
|
||||
+ #define TBB_ALLOCATOR_TRAITS_BROKEN 1
|
||||
+#endif
|
||||
+
|
||||
// GCC 4.8 C++ standard library implements std::this_thread::yield as no-op.
|
||||
#if __TBB_GLIBCXX_VERSION >= 40800 && __TBB_GLIBCXX_VERSION < 40900
|
||||
#define __TBB_GLIBCXX_THIS_THREAD_YIELD_BROKEN 1
|
||||
diff --git a/src/tbb/allocator.cpp b/src/tbb/allocator.cpp
|
||||
index 5453aea..99b567b 100644
|
||||
--- a/src/tbb/allocator.cpp
|
||||
+++ b/src/tbb/allocator.cpp
|
||||
@@ -40,7 +40,7 @@
|
||||
// memalign() and it offers nothing but overhead due to inconvenient interface. This is likely the case with other
|
||||
// standard libraries as well, and more libraries can be added to the preprocessor check below. Unfortunately, we
|
||||
// can't detect musl, so we simply enable memalign() on Linux and Android in general.
|
||||
-#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__ANDROID__)
|
||||
+#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__ANDROID__) || defined(__HAIKU__)
|
||||
#include <malloc.h> // memalign
|
||||
#define __TBB_USE_MEMALIGN
|
||||
#else
|
||||
@@ -119,7 +119,7 @@ static const dynamic_link_descriptor MallocLinkTable[] = {
|
||||
#define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll"
|
||||
#elif __APPLE__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__ || __HAIKU__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
#elif __unix__ // Note that order of these #elif's is important!
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so.2"
|
||||
diff --git a/src/tbb/dynamic_link.cpp b/src/tbb/dynamic_link.cpp
|
||||
index 2d88f8b..1c6ba41 100644
|
||||
--- a/src/tbb/dynamic_link.cpp
|
||||
+++ b/src/tbb/dynamic_link.cpp
|
||||
@@ -388,7 +388,11 @@ namespace r1 {
|
||||
#endif /* !__TBB_DYNAMIC_LOAD_ENABLED */
|
||||
// RTLD_GLOBAL - to guarantee that old TBB will find the loaded library
|
||||
// RTLD_NOLOAD - not to load the library without the full path
|
||||
- library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
|
||||
+ #ifndef __HAIKU__
|
||||
+ library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
|
||||
+ #else
|
||||
+ library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL);
|
||||
+ #endif
|
||||
#endif /* _WIN32 */
|
||||
if (library_handle) {
|
||||
if (!resolve_symbols(library_handle, descriptors, required)) {
|
||||
diff --git a/src/tbb/rml_tbb.cpp b/src/tbb/rml_tbb.cpp
|
||||
index 4c772ea..97f05f2 100644
|
||||
--- a/src/tbb/rml_tbb.cpp
|
||||
+++ b/src/tbb/rml_tbb.cpp
|
||||
@@ -50,7 +50,7 @@ namespace rml {
|
||||
#define RML_SERVER_NAME "irml" DEBUG_SUFFIX ".dll"
|
||||
#elif __APPLE__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __HAIKU__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so"
|
||||
#elif __unix__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so.1"
|
||||
diff --git a/src/tbbmalloc/frontend.cpp b/src/tbbmalloc/frontend.cpp
|
||||
index aa35831..c6ac548 100644
|
||||
--- a/src/tbbmalloc/frontend.cpp
|
||||
+++ b/src/tbbmalloc/frontend.cpp
|
||||
@@ -774,7 +774,7 @@ static inline unsigned int highestBitPos(unsigned int n)
|
||||
unsigned int pos;
|
||||
#if __ARCH_x86_32||__ARCH_x86_64
|
||||
|
||||
-# if __unix__||__APPLE__||__MINGW32__
|
||||
+# if __unix__||__APPLE__||__MINGW32__||__HAIKU__
|
||||
__asm__ ("bsr %1,%0" : "=r"(pos) : "r"(n));
|
||||
# elif (_WIN32 && (!_WIN64 || __INTEL_COMPILER))
|
||||
__asm
|
||||
diff --git a/src/tbbmalloc/tbbmalloc.cpp b/src/tbbmalloc/tbbmalloc.cpp
|
||||
index 675726e..f161798 100644
|
||||
--- a/src/tbbmalloc/tbbmalloc.cpp
|
||||
+++ b/src/tbbmalloc/tbbmalloc.cpp
|
||||
@@ -43,7 +43,7 @@ namespace internal {
|
||||
#define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll"
|
||||
#elif __APPLE__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__ || __HAIKU__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
#elif __unix__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX __TBB_STRING(.so.2)
|
||||
diff --git a/test/common/memory_usage.h b/test/common/memory_usage.h
|
||||
index cf8b418..1153f81 100644
|
||||
--- a/test/common/memory_usage.h
|
||||
+++ b/test/common/memory_usage.h
|
||||
@@ -122,6 +122,7 @@ namespace utils {
|
||||
ASSERT(status == KERN_SUCCESS, nullptr);
|
||||
return info.virtual_size - shared_size;
|
||||
#else
|
||||
+ utils::suppress_unused_warning(stat);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
diff --git a/test/common/utils_dynamic_libs.h b/test/common/utils_dynamic_libs.h
|
||||
index c84beac..57f0e85 100644
|
||||
--- a/test/common/utils_dynamic_libs.h
|
||||
+++ b/test/common/utils_dynamic_libs.h
|
||||
@@ -50,7 +50,7 @@ namespace utils {
|
||||
#if __APPLE__
|
||||
#define EXT ".dylib"
|
||||
// Android SDK build system does not support .so file name versioning
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __sun || _AIX || __ANDROID__
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __sun || _AIX || __ANDROID__ || __HAIKU__
|
||||
#define EXT ".so"
|
||||
#elif __unix__ // Order of these elif's matters!
|
||||
#define EXT __TBB_STRING(.so.2)
|
||||
diff --git a/test/conformance/conformance_resumable_tasks.cpp b/test/conformance/conformance_resumable_tasks.cpp
|
||||
index 70fd878..4b8bfbe 100644
|
||||
--- a/test/conformance/conformance_resumable_tasks.cpp
|
||||
+++ b/test/conformance/conformance_resumable_tasks.cpp
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "common/test.h"
|
||||
|
||||
-#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__)
|
||||
+#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__ && !__HAIKU__)
|
||||
|
||||
#include "oneapi/tbb/task.h"
|
||||
#include "oneapi/tbb/task_group.h"
|
||||
--
|
||||
2.45.1
|
||||
|
||||
|
||||
From 9e820e4e741a599cde921cc78271547833e65292 Mon Sep 17 00:00:00 2001
|
||||
From: Schrijvers Luc <begasus@gmail.com>
|
||||
Date: Tue, 25 Jun 2024 09:06:51 +0200
|
||||
Subject: Disable warning turning into errors
|
||||
|
||||
|
||||
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
|
||||
index 1be47fe..9d42934 100644
|
||||
--- a/cmake/compilers/GNU.cmake
|
||||
+++ b/cmake/compilers/GNU.cmake
|
||||
@@ -26,7 +26,7 @@ else()
|
||||
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
|
||||
endif()
|
||||
|
||||
-set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors)
|
||||
+set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=address -Wno-error=sizeof-array-div)
|
||||
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
|
||||
|
||||
# Depfile options (e.g. -MD) are inserted automatically in some cases.
|
||||
--
|
||||
2.45.1
|
||||
|
||||
|
||||
From 4695814ea37df44d34e25ac7ee22ddc5a721e9d2 Mon Sep 17 00:00:00 2001
|
||||
From: Schrijvers Luc <begasus@gmail.com>
|
||||
Date: Tue, 25 Jun 2024 08:54:51 +0200
|
||||
Subject: Build fix?
|
||||
|
||||
|
||||
diff --git a/include/oneapi/tbb/detail/_export.h b/include/oneapi/tbb/detail/_export.h
|
||||
index 4c01522..cc4c9f5 100644
|
||||
--- a/include/oneapi/tbb/detail/_export.h
|
||||
+++ b/include/oneapi/tbb/detail/_export.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef __TBB_detail__export_H
|
||||
#define __TBB_detail__export_H
|
||||
|
||||
-#if defined(__MINGW32__)
|
||||
+#if defined(__MINGW32__) || defined(__HAIKU__)
|
||||
#define _EXPORT __declspec(dllexport)
|
||||
#elif defined(_WIN32) || defined(__unix__) || defined(__APPLE__) // Use .def files for these
|
||||
#define _EXPORT
|
||||
--
|
||||
2.45.1
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
From 53cc4fc65dac5437f6d6197e278b3434e43ab594 Mon Sep 17 00:00:00 2001
|
||||
From: Schrijvers Luc <begasus@gmail.com>
|
||||
Date: Mon, 25 Nov 2024 17:46:22 +0100
|
||||
Subject: Haiku patches
|
||||
|
||||
|
||||
diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake
|
||||
index dcd6663..98812d6 100644
|
||||
--- a/cmake/compilers/Clang.cmake
|
||||
+++ b/cmake/compilers/Clang.cmake
|
||||
@@ -70,10 +70,12 @@ if (NOT APPLE)
|
||||
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now)
|
||||
endif()
|
||||
|
||||
-set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
+if (NOT HAIKU)
|
||||
+ set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
+endif ()
|
||||
|
||||
if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
|
||||
- set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
|
||||
+ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
|
||||
endif ()
|
||||
|
||||
if (MINGW)
|
||||
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
|
||||
index cf6d8bd..12282cb 100644
|
||||
--- a/cmake/compilers/GNU.cmake
|
||||
+++ b/cmake/compilers/GNU.cmake
|
||||
@@ -71,7 +71,9 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
|
||||
endif()
|
||||
|
||||
-set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
+if (NOT HAIKU)
|
||||
+ set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
+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)
|
||||
diff --git a/include/oneapi/tbb/detail/_config.h b/include/oneapi/tbb/detail/_config.h
|
||||
index e676b15..f1f34ab 100644
|
||||
--- a/include/oneapi/tbb/detail/_config.h
|
||||
+++ b/include/oneapi/tbb/detail/_config.h
|
||||
@@ -274,7 +274,7 @@
|
||||
#define __TBB_CPP20_COMPARISONS_PRESENT 0
|
||||
#endif
|
||||
|
||||
-#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
|
||||
+#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__HAIKU__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
|
||||
|
||||
/* This macro marks incomplete code or comments describing ideas which are considered for the future.
|
||||
* See also for plain comment with TODO and FIXME marks for small improvement opportunities.
|
||||
@@ -493,6 +493,11 @@
|
||||
#define TBB_ALLOCATOR_TRAITS_BROKEN 1
|
||||
#endif
|
||||
|
||||
+// HAIKU build fix
|
||||
+#if defined(__HAIKU__)
|
||||
+ #define TBB_ALLOCATOR_TRAITS_BROKEN 1
|
||||
+#endif
|
||||
+
|
||||
// GCC 4.8 C++ standard library implements std::this_thread::yield as no-op.
|
||||
#if __TBB_GLIBCXX_VERSION >= 40800 && __TBB_GLIBCXX_VERSION < 40900
|
||||
#define __TBB_GLIBCXX_THIS_THREAD_YIELD_BROKEN 1
|
||||
diff --git a/src/tbb/allocator.cpp b/src/tbb/allocator.cpp
|
||||
index 689c512..559ddf7 100644
|
||||
--- a/src/tbb/allocator.cpp
|
||||
+++ b/src/tbb/allocator.cpp
|
||||
@@ -40,7 +40,7 @@
|
||||
// memalign() and it offers nothing but overhead due to inconvenient interface. This is likely the case with other
|
||||
// standard libraries as well, and more libraries can be added to the preprocessor check below. Unfortunately, we
|
||||
// can't detect musl, so we simply enable memalign() on Linux and Android in general.
|
||||
-#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__ANDROID__)
|
||||
+#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__ANDROID__) || defined(__HAIKU__)
|
||||
#include <malloc.h> // memalign
|
||||
#define __TBB_USE_MEMALIGN
|
||||
#else
|
||||
@@ -119,7 +119,7 @@ static const dynamic_link_descriptor MallocLinkTable[] = {
|
||||
#define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll"
|
||||
#elif __APPLE__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".2.dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__ || __HAIKU__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
#elif __unix__ // Note that order of these #elif's is important!
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so.2"
|
||||
diff --git a/src/tbb/dynamic_link.cpp b/src/tbb/dynamic_link.cpp
|
||||
index a21beb5..dc6824a 100644
|
||||
--- a/src/tbb/dynamic_link.cpp
|
||||
+++ b/src/tbb/dynamic_link.cpp
|
||||
@@ -389,7 +389,11 @@ namespace r1 {
|
||||
#endif /* !__TBB_DYNAMIC_LOAD_ENABLED */
|
||||
// RTLD_GLOBAL - to guarantee that old TBB will find the loaded library
|
||||
// RTLD_NOLOAD - not to load the library without the full path
|
||||
- library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
|
||||
+ #ifndef __HAIKU__
|
||||
+ library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
|
||||
+ #else
|
||||
+ library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL);
|
||||
+ #endif
|
||||
#endif /* _WIN32 */
|
||||
if (library_handle) {
|
||||
if (!resolve_symbols(library_handle, descriptors, required)) {
|
||||
diff --git a/src/tbb/rml_tbb.cpp b/src/tbb/rml_tbb.cpp
|
||||
index d1cd285..db61654 100644
|
||||
--- a/src/tbb/rml_tbb.cpp
|
||||
+++ b/src/tbb/rml_tbb.cpp
|
||||
@@ -50,7 +50,7 @@ namespace rml {
|
||||
#define RML_SERVER_NAME "irml" DEBUG_SUFFIX ".dll"
|
||||
#elif __APPLE__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".1.dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __HAIKU__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so"
|
||||
#elif __unix__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so.1"
|
||||
diff --git a/src/tbbmalloc/frontend.cpp b/src/tbbmalloc/frontend.cpp
|
||||
index c9aaf46..555af70 100644
|
||||
--- a/src/tbbmalloc/frontend.cpp
|
||||
+++ b/src/tbbmalloc/frontend.cpp
|
||||
@@ -776,7 +776,7 @@ static inline unsigned int highestBitPos(unsigned int n)
|
||||
unsigned int pos;
|
||||
#if __ARCH_x86_32||__ARCH_x86_64
|
||||
|
||||
-# if __unix__||__APPLE__||__MINGW32__
|
||||
+# if __unix__||__APPLE__||__MINGW32__||__HAIKU__
|
||||
__asm__ ("bsr %1,%0" : "=r"(pos) : "r"(n));
|
||||
# elif (_WIN32 && (!_WIN64 || __INTEL_COMPILER))
|
||||
__asm
|
||||
diff --git a/src/tbbmalloc/tbbmalloc.cpp b/src/tbbmalloc/tbbmalloc.cpp
|
||||
index b72e03a..938f1fe 100644
|
||||
--- a/src/tbbmalloc/tbbmalloc.cpp
|
||||
+++ b/src/tbbmalloc/tbbmalloc.cpp
|
||||
@@ -43,7 +43,7 @@ namespace internal {
|
||||
#define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll"
|
||||
#elif __APPLE__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".2.dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__ || __HAIKU__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
#elif __unix__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX __TBB_STRING(.so.2)
|
||||
diff --git a/test/common/memory_usage.h b/test/common/memory_usage.h
|
||||
index cf8b418..1153f81 100644
|
||||
--- a/test/common/memory_usage.h
|
||||
+++ b/test/common/memory_usage.h
|
||||
@@ -122,6 +122,7 @@ namespace utils {
|
||||
ASSERT(status == KERN_SUCCESS, nullptr);
|
||||
return info.virtual_size - shared_size;
|
||||
#else
|
||||
+ utils::suppress_unused_warning(stat);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
diff --git a/test/common/utils_dynamic_libs.h b/test/common/utils_dynamic_libs.h
|
||||
index 99afca3..e641c8b 100644
|
||||
--- a/test/common/utils_dynamic_libs.h
|
||||
+++ b/test/common/utils_dynamic_libs.h
|
||||
@@ -58,7 +58,7 @@ namespace utils {
|
||||
#define EXT ".dylib"
|
||||
#endif
|
||||
// Android SDK build system does not support .so file name versioning
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__ || __HAIKU__
|
||||
#define EXT ".so"
|
||||
#elif __unix__ // Order of these elif's matters!
|
||||
#define EXT __TBB_STRING(.so.2)
|
||||
diff --git a/test/conformance/conformance_resumable_tasks.cpp b/test/conformance/conformance_resumable_tasks.cpp
|
||||
index 70fd878..4b8bfbe 100644
|
||||
--- a/test/conformance/conformance_resumable_tasks.cpp
|
||||
+++ b/test/conformance/conformance_resumable_tasks.cpp
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "common/test.h"
|
||||
|
||||
-#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__)
|
||||
+#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__ && !__HAIKU__)
|
||||
|
||||
#include "oneapi/tbb/task.h"
|
||||
#include "oneapi/tbb/task_group.h"
|
||||
--
|
||||
2.45.2
|
||||
|
||||
|
||||
From af873242898a84981b41922b67100f4de988e981 Mon Sep 17 00:00:00 2001
|
||||
From: Schrijvers Luc <begasus@gmail.com>
|
||||
Date: Mon, 25 Nov 2024 17:48:00 +0100
|
||||
Subject: Disable warning turning into errors
|
||||
|
||||
|
||||
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
|
||||
index 12282cb..b7f9d4c 100644
|
||||
--- a/cmake/compilers/GNU.cmake
|
||||
+++ b/cmake/compilers/GNU.cmake
|
||||
@@ -26,7 +26,7 @@ else()
|
||||
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
|
||||
endif()
|
||||
|
||||
-set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors)
|
||||
+set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=address -Wno-error=sizeof-array-div)
|
||||
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
|
||||
|
||||
# Depfile options (e.g. -MD) are inserted automatically in some cases.
|
||||
--
|
||||
2.45.2
|
||||
|
||||
|
||||
From 8807ed150dcbd942c9c0b2837c8806685861e5e2 Mon Sep 17 00:00:00 2001
|
||||
From: Schrijvers Luc <begasus@gmail.com>
|
||||
Date: Mon, 25 Nov 2024 17:49:32 +0100
|
||||
Subject: Build fix?
|
||||
|
||||
|
||||
diff --git a/include/oneapi/tbb/detail/_export.h b/include/oneapi/tbb/detail/_export.h
|
||||
index 4c01522..8094254 100644
|
||||
--- a/include/oneapi/tbb/detail/_export.h
|
||||
+++ b/include/oneapi/tbb/detail/_export.h
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#define _EXPORT __declspec(dllexport)
|
||||
-#elif defined(_WIN32) || defined(__unix__) || defined(__APPLE__) // Use .def files for these
|
||||
+#elif defined(_WIN32) || defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__) // Use .def files for these
|
||||
#define _EXPORT
|
||||
#else
|
||||
#error "Unknown platform/compiler"
|
||||
--
|
||||
2.45.2
|
||||
|
||||
273
dev-cpp/tbb/patches/tbb-2022.3.0.patchset
Normal file
273
dev-cpp/tbb/patches/tbb-2022.3.0.patchset
Normal file
@@ -0,0 +1,273 @@
|
||||
From 4913c75e561ec3aaff1bf4cb35b43ed818640eed Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Lesta <oscar.lesta@gmail.com>
|
||||
Date: Sun, 2 Nov 2025 07:05:17 -0300
|
||||
Subject: Fix compilation errors.
|
||||
|
||||
Minimal set of changes needed to make the build succeed.
|
||||
|
||||
Based on the "Haiku patches" commit from prevoius tbb-2022.0.0.patchset.
|
||||
|
||||
Co-authored-by: Schrijvers Luc <begasus@gmail.com>
|
||||
|
||||
diff --git a/include/oneapi/tbb/detail/_config.h b/include/oneapi/tbb/detail/_config.h
|
||||
index 1d36013..f89d97c 100644
|
||||
--- a/include/oneapi/tbb/detail/_config.h
|
||||
+++ b/include/oneapi/tbb/detail/_config.h
|
||||
@@ -277,7 +277,7 @@
|
||||
#define __TBB_CPP20_COMPARISONS_PRESENT 0
|
||||
#endif
|
||||
|
||||
-#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
|
||||
+#define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__HAIKU__ && !__QNXNTO__ && (!__linux__ || __GLIBC__))
|
||||
|
||||
/* This macro marks incomplete code or comments describing ideas which are considered for the future.
|
||||
* See also for plain comment with TODO and FIXME marks for small improvement opportunities.
|
||||
diff --git a/include/oneapi/tbb/detail/_export.h b/include/oneapi/tbb/detail/_export.h
|
||||
index 24b6c08..dae3d8a 100644
|
||||
--- a/include/oneapi/tbb/detail/_export.h
|
||||
+++ b/include/oneapi/tbb/detail/_export.h
|
||||
@@ -21,7 +21,7 @@
|
||||
#define __TBB_EXPORT __declspec(dllexport)
|
||||
#elif defined(_WIN32) // Use .def files for these
|
||||
#define __TBB_EXPORT
|
||||
-#elif defined(__unix__) || defined(__APPLE__) // Use .def files for these
|
||||
+#elif defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__) // Use .def files for these
|
||||
#define __TBB_EXPORT __attribute__ ((visibility ("default")))
|
||||
#else
|
||||
#error "Unknown platform/compiler"
|
||||
diff --git a/src/tbb/allocator.cpp b/src/tbb/allocator.cpp
|
||||
index 689c512..b0cc5fb 100644
|
||||
--- a/src/tbb/allocator.cpp
|
||||
+++ b/src/tbb/allocator.cpp
|
||||
@@ -40,7 +40,7 @@
|
||||
// memalign() and it offers nothing but overhead due to inconvenient interface. This is likely the case with other
|
||||
// standard libraries as well, and more libraries can be added to the preprocessor check below. Unfortunately, we
|
||||
// can't detect musl, so we simply enable memalign() on Linux and Android in general.
|
||||
-#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__ANDROID__)
|
||||
+#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__ANDROID__) || defined(__HAIKU__)
|
||||
#include <malloc.h> // memalign
|
||||
#define __TBB_USE_MEMALIGN
|
||||
#else
|
||||
@@ -121,7 +121,7 @@ static const dynamic_link_descriptor MallocLinkTable[] = {
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".2.dylib"
|
||||
#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
-#elif __unix__ // Note that order of these #elif's is important!
|
||||
+#elif __unix__ || __HAIKU__ // Note that order of these #elif's is important!
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so.2"
|
||||
#else
|
||||
#error Unknown OS
|
||||
diff --git a/src/tbb/rml_tbb.cpp b/src/tbb/rml_tbb.cpp
|
||||
index d1cd285..6b9b731 100644
|
||||
--- a/src/tbb/rml_tbb.cpp
|
||||
+++ b/src/tbb/rml_tbb.cpp
|
||||
@@ -52,7 +52,7 @@ namespace rml {
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".1.dylib"
|
||||
#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so"
|
||||
-#elif __unix__
|
||||
+#elif __unix__ || __HAIKU__
|
||||
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so.1"
|
||||
#else
|
||||
#error Unknown OS
|
||||
diff --git a/src/tbbmalloc/frontend.cpp b/src/tbbmalloc/frontend.cpp
|
||||
index 7457dd3..f3aed7b 100644
|
||||
--- a/src/tbbmalloc/frontend.cpp
|
||||
+++ b/src/tbbmalloc/frontend.cpp
|
||||
@@ -776,7 +776,7 @@ static inline unsigned int highestBitPos(unsigned int n)
|
||||
unsigned int pos;
|
||||
#if __ARCH_x86_32||__ARCH_x86_64
|
||||
|
||||
-# if __unix__||__APPLE__||__MINGW32__
|
||||
+# if __unix__||__APPLE__||__MINGW32__||__HAIKU__
|
||||
__asm__ ("bsr %1,%0" : "=r"(pos) : "r"(n));
|
||||
# elif (_WIN32 && (!_WIN64 || __INTEL_COMPILER))
|
||||
__asm
|
||||
diff --git a/src/tbbmalloc/tbbmalloc.cpp b/src/tbbmalloc/tbbmalloc.cpp
|
||||
index b72e03a..7b68679 100644
|
||||
--- a/src/tbbmalloc/tbbmalloc.cpp
|
||||
+++ b/src/tbbmalloc/tbbmalloc.cpp
|
||||
@@ -45,7 +45,7 @@ namespace internal {
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".2.dylib"
|
||||
#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
-#elif __unix__
|
||||
+#elif __unix__ || __HAIKU__
|
||||
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX __TBB_STRING(.so.2)
|
||||
#else
|
||||
#error Unknown OS
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
||||
From 49e6386f79518c43a69a2bd57d3f421b2ffe6445 Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Lesta <oscar.lesta@gmail.com>
|
||||
Date: Sun, 2 Nov 2025 07:23:03 -0300
|
||||
Subject: Allow compilation on Haiku's revisions older than hrev58813.
|
||||
|
||||
Older versions don't support RTLD_NOLOAD.
|
||||
|
||||
This commit can be dropped after HaikuPorts builder (eventually)
|
||||
switch to beta6.
|
||||
|
||||
diff --git a/src/tbb/dynamic_link.cpp b/src/tbb/dynamic_link.cpp
|
||||
index c4abfc6..fbb5436 100644
|
||||
--- a/src/tbb/dynamic_link.cpp
|
||||
+++ b/src/tbb/dynamic_link.cpp
|
||||
@@ -534,7 +534,14 @@ namespace r1 {
|
||||
#endif /* !__TBB_DYNAMIC_LOAD_ENABLED */
|
||||
// RTLD_GLOBAL - to guarantee that old TBB will find the loaded library
|
||||
// RTLD_NOLOAD - not to load the library without the full path
|
||||
+ // Work-around for building on Haiku < hrev58813.
|
||||
+ #ifdef RTLD_NOLOAD
|
||||
library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD);
|
||||
+ #else
|
||||
+ // Nay trigger benign, but spurious, runtime_loader messages when calling this.
|
||||
+ // ("mold" suffers from this, for example)
|
||||
+ library_handle = dlopen(library, RTLD_LAZY | RTLD_GLOBAL);
|
||||
+ #endif
|
||||
#endif /* _WIN32 */
|
||||
if (library_handle) {
|
||||
if (!resolve_symbols(library_handle, descriptors, required)) {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
||||
From 7ebfa2dd519d217fc06fcfad9c1da752dab7023b Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Lesta <oscar.lesta@gmail.com>
|
||||
Date: Sat, 1 Nov 2025 14:33:07 -0300
|
||||
Subject: Do not attempt to load TCM on Haiku.
|
||||
|
||||
See comment on the diff as to why.
|
||||
|
||||
diff --git a/src/tbb/tcm_adaptor.cpp b/src/tbb/tcm_adaptor.cpp
|
||||
index 7fa71c3..9e17336 100644
|
||||
--- a/src/tbb/tcm_adaptor.cpp
|
||||
+++ b/src/tbb/tcm_adaptor.cpp
|
||||
@@ -246,8 +246,16 @@ void tcm_adaptor::initialize() {
|
||||
// Allow system loader to search for TCM in the environment rather than load it from certain
|
||||
// location.
|
||||
constexpr int flags = DYNAMIC_LINK_DEFAULT & ~DYNAMIC_LINK_BUILD_ABSOLUTE_PATH;
|
||||
+// No TCM available on Haiku, and this dynamic_link() call ends ups calling dlopen() without a
|
||||
+// full path name to "tcm", and without specifying RTLD_NOLOAD, which causes Haiku's runtime_loader
|
||||
+// to emit an annoying: "runtime_loader: Cannot open file tcm (needed by /boot/system/lib/libtbb.so.12.17): No such file or directory"
|
||||
+// each time libtbb is loaded.
|
||||
+// As there's no OpenMP implrementation from the Intel DPC++/C++ Compiler (necessary to make "tcm" work),
|
||||
+// this should be pretty harmless (and TCM is disabled by default, in any case).
|
||||
+#ifndef __HAIKU__
|
||||
tcm_functions_loaded = dynamic_link(TCMLIB_NAME, tcm_link_table, tcm_link_table_size,
|
||||
/*handle*/nullptr, flags);
|
||||
+#endif
|
||||
}
|
||||
|
||||
bool tcm_adaptor::is_initialized() {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
||||
From 7eec43803f13fe8f786f8a19cee5ca831f4844ba Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Lesta <oscar.lesta@gmail.com>
|
||||
Date: Sun, 2 Nov 2025 08:16:54 -0300
|
||||
Subject: Fix build of tests.
|
||||
|
||||
Co-authored-by: Schrijvers Luc <begasus@gmail.com>
|
||||
|
||||
diff --git a/test/common/utils_dynamic_libs.h b/test/common/utils_dynamic_libs.h
|
||||
index 99afca3..751c266 100644
|
||||
--- a/test/common/utils_dynamic_libs.h
|
||||
+++ b/test/common/utils_dynamic_libs.h
|
||||
@@ -60,7 +60,7 @@ namespace utils {
|
||||
// Android SDK build system does not support .so file name versioning
|
||||
#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
#define EXT ".so"
|
||||
-#elif __unix__ // Order of these elif's matters!
|
||||
+#elif __unix__ || __HAIKU__ // Order of these elif's matters!
|
||||
#define EXT __TBB_STRING(.so.2)
|
||||
#else
|
||||
#error Unknown OS
|
||||
diff --git a/test/conformance/conformance_resumable_tasks.cpp b/test/conformance/conformance_resumable_tasks.cpp
|
||||
index 70fd878..4b8bfbe 100644
|
||||
--- a/test/conformance/conformance_resumable_tasks.cpp
|
||||
+++ b/test/conformance/conformance_resumable_tasks.cpp
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "common/test.h"
|
||||
|
||||
-#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__)
|
||||
+#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__ && !__HAIKU__)
|
||||
|
||||
#include "oneapi/tbb/task.h"
|
||||
#include "oneapi/tbb/task_group.h"
|
||||
diff --git a/test/tbb/test_eh_thread.cpp b/test/tbb/test_eh_thread.cpp
|
||||
index a8885e6..ab23428 100644
|
||||
--- a/test/tbb/test_eh_thread.cpp
|
||||
+++ b/test/tbb/test_eh_thread.cpp
|
||||
@@ -34,7 +34,7 @@
|
||||
// On Windows there is no real thread number limit beside available memory.
|
||||
// Therefore, the test for thread limit is unreasonable.
|
||||
// TODO: enable limitThreads with sanitizer under docker
|
||||
-#if TBB_USE_EXCEPTIONS && !_WIN32 && !__ANDROID__
|
||||
+#if TBB_USE_EXCEPTIONS && !_WIN32 && !__ANDROID__ && !__HAIKU__
|
||||
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
||||
From 30b7f1920b369c2454eccd99dd1ee97ffbb77f20 Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Lesta <oscar.lesta@gmail.com>
|
||||
Date: Sun, 2 Nov 2025 11:35:31 -0300
|
||||
Subject: Fixes around tbbbind functionality.
|
||||
|
||||
Make sure load_tbbbind_shared_object() returns something.
|
||||
|
||||
Also fix the build of the test: "test_tbbbind".
|
||||
|
||||
diff --git a/src/tbb/governor.cpp b/src/tbb/governor.cpp
|
||||
index 5a54e69..b6a8a99 100644
|
||||
--- a/src/tbb/governor.cpp
|
||||
+++ b/src/tbb/governor.cpp
|
||||
@@ -416,7 +416,7 @@ int (*get_default_concurrency_ptr)( int numa_id, int core_type_id, int max_threa
|
||||
void (*set_assertion_handler_ptr)( assertion_handler_type handler )
|
||||
= dummy_set_assertion_handler;
|
||||
|
||||
-#if _WIN32 || _WIN64 || __unix__ || __APPLE__
|
||||
+#if _WIN32 || _WIN64 || __unix__ || __APPLE__ || __HAIKU__
|
||||
|
||||
// Table describing how to link the handlers.
|
||||
static const dynamic_link_descriptor TbbBindLinkTable[] = {
|
||||
@@ -451,7 +451,7 @@ int core_types_count = 0;
|
||||
int* core_types_indexes = nullptr;
|
||||
|
||||
const char* load_tbbbind_shared_object() {
|
||||
-#if _WIN32 || _WIN64 || __unix__ || __APPLE__
|
||||
+#if _WIN32 || _WIN64 || __unix__ || __APPLE__ || __HAIKU__
|
||||
#if _WIN32 && !_WIN64
|
||||
// For 32-bit Windows applications, process affinity masks can only support up to 32 logical CPUs.
|
||||
SYSTEM_INFO si;
|
||||
diff --git a/src/tbb/load_tbbbind.h b/src/tbb/load_tbbbind.h
|
||||
index 21ce239..d794c3f 100644
|
||||
--- a/src/tbb/load_tbbbind.h
|
||||
+++ b/src/tbb/load_tbbbind.h
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "oneapi/tbb/version.h" // __TBB_STRING
|
||||
|
||||
-#if _WIN32 || _WIN64 || __unix__ || __APPLE__
|
||||
+#if _WIN32 || _WIN64 || __unix__ || __APPLE__ || __HAIKU__
|
||||
|
||||
#if TBB_USE_DEBUG
|
||||
#define DEBUG_SUFFIX "_debug"
|
||||
@@ -34,7 +34,7 @@
|
||||
#elif __APPLE__
|
||||
#define LIBRARY_EXTENSION __TBB_STRING(.3.dylib)
|
||||
#define LIBRARY_PREFIX "lib"
|
||||
-#elif __unix__
|
||||
+#elif __unix__ || __HAIKU__
|
||||
#define LIBRARY_EXTENSION __TBB_STRING(.so.3)
|
||||
#define LIBRARY_PREFIX "lib"
|
||||
#endif /* __unix__ */
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
SUMMARY="High level abstract threading library"
|
||||
DESCRIPTION="Threading Building Blocks (TBB) is a C++ template library \
|
||||
developed by Intel for parallel programming on multi-core processors. Using \
|
||||
TBB, a computation is broken down into tasks that can run in parallel. The \
|
||||
library manages and schedules threads to execute these tasks."
|
||||
HOMEPAGE="https://www.threadingbuildingblocks.org/"
|
||||
COPYRIGHT="2005-2021 Intel Corporation"
|
||||
LICENSE="Apache v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/oneapi-src/oneTBB/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="e8e89c9c345415b17b30a2db3095ba9d47647611662073f7fbf54ad48b7f3c2a"
|
||||
SOURCE_DIR="oneTBB-$portVersion"
|
||||
PATCHES="tbb-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="?all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
libtbbVersion="12.14"
|
||||
libtbbVersionCompat="$libtbbVersion compat >= ${libtbbVersion%%.*}"
|
||||
libtbbbindVersion="3.14"
|
||||
libtbbbindVersionCompat="$libtbbbindVersion compat >= ${libtbbbindVersion%%.*}"
|
||||
libtbbmallocVersion="2.14"
|
||||
libtbbmallocVersionCompat="$libtbbmallocVersion compat >= ${libtbbmallocVersion%%.*}"
|
||||
libtbbmalloc_proxyVersion="2.14"
|
||||
libtbbmalloc_proxyVersionCompat="$libtbbmalloc_proxyVersion compat >= ${libtbbmalloc_proxyVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
tbb$secondaryArchSuffix = $portVersion
|
||||
lib:libtbb$secondaryArchSuffix = $libtbbVersionCompat
|
||||
lib:libtbbbind_2_5$secondaryArchSuffix = $libtbbbindVersionCompat
|
||||
lib:libtbbmalloc$secondaryArchSuffix = $libtbbmallocVersionCompat
|
||||
lib:libtbbmalloc_proxy$secondaryArchSuffix = $libtbbmalloc_proxyVersionCompat
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libhwloc$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
tbb${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libtbb$secondaryArchSuffix = $libtbbVersionCompat
|
||||
devel:libtbbbind_2_5$secondaryArchSuffix = $libtbbbindVersionCompat
|
||||
devel:libtbbmalloc$secondaryArchSuffix = $libtbbmallocVersionCompat
|
||||
devel:libtbbmalloc_proxy$secondaryArchSuffix = $libtbbmalloc_proxyVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
tbb$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
hwloc2${secondaryArchSuffix}_tools >= 2.10
|
||||
devel:libhwloc$secondaryArchSuffix >= 15.7.0
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
defineDebugInfoPackage tbb$secondaryArchSuffix \
|
||||
$libDir/libtbb.so.$libtbbVersion \
|
||||
$libDir/libtbbbind_2_5.so.$libtbbbindVersion \
|
||||
$libDir/libtbbmalloc.so.$libtbbmallocVersion \
|
||||
$libDir/libtbbmalloc_proxy.so.$libtbbmalloc_proxyVersion
|
||||
|
||||
BUILD()
|
||||
{
|
||||
mkdir -p build_haiku && cd build_haiku
|
||||
cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
$cmakeDirArgs \
|
||||
-DTBB_STRICT=OFF \
|
||||
-DTBB_TEST=OFF
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd build_haiku
|
||||
make install
|
||||
|
||||
prepareInstalledDevelLibs libtbb \
|
||||
libtbbbind_2_5 \
|
||||
libtbbmalloc \
|
||||
libtbbmalloc_proxy
|
||||
fixPkgconfig
|
||||
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
# 98% tests passed, 2 tests failed out of 129
|
||||
export LIBRARY_PATH="$sourceDir/build_haiku/gnu_13.3_cxx11_64_relwithdebinfo${LIBRARY_PATH:+:$LIBRARY_PATH}"
|
||||
# Running the tests in parallel often leads to resource exhaustion. (Fedora)
|
||||
ctest --test-dir build_haiku --output-on-failure --force-new-ctest-process
|
||||
}
|
||||
@@ -4,24 +4,25 @@ developed by Intel for parallel programming on multi-core processors. Using \
|
||||
TBB, a computation is broken down into tasks that can run in parallel. The \
|
||||
library manages and schedules threads to execute these tasks."
|
||||
HOMEPAGE="https://www.threadingbuildingblocks.org/"
|
||||
COPYRIGHT="2005-2021 Intel Corporation"
|
||||
COPYRIGHT="2005-2025 Intel Corporation"
|
||||
LICENSE="Apache v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/oneapi-src/oneTBB/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b"
|
||||
CHECKSUM_SHA256="01598a46c1162c27253a0de0236f520fd8ee8166e9ebb84a4243574f88e6e50a"
|
||||
SOURCE_DIR="oneTBB-$portVersion"
|
||||
PATCHES="tbb-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="?all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
libtbbVersion="12.10"
|
||||
libtbbVersion="12.17"
|
||||
libtbbVersionCompat="$libtbbVersion compat >= ${libtbbVersion%%.*}"
|
||||
libtbbbindVersion="3.10"
|
||||
libtbbbindVersion="3.17"
|
||||
libtbbbindVersionCompat="$libtbbbindVersion compat >= ${libtbbbindVersion%%.*}"
|
||||
libtbbmallocVersion="2.10"
|
||||
libtbbmallocVersion="2.17"
|
||||
libtbbmallocVersion="2.17"
|
||||
libtbbmallocVersionCompat="$libtbbmallocVersion compat >= ${libtbbmallocVersion%%.*}"
|
||||
libtbbmalloc_proxyVersion="2.10"
|
||||
libtbbmalloc_proxyVersion="2.17"
|
||||
libtbbmalloc_proxyVersionCompat="$libtbbmalloc_proxyVersion compat >= ${libtbbmalloc_proxyVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
@@ -43,14 +44,14 @@ PROVIDES_devel="
|
||||
devel:libtbbmalloc$secondaryArchSuffix = $libtbbmallocVersionCompat
|
||||
devel:libtbbmalloc_proxy$secondaryArchSuffix = $libtbbmalloc_proxyVersionCompat
|
||||
"
|
||||
|
||||
REQUIRES_devel="
|
||||
tbb$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
hwloc2${secondaryArchSuffix}_tools >= 2.10
|
||||
devel:libhwloc$secondaryArchSuffix >= 15.7.0
|
||||
devel:libhwloc$secondaryArchSuffix >= 15.7 # we want hwloc2_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
@@ -62,30 +63,30 @@ BUILD_PREREQUIRES="
|
||||
defineDebugInfoPackage tbb$secondaryArchSuffix \
|
||||
$libDir/libtbb.so.$libtbbVersion \
|
||||
$libDir/libtbbbind_2_5.so.$libtbbbindVersion \
|
||||
$libDir/libtbbmalloc.so.$libtbbmallocVersion \
|
||||
$libDir/libtbbmalloc_proxy.so.$libtbbmalloc_proxyVersion
|
||||
$libDir/libtbbmalloc_proxy.so.$libtbbmalloc_proxyVersion \
|
||||
$libDir/libtbbmalloc.so.$libtbbmallocVersion
|
||||
|
||||
BUILD()
|
||||
{
|
||||
mkdir -p build_haiku && cd build_haiku
|
||||
cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
cmake -B build -S . \
|
||||
$cmakeDirArgs \
|
||||
-DTBB_STRICT=OFF \
|
||||
-DTBB_TEST=OFF
|
||||
make $jobArgs
|
||||
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-D TBB_STRICT=OFF \
|
||||
-D TBB_TEST=OFF # Gives me "virtual memory exhausted: Out of memory" with 4 GB of RAM.
|
||||
|
||||
make -C build $jobArgs
|
||||
}
|
||||
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd build_haiku
|
||||
make install
|
||||
make -C build install
|
||||
|
||||
prepareInstalledDevelLibs libtbb \
|
||||
libtbbbind_2_5 \
|
||||
libtbbmalloc \
|
||||
libtbbmalloc_proxy
|
||||
|
||||
fixPkgconfig
|
||||
|
||||
# devel package
|
||||
@@ -94,10 +95,26 @@ INSTALL()
|
||||
$libDir/cmake
|
||||
}
|
||||
|
||||
# Don't forget to enable -D TBB_TEST=ON before trying to run "hp tbb --test".
|
||||
#
|
||||
# Reference results (2022.3.0, beta5):
|
||||
#
|
||||
# 96% tests passed, 6 tests failed out of 140
|
||||
# Total Test time (real) = 100.26 sec
|
||||
#
|
||||
# The following tests FAILED:
|
||||
# 25 - test_task_arena (Failed)
|
||||
# 71 - test_arena_constraints (SEGFAULT)
|
||||
# 72 - test_tbbbind (Signal 21)
|
||||
# 126 - conformance_arena_constraints (Failed)
|
||||
# 129 - test_malloc_init_shutdown (Subprocess aborted)
|
||||
# 132 - test_malloc_compliance (Failed)
|
||||
TEST()
|
||||
{
|
||||
# 98% tests passed, 2 tests failed out of 129
|
||||
export LIBRARY_PATH="$sourceDir/build_haiku/gnu_13.3_cxx11_64_relwithdebinfo${LIBRARY_PATH:+:$LIBRARY_PATH}"
|
||||
export LIBRARY_PATH="$sourceDir/build/gnu_13.3_cxx11_64_relwithdebinfo${LIBRARY_PATH:+:$LIBRARY_PATH}"
|
||||
|
||||
# Running the tests in parallel often leads to resource exhaustion. (Fedora)
|
||||
ctest --test-dir build_haiku --output-on-failure --force-new-ctest-process
|
||||
ctest --test-dir build --output-on-failure --force-new-ctest-process \
|
||||
-E "(test_tbbbind)"
|
||||
# excluding test_tbbbind to avoid the Debugger dialog popping up.
|
||||
}
|
||||
Reference in New Issue
Block a user