diff --git a/devel/onetbb/Makefile b/devel/onetbb/Makefile index 03bd6142e1aa..bceb1248f3e9 100644 --- a/devel/onetbb/Makefile +++ b/devel/onetbb/Makefile @@ -1,51 +1,52 @@ PORTNAME= onetbb DISTVERSIONPREFIX= v DISTVERSION= 2022.3.0 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= martymac@FreeBSD.org COMMENT= Library that provides thread building blocks WWW= https://software.intel.com/oneapi/onetbb LICENSE= APACHE20 LIB_DEPENDS= libhwloc.so:devel/hwloc2 USES= cmake:testing compiler:c++11-lang localbase:ldflags pathfix pkgconfig USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= uxlfoundation GH_PROJECT= oneTBB CONFLICTS= tbb # Many symbols in the linker version scripts are undefined because link time # optimization (-flto=thin) removes them. Suppress errors with lld >= 17 due to # these undefined symbols. LDFLAGS+= -Wl,--undefined-version # Pkgconfig: tbb.pc (on 64bit arch) vs tbb32.pc PLIST_SUB= DBGSUFX="${DBGSUFX}" \ PCSUFX="${PCSUFX}" PORTDOCS= README.md CMAKE_TESTING_ON= TBB_TEST CMAKE_OFF= TBB_STRICT \ TBB_TEST CMAKE_ARGS= -DCMAKE_INSTALL_DOCDIR:PATH="${DOCSDIR}" OPTIONS_DEFINE= DOCS .include .if defined(WITH_DEBUG) DBGSUFX= _debug .endif .if ${ARCH} == i386 || ${ARCH} == powerpc || ${ARCH:Marmv?} PCSUFX= 32 .endif .include diff --git a/devel/onetbb/files/patch-test_CMakeLists.txt b/devel/onetbb/files/patch-test_CMakeLists.txt new file mode 100644 index 000000000000..fc236b0630c8 --- /dev/null +++ b/devel/onetbb/files/patch-test_CMakeLists.txt @@ -0,0 +1,24 @@ +--- test/CMakeLists.txt.orig 2026-01-12 07:56:34 UTC ++++ test/CMakeLists.txt +@@ -86,6 +86,10 @@ function(tbb_add_test) + + target_link_libraries(${_tbb_test_TARGET_NAME} PRIVATE ${_tbb_test_DEPENDENCIES} Threads::Threads ${TBB_COMMON_LINK_LIBS}) + ++ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ target_link_libraries(${_tbb_test_TARGET_NAME} PRIVATE util) ++ endif() ++ + if (COMMAND _tbb_run_memcheck) + _tbb_run_memcheck(${_tbb_test_NAME} ${_tbb_test_SUBDIR}) + endif() +@@ -706,6 +710,10 @@ if (TARGET TBB::tbbmalloc) + target_link_libraries(test_malloc_whitebox PRIVATE ${TBB_COMMON_LINK_FLAGS}) + endif() + target_link_libraries(test_malloc_whitebox PRIVATE Threads::Threads ${TBB_COMMON_LINK_LIBS}) ++ ++ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ target_link_libraries(test_malloc_whitebox PRIVATE util) ++ endif() + endif() + # ------------------------------------------------------------------------------------------ + diff --git a/devel/onetbb/files/patch-test_common_memory_usage.h b/devel/onetbb/files/patch-test_common_memory_usage.h new file mode 100644 index 000000000000..b3d8459524b8 --- /dev/null +++ b/devel/onetbb/files/patch-test_common_memory_usage.h @@ -0,0 +1,34 @@ +--- test/common/memory_usage.h.orig 2025-10-29 11:31:36 UTC ++++ test/common/memory_usage.h +@@ -26,6 +26,13 @@ + #include "utils.h" + #include "utils_assert.h" + ++#if __FreeBSD__ ++#include ++#include ++#include ++#include ++#endif ++ + #if __unix__ || __sun + #include + #include +@@ -93,6 +100,17 @@ namespace utils { + bool status = GetProcessMemoryInfo(GetCurrentProcess(), &mem, sizeof(mem)) != 0; + ASSERT(status, nullptr); + return stat == currentUsage ? mem.PagefileUsage : mem.PeakPagefileUsage; ++#elif __FreeBSD__ ++ /* Inspired from sys/compat/linprocfs/linprocfs.c */ ++ long unsigned size = 0; ++ struct kinfo_proc *kip = kinfo_getproc(getpid()); ++ ASSERT(kip != nullptr, "Failed to get process info."); ++ size = (long unsigned)kip->ki_size; ++ free (kip); ++ // VmPeak not supported ++ if (stat == peakUsage) ++ ASSERT(size, "VmPeak not supported."); ++ return size; + #elif __unix__ + long unsigned size = 0; + FILE* fst = fopen("/proc/self/status", "r");