From ecd11a12cb68ec762d3759c93575c646ba6d1225 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Thu, 25 Sep 2025 22:29:51 +0300 Subject: [PATCH] onetbb: fix build with gcc15 - add patch from merged upstream PR: https://www.github.com/uxlfoundation/oneTBB/pull/1831 https://github.com/uxlfoundation/oneTBB/commit/712ad98443300aab202f5e93a76472d59b79752a Fixes build failure with gcc15: ``` FAILED: [code=1] test/CMakeFiles/test_concurrent_unordered_map.dir/tbb/test_concurrent_unordered_map.cpp.o ... /nix/store/rd8c9w16nwys8yz1a9j2g2nhjn07464r-gcc-15.2.0/include/c++/15.2.0/bits/new_allocator.h:198:11: error: array subscript 2 is outside array bounds of 'StaticSharedCountingAllocator > >::value_type [1]' {aka 'tbb::detail::d2::list_node [1]'} [-Werror=array-bounds=] 198 | { __p->~_Up(); } | ^~~ compilation terminated due to -Wfatal-errors. cc1plus: all warnings being treated as errors ... FAILED: [code=1] test/CMakeFiles/test_concurrent_unordered_set.dir/tbb/test_concurrent_unordered_set.cpp.o ... /build/source/src/tbb/../../include/tbb/../oneapi/tbb/detail/_concurrent_unordered_base.h:172:20: error: array subscript 'tbb::detail::d2::value_node > >, long unsigned int>[0]' is partly outside array bounds of 'unsigned char [16]' [-Werror=array-bounds=] 172 | ~value_node() {} | ^ compilation terminated due to -Wfatal-errors. cc1plus: all warnings being treated as errors ``` --- pkgs/by-name/on/onetbb/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/on/onetbb/package.nix b/pkgs/by-name/on/onetbb/package.nix index 6cebaf75422c..45b6f91b01d3 100644 --- a/pkgs/by-name/on/onetbb/package.nix +++ b/pkgs/by-name/on/onetbb/package.nix @@ -49,6 +49,14 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/uxlfoundation/oneTBB/commit/e57411968661ab1205322ba1c84fc1cd90a306c6.patch"; hash = "sha256-PFixW4lYqA5oy4LSwewvxgJbjVKJceRHnp8mgW9zBF0="; }) + + # Fix build with gcc15 + # + (fetchpatch { + name = "onetbb-fix-gcc15-build.patch"; + url = "https://github.com/uxlfoundation/oneTBB/commit/712ad98443300aab202f5e93a76472d59b79752a.patch"; + hash = "sha256-4qoVCy3xQZK6Vp471miE79FSrU0D0Iu6KWMJ08m0EsE="; + }) ]; nativeBuildInputs = [