{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");