Revert "dev-cpp/tbb: drop versions"

This reverts commit 8ff260f7dc.

This breaks sci-libs/spqr.

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2026-06-05 20:19:47 +01:00
parent d7ad91175d
commit 03ce8236d7
14 changed files with 784 additions and 0 deletions

View File

@@ -1,2 +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

View File

@@ -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)

View File

@@ -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

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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()

View File

@@ -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;
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}