summaryrefslogtreecommitdiff
path: root/dev-cpp/tbb
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-cpp/tbb
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-cpp/tbb')
-rw-r--r--dev-cpp/tbb/Manifest8
-rw-r--r--dev-cpp/tbb/files/tbb-2020.1-makefile-debug.patch62
-rw-r--r--dev-cpp/tbb/files/tbb-2020.3-gcc13.patch35
-rw-r--r--dev-cpp/tbb/files/tbb-2020.3-musl.patch22
-rw-r--r--dev-cpp/tbb/files/tbb-2021.13.0-test-atomics.patch38
-rw-r--r--dev-cpp/tbb/files/tbb-2021.7.0-abort.patch11
-rw-r--r--dev-cpp/tbb/files/tbb-2021.7.0-dynamicLink.patch10
-rw-r--r--dev-cpp/tbb/files/tbb-2021.7.0-pthread-eagain.patch135
-rw-r--r--dev-cpp/tbb/files/tbb-2021.8.0-gcc-13.patch26
-rw-r--r--dev-cpp/tbb/files/tbb-2021.9.0-dynamicLink.patch10
-rw-r--r--dev-cpp/tbb/files/tbb-2021.9.0-ppc.patch12
-rw-r--r--dev-cpp/tbb/files/tbb-2022.0.0_do-not-fortify-source.patch42
-rw-r--r--dev-cpp/tbb/files/tbb-2022.3.0-cmake.patch33
-rw-r--r--dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch37
-rw-r--r--dev-cpp/tbb/metadata.xml20
-rw-r--r--dev-cpp/tbb/tbb-2020.3.ebuild155
-rw-r--r--dev-cpp/tbb/tbb-2021.12.0.ebuild58
-rw-r--r--dev-cpp/tbb/tbb-2021.13.0.ebuild59
-rw-r--r--dev-cpp/tbb/tbb-2021.7.0-r1.ebuild50
-rw-r--r--dev-cpp/tbb/tbb-2021.9.0.ebuild59
-rw-r--r--dev-cpp/tbb/tbb-2022.0.0-r1.ebuild60
-rw-r--r--dev-cpp/tbb/tbb-2022.1.0.ebuild60
-rw-r--r--dev-cpp/tbb/tbb-2022.3.0.ebuild62
23 files changed, 1064 insertions, 0 deletions
diff --git a/dev-cpp/tbb/Manifest b/dev-cpp/tbb/Manifest
new file mode 100644
index 000000000000..0114a8393263
--- /dev/null
+++ b/dev-cpp/tbb/Manifest
@@ -0,0 +1,8 @@
+DIST tbb-2020.3.tar.gz 2639788 BLAKE2B 3e92bccdc8179fc049379ccbb8ad7f615623177abc61d813b1a601020c345137bfd7d4c4600cf5b0d587e5ebef677635c3c8124d06b05fdd3325128ed8c9f84a SHA512 04c4b5501418792827190691d03d20d4dc1fd3cbbcf459a4d40c5c2281d964e658f31f133ad3907b78e17ed04f4ff16728ed89487ed0ce2cb239f23feb34bd87
+DIST tbb-2021.12.0.tar.gz 2617255 BLAKE2B 3e1db8b1972a7225c5355def66ae40006e6e0f0f97e2efff45dd361f724e348a2f0476bc14b59f89f5361cac6fa36a4973602467bc7fbb2b8b139a4ff4dd58de SHA512 64022bcb61cf7b2030a1bcc11168445ef9f0d69b70290233a7febb71cc7a12cc2282dddc045f84e30893efe276342f02fd78d176706268eeaefe9aac7446d4e9
+DIST tbb-2021.13.0.tar.gz 2613916 BLAKE2B 0edd2d8a966dba673e50827629491924140a302430f4380e7cd9914f3592eaf6515204c7267649237970a5482cc030f0c29cbddd1476f16caf46989f70041058 SHA512 1f536b98c4eb331c3ba21e4b36362c932d7852b974ea7237b5f7bffb0e996d76f688c7ac534cb56f5866cfdffd5d3f015521b4c2ca21e584503070782ca82a2f
+DIST tbb-2021.7.0.tar.gz 2571727 BLAKE2B 2977ef1a33d9bc7baa40e0e57c02e62798a09c6c66cdbe369f2702d87fd9877c3d97f8d83f71384028995ea0956f5c5630d4aaf4edbe68538e7c514d3b87085c SHA512 d314e3d88b85c96607a9eda15e3d808bf361eb562a534c59101929236e90c187883e7718e5435b5e7f01f4ee652c9765af95f5f173368b83997e4666b7403a49
+DIST tbb-2021.9.0.tar.gz 2579150 BLAKE2B f6f701df1605913770222689063ff422416f86f132fb3fbc80f383b7c52762d3804e75200ca4826906b16c66f674918bcfd78b16a1dafb499ca53a9d2b6652ec SHA512 2ece7f678ad7c8968c0ad5cda9f987e4b318c6d9735169e1039beb0ff8dfca18815835875211acc6c7068913d9b0bdd4c9ded22962b0bb48f4a0ce0f7b78f31c
+DIST tbb-2022.0.0.tar.gz 2654343 BLAKE2B eac1a8065e401f1329527ccb1db0a8d30eb54ca2d9180560cd3be2263a779d250a0bda4fc3fb11fede3c63e964490420f09d664a7e39071d9b6a6cf743349f8f SHA512 c87b84964b2c323f61895a532968dfa6413a774c177cffbf6e798a07e74e8da5d449144875771df0a1b02657eeb2a7ae4d41c6c432dbf7ea50e3d5a9ea9f8cd3
+DIST tbb-2022.1.0.tar.gz 3434602 BLAKE2B a6441be4830ac79d648eee37a534bb74e2298612237059e2d22778c3aebda7e9a73c58948c8f9e89603cb05270d63d412b28bdc13a7cc6b3f6683ed21f1c221a SHA512 7582748f7d0e0ab46ea6ee7771dfaf7fc08ca7ab7f274fb3373eae0e3411aaafbac192ece15008d9a3d9e8566f8737f96f3f4b5ccf11449ac089d5cd9ebb9eab
+DIST tbb-2022.3.0.tar.gz 6836514 BLAKE2B 466e599dca7a64608eaa4df2fe16e62261230446a961bfadc65b9cded9489ed0b5a1e2d9d2a9dd3d202b62ac32e10c2cfa9b1a3cf1e292347985ec7b0400a72f SHA512 fdc50589785b1949ca1dd4429bbcedb180be4b8966da5243ddd1f8e9f97310dd603681e0bb83c1d6c2d3e27932f577ef6739e4e82f3c54af147f4d6d906b39f1
diff --git a/dev-cpp/tbb/files/tbb-2020.1-makefile-debug.patch b/dev-cpp/tbb/files/tbb-2020.1-makefile-debug.patch
new file mode 100644
index 000000000000..b4313b375f59
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2020.1-makefile-debug.patch
@@ -0,0 +1,62 @@
+--- a/Makefile 2020-01-21 12:26:46.000000000 +0100
++++ b/Makefile 2020-03-18 16:21:37.589262099 +0100
+@@ -26,29 +26,29 @@
+ all: tbb tbbmalloc tbbproxy test examples
+
+ tbb: mkdir
+- $(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbb cfg=release
++ $(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.tbb cfg=$(cfg)
+
+ tbbmalloc: mkdir
+- $(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc
++ $(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=$(cfg) malloc
+
+ tbbproxy: mkdir
+- $(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=release tbbproxy
++ $(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=$(cfg) tbbproxy
+
+ tbbbind: mkdir
+- $(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbbind cfg=release tbbbind
++ $(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.tbbbind cfg=$(cfg) tbbbind
+
+ test: tbb tbbmalloc $(if $(use_proxy),tbbproxy)
+- -$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test
+- -$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release
++ -$(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=$(cfg) malloc_test
++ -$(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.test cfg=$(cfg)
+
+ rml: mkdir
+- $(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.rml cfg=release
++ $(MAKE) -C "$(work_dir)_$(cfg)" -r -f $(tbb_root)/build/Makefile.rml cfg=$(cfg)
+
+ examples: tbb tbbmalloc
+- $(MAKE) -C examples -r -f Makefile tbb_root=.. release test
++ $(MAKE) -C examples -r -f Makefile tbb_root=.. $(cfg) test
+
+ python: tbb
+- $(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/Makefile install
++ $(MAKE) -C "$(work_dir)_$(cfg)" -rf $(tbb_root)/python/Makefile install
+
+ doxygen:
+ doxygen Doxyfile
+@@ -56,16 +56,16 @@
+ .PHONY: clean clean_examples mkdir info
+
+ clean: clean_examples
+- $(shell $(RM) $(work_dir)_release$(SLASH)*.* >$(NUL) 2>$(NUL))
+- $(shell $(RD) $(work_dir)_release >$(NUL) 2>$(NUL))
++ $(shell $(RM) $(work_dir)_$(cfg)$(SLASH)*.* >$(NUL) 2>$(NUL))
++ $(shell $(RD) $(work_dir)_$(cfg) >$(NUL) 2>$(NUL))
+ @echo clean done
+
+ clean_examples:
+ $(shell $(MAKE) -s -i -r -C examples -f Makefile tbb_root=.. clean >$(NUL) 2>$(NUL))
+
+ mkdir:
+- $(shell $(MD) "$(work_dir)_release" >$(NUL) 2>$(NUL))
+- @echo Created the $(work_dir)_release directory
++ $(shell $(MD) "$(work_dir)_$(cfg)" >$(NUL) 2>$(NUL))
++ @echo Created the $(work_dir)_$(cfg) directory
+
+ info:
+ @echo OS: $(tbb_os)
diff --git a/dev-cpp/tbb/files/tbb-2020.3-gcc13.patch b/dev-cpp/tbb/files/tbb-2020.3-gcc13.patch
new file mode 100644
index 000000000000..1c0803048ca7
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2020.3-gcc13.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/899746
+https://github.com/oneapi-src/oneTBB/pull/833
+
+From c18342ba667d1f33f5e9a773aa86b091a9694b97 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Fri, 20 May 2022 07:50:00 +0100
+Subject: [PATCH] tbb_2020: fix build on gcc-13
+
+On gcc-13 build started failing due to 'task' identifier collision as:
+
+ ../../include/tbb/task.h:300:20: error: declaration of 'tbb::task& tbb::internal::task_prefix::task()' changes meaning of 'task' [-fpermissive]
+ 300 | tbb::task& task() {return *reinterpret_cast<tbb::task*>(this+1);}
+ | ^~~~
+ ../../include/tbb/task.h:252:9: note: used here to mean 'class tbb::task'
+ 252 | task* next_offloaded;
+ | ^~~~
+ ../../include/tbb/task.h:43:7: note: declared here
+ 43 | class task;
+ | ^~~~
+
+The change adds explicit qualifier to class name to avoid ambiguity with method name.
+
+Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
+--- a/include/tbb/task.h
++++ b/include/tbb/task.h
+@@ -249,7 +249,7 @@ namespace internal {
+ #if __TBB_TASK_PRIORITY
+ //! Pointer to the next offloaded lower priority task.
+ /** Used to maintain a list of offloaded tasks inside the scheduler. **/
+- task* next_offloaded;
++ tbb::task* next_offloaded;
+ #endif
+
+ #if __TBB_PREVIEW_RESUMABLE_TASKS
+
diff --git a/dev-cpp/tbb/files/tbb-2020.3-musl.patch b/dev-cpp/tbb/files/tbb-2020.3-musl.patch
new file mode 100644
index 000000000000..b70dc14f9bd8
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2020.3-musl.patch
@@ -0,0 +1,22 @@
+--- a/src/tbbmalloc/proxy.cpp 2026-03-27 10:55:33.235747857 +0100
++++ b/src/tbbmalloc/proxy.cpp 2026-03-27 11:06:44.816616969 +0100
+@@ -24,7 +24,8 @@
+ // of aligned_alloc as required by new C++ standard, this makes it hard to
+ // redefine aligned_alloc here. However, running on systems with new libc
+ // version, it still needs it to be redefined, thus tricking system headers
+-#if defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC
++#if defined(__GLIBC_PREREQ)
++#if !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC
+ // tell <cstdlib> that there is no aligned_alloc
+ #undef _GLIBCXX_HAVE_ALIGNED_ALLOC
+ // trick <stdlib.h> to define another symbol instead
+@@ -32,7 +33,8 @@
+ // Fix the state and undefine the trick
+ #include <cstdlib>
+ #undef aligned_alloc
+-#endif // defined(__GLIBC_PREREQ)&&!__GLIBC_PREREQ(2, 16)&&_GLIBCXX_HAVE_ALIGNED_ALLOC
++#endif // !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC
++#endif // defined(__GLIBC_PREREQ)
+ #endif // __linux__ && !__ANDROID__
+
+ #include "proxy.h"
diff --git a/dev-cpp/tbb/files/tbb-2021.13.0-test-atomics.patch b/dev-cpp/tbb/files/tbb-2021.13.0-test-atomics.patch
new file mode 100644
index 000000000000..7cc8216153d0
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.13.0-test-atomics.patch
@@ -0,0 +1,38 @@
+From c828ae47b8f4bea7736d2f9d05460e2b529c9d7d 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 cd76acfe1e..59f4e6934f 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)
diff --git a/dev-cpp/tbb/files/tbb-2021.7.0-abort.patch b/dev-cpp/tbb/files/tbb-2021.7.0-abort.patch
new file mode 100644
index 000000000000..0a7deec96a5d
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.7.0-abort.patch
@@ -0,0 +1,11 @@
+--- a/test/common/utils_assert.h 2026-03-27 11:39:14.886058730 +0100
++++ b/test/common/utils_assert.h 2026-03-27 11:40:24.429306039 +0100
+@@ -20,6 +20,8 @@
+ #include "config.h"
+ #include "utils_report.h"
+
++#include <cstdlib>
++
+ #define REPORT_FATAL_ERROR REPORT
+
+ namespace utils {
diff --git a/dev-cpp/tbb/files/tbb-2021.7.0-dynamicLink.patch b/dev-cpp/tbb/files/tbb-2021.7.0-dynamicLink.patch
new file mode 100644
index 000000000000..ca44d7985a30
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.7.0-dynamicLink.patch
@@ -0,0 +1,10 @@
+--- a/test/CMakeLists.txt 2026-03-27 13:13:21.627057086 +0100
++++ b/test/CMakeLists.txt 2026-03-27 13:17:16.113296894 +0100
+@@ -367,6 +367,7 @@
+ tbb_add_test(SUBDIR tbb NAME test_allocators DEPENDENCIES TBB::tbb)
+ tbb_add_test(SUBDIR tbb NAME test_arena_priorities DEPENDENCIES TBB::tbb)
+ tbb_add_test(SUBDIR tbb NAME test_dynamic_link DEPENDENCIES TBB::tbb)
++ set_target_properties(test_dynamic_link PROPERTIES ENABLE_EXPORTS TRUE)
+ if (WIN32)
+ tbb_add_test(SUBDIR tbb NAME test_numa_dist DEPENDENCIES TBB::tbb)
+ endif()
diff --git a/dev-cpp/tbb/files/tbb-2021.7.0-pthread-eagain.patch b/dev-cpp/tbb/files/tbb-2021.7.0-pthread-eagain.patch
new file mode 100644
index 000000000000..6c0912ec96b7
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.7.0-pthread-eagain.patch
@@ -0,0 +1,135 @@
+https://bugs.gentoo.org/881161
+https://github.com/rui314/mold/issues/410
+https://github.com/oneapi-src/oneTBB/commit/ceacd2207edfb72a8fc235213265afe68ce74ad0
+https://github.com/oneapi-src/oneTBB/commit/137c1a88b690acf3525e0f279720ac489ce66481
+
+From ceacd2207edfb72a8fc235213265afe68ce74ad0 Mon Sep 17 00:00:00 2001
+From: Ilya Isaev <ilya.isaev@intel.com>
+Date: Wed, 26 Oct 2022 13:13:51 +0200
+Subject: [PATCH] Rework test_eh_thread to avoid sporadic failures (#946)
+
+Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
+--- a/test/tbb/test_eh_thread.cpp
++++ b/test/tbb/test_eh_thread.cpp
+@@ -54,15 +54,16 @@ void limitThreads(size_t limit)
+ CHECK_MESSAGE(0 == ret, "setrlimit has returned an error");
+ }
+
+-static bool g_exception_caught = false;
+-static std::mutex m;
+-static std::condition_variable cv;
+-static std::atomic<bool> stop{ false };
++size_t getThreadLimit() {
++ rlimit rlim;
++
++ int ret = getrlimit(RLIMIT_NPROC, &rlim);
++ CHECK_MESSAGE(0 == ret, "getrlimit has returned an error");
++ return rlim.rlim_cur;
++}
+
+ static void* thread_routine(void*)
+ {
+- std::unique_lock<std::mutex> lock(m);
+- cv.wait(lock, [] { return stop == true; });
+ return nullptr;
+ }
+
+@@ -94,32 +95,17 @@ TEST_CASE("Too many threads") {
+ }
+
+ // Some systems set really big limit (e.g. >45К) for the number of processes/threads
+- limitThreads(1024);
+-
+- std::thread /* isolate test */ ([] {
+- std::vector<Thread> threads;
+- stop = false;
+- auto finalize = [&] {
+- stop = true;
+- cv.notify_all();
+- for (auto& t : threads) {
+- t.join();
+- }
+- };
+-
+- for (int i = 0;; ++i) {
++ limitThreads(1);
++ if (getThreadLimit() == 1) {
++ for (int attempt = 0; attempt < 5; ++attempt) {
+ Thread thread;
+- if (!thread.isValid()) {
+- break;
+- }
+- threads.push_back(thread);
+- if (i == 1024) {
+- WARN_MESSAGE(false, "setrlimit seems having no effect");
+- finalize();
++ if (thread.isValid()) {
++ WARN_MESSAGE(false, "We were able to create a thread. setrlimit seems having no effect");
++ thread.join();
+ return;
+ }
+ }
+- g_exception_caught = false;
++ bool g_exception_caught = false;
+ try {
+ // Initialize the library to create worker threads
+ tbb::parallel_for(0, 2, [](int) {});
+@@ -132,9 +118,10 @@ TEST_CASE("Too many threads") {
+ }
+ // Do not CHECK to avoid memory allocation (we can be out of memory)
+ if (!g_exception_caught) {
+- FAIL("No exception was caught");
++ FAIL("No exception was thrown on library initialization");
+ }
+- finalize();
+- }).join();
++ } else {
++ WARN_MESSAGE(false, "setrlimit seems having no effect");
++ }
+ }
+ #endif
+
+From 137c1a88b690acf3525e0f279720ac489ce66481 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@cs.stanford.edu>
+Date: Wed, 26 Oct 2022 04:54:20 -0700
+Subject: [PATCH] Retry if pthread_create fails with EAGAIN (#824)
+
+Signed-off-by: Rui Ueyama <ruiu@cs.stanford.edu>
+--- a/src/tbb/rml_thread_monitor.h
++++ b/src/tbb/rml_thread_monitor.h
+@@ -31,6 +31,7 @@
+ #include <pthread.h>
+ #include <cstring>
+ #include <cstdlib>
++#include <time.h>
+ #else
+ #error Unsupported platform
+ #endif
+@@ -191,8 +192,25 @@ inline thread_monitor::handle_type thread_monitor::launch( void* (*thread_routin
+ check(pthread_attr_init( &s ), "pthread_attr_init has failed");
+ if( stack_size>0 )
+ check(pthread_attr_setstacksize( &s, stack_size ), "pthread_attr_setstack_size has failed" );
++
++ // pthread_create(2) can spuriously fail with EAGAIN. We retry
++ // max_num_tries times with progressively longer wait times.
+ pthread_t handle;
+- check( pthread_create( &handle, &s, thread_routine, arg ), "pthread_create has failed" );
++ const int max_num_tries = 20;
++ int error = EAGAIN;
++
++ for (int i = 0; i < max_num_tries && error == EAGAIN; i++) {
++ if (i != 0) {
++ // Wait i milliseconds
++ struct timespec ts = {0, i * 1000 * 1000};
++ nanosleep(&ts, NULL);
++ }
++ error = pthread_create(&handle, &s, thread_routine, arg);
++ }
++
++ if (error)
++ handle_perror(error, "pthread_create has failed");
++
+ check( pthread_attr_destroy( &s ), "pthread_attr_destroy has failed" );
+ return handle;
+ }
+
diff --git a/dev-cpp/tbb/files/tbb-2021.8.0-gcc-13.patch b/dev-cpp/tbb/files/tbb-2021.8.0-gcc-13.patch
new file mode 100644
index 000000000000..84a0ba3dc7a1
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.8.0-gcc-13.patch
@@ -0,0 +1,26 @@
+https://github.com/oneapi-src/oneTBB/pull/1031
+
+From 363bf59bef2649b4d427788522da27c12f984a9a Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Tue, 21 Feb 2023 09:36:33 +0000
+Subject: [PATCH] test: common: include <cstdlib> for abort() (fix build with
+ GCC 13)
+
+GCC 13 (as usual for new compiler releases) shuffles around some
+internal includes and so <cstdint> etc is no longer transitively included.
+
+See https://www.gnu.org/software/gcc/gcc-13/porting_to.html.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/test/common/utils_assert.h
++++ b/test/common/utils_assert.h
+@@ -20,6 +20,8 @@
+ #include "config.h"
+ #include "utils_report.h"
+
++#include <cstdlib>
++
+ #define REPORT_FATAL_ERROR REPORT
+
+ namespace utils {
+
diff --git a/dev-cpp/tbb/files/tbb-2021.9.0-dynamicLink.patch b/dev-cpp/tbb/files/tbb-2021.9.0-dynamicLink.patch
new file mode 100644
index 000000000000..77c9ca68ba0b
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.9.0-dynamicLink.patch
@@ -0,0 +1,10 @@
+--- a/test/CMakeLists.txt 2026-03-27 14:52:17.592128499 +0100
++++ b/test/CMakeLists.txt 2026-03-27 14:53:30.563265543 +0100
+@@ -375,6 +375,7 @@
+ tbb_add_test(SUBDIR tbb NAME test_allocators DEPENDENCIES TBB::tbb)
+ tbb_add_test(SUBDIR tbb NAME test_arena_priorities DEPENDENCIES TBB::tbb)
+ tbb_add_test(SUBDIR tbb NAME test_dynamic_link DEPENDENCIES TBB::tbb)
++ set_target_properties(test_dynamic_link PROPERTIES ENABLE_EXPORTS TRUE)
+ if (LINKER_HAS_NO_AS_NEEDED)
+ # The linker may not detect a dependency on pthread in static variable constructors.
+ target_link_libraries(test_dynamic_link PRIVATE "-Wl,--no-as-needed")
diff --git a/dev-cpp/tbb/files/tbb-2021.9.0-ppc.patch b/dev-cpp/tbb/files/tbb-2021.9.0-ppc.patch
new file mode 100644
index 000000000000..38a505c0384d
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.9.0-ppc.patch
@@ -0,0 +1,12 @@
+--- a/cmake/compilers/GNU.cmake 2026-04-04 21:14:34.206944192 +0200
++++ b/cmake/compilers/GNU.cmake 2026-04-04 21:15:30.092303279 +0200
+@@ -75,6 +75,9 @@
+ set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-fPIE -mxgot>)
+ set(TBB_TEST_LINK_FLAGS ${TBB_TEST_LINK_FLAGS} $<$<CONFIG:DEBUG>:-pie>)
+ endif()
++if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc")
++ set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD)
++endif()
+
+ set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
+ set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
diff --git a/dev-cpp/tbb/files/tbb-2022.0.0_do-not-fortify-source.patch b/dev-cpp/tbb/files/tbb-2022.0.0_do-not-fortify-source.patch
new file mode 100644
index 000000000000..d88a3a54c383
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2022.0.0_do-not-fortify-source.patch
@@ -0,0 +1,42 @@
+From: Filip Kobierski <fkobi@pm.me>
+
+patching just GCC and Clang as we only support that
+
+Bug: https://bugs.gentoo.org/922605
+---
+ cmake/compilers/Clang.cmake | 4 ----
+ cmake/compilers/GNU.cmake | 3 ---
+ 2 files changed, 7 deletions(-)
+
+diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake
+index a0297faa..a5c32d0e 100644
+--- a/cmake/compilers/Clang.cmake
++++ b/cmake/compilers/Clang.cmake
+@@ -72,10 +72,6 @@ endif()
+
+ set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
+
+-if (NOT CMAKE_CXX_FLAGS MATCHES "_FORTIFY_SOURCE")
+- set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
+-endif ()
+-
+ if (MINGW)
+ list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
+ endif()
+diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
+index da6b408a..857d0888 100644
+--- a/cmake/compilers/GNU.cmake
++++ b/cmake/compilers/GNU.cmake
+@@ -109,9 +109,6 @@ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-secur
+ if (NOT APPLE AND NOT MINGW)
+ set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
+ 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> )
+-endif ()
+
+ if (TBB_FILE_TRIM AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8)
+ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -ffile-prefix-map=${NATIVE_TBB_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${NATIVE_TBB_RELATIVE_BIN_PATH}/=)
+--
+2.45.2
+
diff --git a/dev-cpp/tbb/files/tbb-2022.3.0-cmake.patch b/dev-cpp/tbb/files/tbb-2022.3.0-cmake.patch
new file mode 100644
index 000000000000..707d7c8ee53e
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2022.3.0-cmake.patch
@@ -0,0 +1,33 @@
+--- a/examples/sycl/tbb-resumable-tasks-sycl/CMakeLists.txt 2026-04-04 22:48:28.264634270 +0200
++++ b/examples/sycl/tbb-resumable-tasks-sycl/CMakeLists.txt 2026-04-04 22:49:13.703104323 +0200
+@@ -12,7 +12,7 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
+-cmake_minimum_required (VERSION 3.4)
++cmake_minimum_required (VERSION 3.10)
+
+ if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
+ set(CMAKE_CXX_COMPILER "icx-cl")
+--- a/examples/sycl/tbb-async-sycl/CMakeLists.txt 2026-04-04 22:49:28.902927039 +0200
++++ b/examples/sycl/tbb-async-sycl/CMakeLists.txt 2026-04-04 22:49:47.044715444 +0200
+@@ -12,7 +12,7 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
+-cmake_minimum_required (VERSION 3.4)
++cmake_minimum_required (VERSION 3.10)
+
+ if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
+ set(CMAKE_CXX_COMPILER "icx-cl")
+--- a/examples/sycl/tbb-task-sycl/CMakeLists.txt 2026-04-04 22:50:02.325537219 +0200
++++ b/examples/sycl/tbb-task-sycl/CMakeLists.txt 2026-04-04 22:50:13.249409806 +0200
+@@ -12,7 +12,7 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
+-cmake_minimum_required (VERSION 3.4)
++cmake_minimum_required (VERSION 3.10)
+
+ if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
+ set(CMAKE_CXX_COMPILER "icx-cl")
diff --git a/dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch b/dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch
new file mode 100644
index 000000000000..ac8b3d756a0f
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2022.3.0-no-clobber-hardened.patch
@@ -0,0 +1,37 @@
+We already set these flags as appropriate in the toolchain.
+--- a/cmake/compilers/Clang.cmake
++++ b/cmake/compilers/Clang.cmake
+@@ -63,15 +63,11 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
+ endif()
+
+ # Clang flags to prevent compiler from optimizing out security checks
+-set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security -fPIC $<$<NOT:$<BOOL:${EMSCRIPTEN}>>:-fstack-protector-strong>)
+-
+-if (NOT APPLE AND NOT ANDROID_PLATFORM AND CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)")
+- set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} -fstack-clash-protection $<$<NOT:$<BOOL:${EMSCRIPTEN}>>:-fcf-protection=full>)
+-endif()
++set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security -fPIC)
+
+ # -z switch is not supported on MacOS
+ if (NOT APPLE)
+- set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
++ set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,noexecstack)
+ endif()
+
+ set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
+--- a/cmake/compilers/GNU.cmake
++++ b/cmake/compilers/GNU.cmake
+@@ -121,12 +121,7 @@ endif ()
+
+ # Gnu flags to prevent compiler from optimizing out security checks
+ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
+-set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
+- -fstack-protector-strong )
+-if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
+- set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fcf-protection=full>)
+-endif ()
+-set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
++set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security)
+
+ # -z switch is not supported on MacOS and MinGW
+ if (NOT APPLE AND NOT MINGW)
diff --git a/dev-cpp/tbb/metadata.xml b/dev-cpp/tbb/metadata.xml
new file mode 100644
index 000000000000..5326272ad872
--- /dev/null
+++ b/dev-cpp/tbb/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The Intel Threading Building Blocks is a library that helps you
+ leverage multi-core processor performance without having to be a
+ threading expert. It represents a higher-level, task-based
+ parallelism that abstracts platform details and threading mechanism
+ for performance and scalability.
+ </longdescription>
+ <upstream>
+ <bugs-to>https://github.com/uxlfoundation/oneTBB/issues</bugs-to>
+ <doc>https://github.com/uxlfoundation/oneTBB?tab=readme-ov-file#documentation</doc>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-cpp/tbb/tbb-2020.3.ebuild b/dev-cpp/tbb/tbb-2020.3.ebuild
new file mode 100644
index 000000000000..7ff327bd8f37
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2020.3.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic multilib-minimal multilib multibuild toolchain-funcs
+
+PV1="$(ver_cut 1)"
+PV2="$(ver_cut 2)"
+MY_PV="${PV1}_U${PV2}"
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/oneapi-src/oneTBB"
+SRC_URI="https://github.com/intel/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 ~riscv ~sparc x86"
+IUSE="debug examples"
+
+S="${WORKDIR}/oneTBB-${MY_PV}"
+
+DOCS=( CHANGES README README.md doc/Release_Notes.txt )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2020.1-makefile-debug.patch
+ "${FILESDIR}"/${PN}-2020.3-gcc13.patch
+ "${FILESDIR}"/${PN}-2020.3-musl.patch
+)
+
+src_prepare() {
+ default
+
+ find include -name \*.html -delete || die
+
+ # Give it a soname on FreeBSD
+ echo 'LIB_LINK_FLAGS += -Wl,-soname=$(BUILDING_LIBRARY)' >> build/FreeBSD.gcc.inc
+ # Set proper versionning on FreeBSD
+ sed -i -e '/.DLL =/s/$/.1/' build/FreeBSD.inc || die
+
+ use debug || sed -i -e '/_debug/d' Makefile
+}
+
+multilib_src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ # pc files are for debian and fedora compatibility
+ # some deps use them
+ cat <<-EOF > ${PN}.pc.template
+ prefix=${EPREFIX}/usr
+ libdir=\${prefix}/$(get_libdir)
+ includedir=\${prefix}/include
+ Name: ${PN}
+ Description: ${DESCRIPTION}
+ Version: ${PV}
+ URL: ${HOMEPAGE}
+ Cflags: -I\${includedir}
+ EOF
+ cp ${PN}.pc.template ${PN}.pc || die
+ cat <<-EOF >> ${PN}.pc
+ Libs: -L\${libdir} -ltbb
+ Libs.private: -lm -lrt
+ EOF
+ cp ${PN}.pc.template ${PN}malloc.pc || die
+ cat <<-EOF >> ${PN}malloc.pc
+ Libs: -L\${libdir} -ltbbmalloc
+ Libs.private: -lm -lrt
+ EOF
+ cp ${PN}.pc.template ${PN}malloc_proxy.pc || die
+ cat <<-EOF >> ${PN}malloc_proxy.pc
+ Libs: -L\${libdir} -ltbbmalloc_proxy
+ Libs.private: -lrt
+ Requires: tbbmalloc
+ EOF
+}
+
+local_src_compile() {
+ cd "${S}"
+
+ local comp arch
+ local bt buildtypes
+
+ case ${MULTILIB_ABI_FLAG} in
+ abi_x86_64) arch=x86_64 ;;
+ abi_x86_32) arch=ia32 ;;
+# abi_ppc_64) arch=ppc64 ;;
+# abi_ppc_32) arch=ppc32 ;;
+ esac
+
+ case "$(tc-getCXX)" in
+ *clang*) comp="clang" ;;
+ *g++*) comp="gcc" ;;
+ *ic*c) comp="icc" ;;
+ *) die "compiler $(tc-getCXX) not supported by build system" ;;
+ esac
+
+ if use debug ; then
+ buildtypes="release debug"
+ else
+ buildtypes="release"
+ fi
+
+ for bt in ${buildtypes}; do
+ CXX="$(tc-getCXX)" \
+ CC="$(tc-getCC)" \
+ AS="$(tc-getAS)" \
+ arch=${arch} \
+ CPLUS_FLAGS="${CXXFLAGS}" \
+ emake compiler=${comp} work_dir="${BUILD_DIR}" tbb_root="${S}" cfg=${bt} $@
+ done
+}
+
+multilib_src_compile() {
+ local_src_compile tbb tbbmalloc
+}
+
+multilib_src_test() {
+ local_src_compile test
+}
+
+multilib_src_install() {
+ local bt
+ local buildtypes
+ if use debug ; then
+ buildtypes="release debug"
+ else
+ buildtypes="release"
+ fi
+ for bt in ${buildtypes}; do
+ cd "${BUILD_DIR}_${bt}" || die
+ local l
+ for l in $(find . -name lib\*$(get_libname \*)); do
+ dolib.so ${l}
+ local bl=$(basename ${l})
+ dosym ${bl} /usr/$(get_libdir)/${bl%%.*}$(get_libname)
+ done
+ done
+
+ cd "${BUILD_DIR}" || die
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins *.pc
+}
+
+multilib_src_install_all() {
+ doheader -r include/*
+
+ einstalldocs
+
+ if use examples ; then
+ dodoc -r examples
+ docinto examples/build
+ dodoc build/*.inc
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
diff --git a/dev-cpp/tbb/tbb-2021.12.0.ebuild b/dev-cpp/tbb/tbb-2021.12.0.ebuild
new file mode 100644
index 000000000000..1bd9cb9fa412
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2021.12.0.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/oneapi-src/oneTBB"
+SRC_URI="https://github.com/oneapi-src/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.5-2.5-3.5"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.8.0-gcc-13.patch
+ "${FILESDIR}"/${PN}-2021.9.0-ppc.patch
+ "${FILESDIR}"/${PN}-2021.13.0-test-atomics.patch
+)
+
+src_prepare() {
+ # Has an #error to force compilation as C but links with C++ library, dies
+ # with GLIBCXX_ASSERTIONS as a result.
+ sed -i -e '/tbb_add_c_test(SUBDIR tbbmalloc NAME test_malloc_pure_c DEPENDENCIES TBB::tbbmalloc)/d' test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}
diff --git a/dev-cpp/tbb/tbb-2021.13.0.ebuild b/dev-cpp/tbb/tbb-2021.13.0.ebuild
new file mode 100644
index 000000000000..4cc18d3ee0cd
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2021.13.0.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/oneapi-src/oneTBB"
+SRC_URI="https://github.com/oneapi-src/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.5-2.5-3.5"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.8.0-gcc-13.patch
+ "${FILESDIR}"/${PN}-2021.9.0-ppc.patch
+ "${FILESDIR}"/${PN}-2021.13.0-test-atomics.patch
+ "${FILESDIR}"/${PN}-2022.0.0_do-not-fortify-source.patch
+)
+
+src_prepare() {
+ # Has an #error to force compilation as C but links with C++ library, dies
+ # with GLIBCXX_ASSERTIONS as a result.
+ sed -i -e '/tbb_add_c_test(SUBDIR tbbmalloc NAME test_malloc_pure_c DEPENDENCIES TBB::tbbmalloc)/d' test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}
diff --git a/dev-cpp/tbb/tbb-2021.7.0-r1.ebuild b/dev-cpp/tbb/tbb-2021.7.0-r1.ebuild
new file mode 100644
index 000000000000..14697638a200
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2021.7.0-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/oneapi-src/oneTBB"
+SRC_URI="https://github.com/oneapi-src/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.5-2.5-3.5"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.7.0-pthread-eagain.patch
+ "${FILESDIR}"/${PN}-2021.7.0-abort.patch
+ "${FILESDIR}"/${P}-dynamicLink.patch
+)
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}
diff --git a/dev-cpp/tbb/tbb-2021.9.0.ebuild b/dev-cpp/tbb/tbb-2021.9.0.ebuild
new file mode 100644
index 000000000000..210049d0641c
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2021.9.0.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/oneapi-src/oneTBB"
+SRC_URI="https://github.com/oneapi-src/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.5-2.5-3.5"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.8.0-gcc-13.patch
+ "${FILESDIR}"/${PN}-2021.9.0-ppc.patch
+ "${FILESDIR}"/${PN}-2021.13.0-test-atomics.patch
+ "${FILESDIR}"/${P}-dynamicLink.patch
+)
+
+src_prepare() {
+ # Has an #error to force compilation as C but links with C++ library, dies
+ # with GLIBCXX_ASSERTIONS as a result.
+ sed -i -e '/tbb_add_c_test(SUBDIR tbbmalloc NAME test_malloc_pure_c DEPENDENCIES TBB::tbbmalloc)/d' test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}
diff --git a/dev-cpp/tbb/tbb-2022.0.0-r1.ebuild b/dev-cpp/tbb/tbb-2022.0.0-r1.ebuild
new file mode 100644
index 000000000000..158dc20d4dc7
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2022.0.0-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/uxlfoundation/oneTBB"
+SRC_URI="https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.14-2.14-3.14"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.9.0-ppc.patch
+ "${FILESDIR}"/${PN}-2021.13.0-test-atomics.patch
+ "${FILESDIR}"/${PN}-2022.0.0_do-not-fortify-source.patch
+)
+
+src_prepare() {
+ # Has an #error to force compilation as C but links with C++ library, dies
+ # with GLIBCXX_ASSERTIONS as a result.
+ sed -i -e '/tbb_add_c_test(SUBDIR tbbmalloc NAME test_malloc_pure_c DEPENDENCIES TBB::tbbmalloc)/d' \
+ test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_EXAMPLES=OFF # TODO: add this
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}
diff --git a/dev-cpp/tbb/tbb-2022.1.0.ebuild b/dev-cpp/tbb/tbb-2022.1.0.ebuild
new file mode 100644
index 000000000000..ad520d93a9e0
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2022.1.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/uxlfoundation/oneTBB"
+SRC_URI="https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.15-2.15-3.15"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.9.0-ppc.patch
+ "${FILESDIR}"/${PN}-2021.13.0-test-atomics.patch
+ "${FILESDIR}"/${PN}-2022.0.0_do-not-fortify-source.patch
+)
+
+src_prepare() {
+ # Has an #error to force compilation as C but links with C++ library, dies
+ # with GLIBCXX_ASSERTIONS as a result.
+ sed -i -e '/tbb_add_c_test(SUBDIR tbbmalloc NAME test_malloc_pure_c DEPENDENCIES TBB::tbbmalloc)/d' \
+ test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_EXAMPLES=OFF # TODO: add this
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}
diff --git a/dev-cpp/tbb/tbb-2022.3.0.ebuild b/dev-cpp/tbb/tbb-2022.3.0.ebuild
new file mode 100644
index 000000000000..3e70e56bd082
--- /dev/null
+++ b/dev-cpp/tbb/tbb-2022.3.0.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="High level abstract threading library"
+HOMEPAGE="https://github.com/uxlfoundation/oneTBB"
+SRC_URI="https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/oneTBB-${PV}"
+
+LICENSE="Apache-2.0"
+# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
+# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
+SLOT="0/12.15-2.15-3.15"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2021.9.0-ppc.patch
+ "${FILESDIR}"/${PN}-2021.13.0-test-atomics.patch
+ "${FILESDIR}"/${PN}-2022.0.0_do-not-fortify-source.patch
+ "${FILESDIR}"/${PN}-2022.3.0-no-clobber-hardened.patch
+ "${FILESDIR}"/${PN}-2022.3.0-cmake.patch
+)
+
+src_prepare() {
+ # Has an #error to force compilation as C but links with C++ library, dies
+ # with GLIBCXX_ASSERTIONS as a result.
+ sed -i -e '/tbb_add_c_test(SUBDIR tbbmalloc NAME test_malloc_pure_c DEPENDENCIES TBB::tbbmalloc)/d' \
+ test/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Workaround for bug #912210
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local mycmakeargs=(
+ -DTBB_TEST=$(usex test)
+ -DTBB_EXAMPLES=OFF # TODO: add this
+ -DTBB_ENABLE_IPO=OFF
+ -DTBB_STRICT=OFF
+ )
+
+ cmake-multilib_src_configure
+}
+
+src_test() {
+ local CMAKE_SKIP_TESTS=()
+ if use elibc_musl; then
+ CMAKE_SKIP_TESTS=( conformance_resumable_tasks ) # Bug #864175
+ fi
+ cmake-multilib_src_test
+}