Skip site navigation (1)Skip section navigation (2)



index | | raw e-mail

diff --git a/devel/onetbb/Makefile b/devel/onetbb/Makefile
index 03bd6142e1aa..bceb1248f3e9 100644
--- a/devel/onetbb/Makefile
+++ b/devel/onetbb/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	onetbb
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2022.3.0
+PORTREVISION=	1
 CATEGORIES=	devel
 
 MAINTAINER=	martymac@FreeBSD.org
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 <unistd.h>
++#include <sys/types.h>
++#include <sys/user.h>
++#include <libutil.h>
++#endif
++
+ #if __unix__ || __sun
+ #include <sys/resource.h>
+ #include <unistd.h>
+@@ -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");


home | help