tbb: Fix ptest build on musl
PATCH 1/1 tbb: Fix ptest build on musl
Two tests fail to compile on musl:
- conformance_resumable_tasks uses its own platform list instead of __TBB_RESUMABLE_TASKS, which the library leaves disabled on Linux without glibc, so tbb::task::suspend() is not declared.
- test_malloc_overload calls mallopt(), mallinfo() and pvalloc(), which are glibc extensions musl does not provide.
Guard both on what is actually available. All 142 tbb ptests pass in meta-oe-image-ptest-tbb on qemux86-64 musl.
AI-Generated: Uses Claude Code
Signed-off-by Khem Raj <[email protected]>
--- ...mance_resumable_tasks-when-resumable.patch | 27 +++++++++ ...load-Only-use-glibc-malloc-extension.patch | 57 +++++++++++++++++++ meta-oe/recipes-support/tbb/tbb_2023.1.0.bb | 2 + 3 files changed, 86 insertions(+) create mode 100644 meta-oe/recipes-support/tbb/files/0001-test-Skip-conformance_resumable_tasks-when-resumable.patch create mode 100644 meta-oe/recipes-support/tbb/files/0002-test-malloc_overload-Only-use-glibc-malloc-extension.patch
meta-oe/recipes-support/tbb/files/0001-test-Skip-conformance_resumable_tasks-when-resumable.patch new file +27 -0
@@ -0,0 +1,27 @@ +From: Khem Raj <[email protected]> +Subject: [PATCH] test: Skip conformance_resumable_tasks when resumable tasks are disabled + +The library only enables resumable tasks when __TBB_RESUMABLE_TASKS is +set, which excludes Linux with a C library other than glibc (e.g. musl). +test_resumable_tasks.cpp checks that macro, but the conformance test +repeats an older list of platforms and fails to build on musl: + + conformance_resumable_tasks.cpp:39:5: error: no member named 'suspend' in namespace 'tbb::task' + +Use __TBB_RESUMABLE_TASKS instead, keeping the WINAPI_FAMILY exclusion. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- +--- a/test/conformance/conformance_resumable_tasks.cpp ++++ b/test/conformance/conformance_resumable_tasks.cpp +@@ -17,8 +17,7 @@ + + #include "common/test.h" + +-#if (!__TBB_WIN8UI_SUPPORT && !defined(WINAPI_FAMILY) && !__ANDROID__ \ +- && !__QNX__) ++#if __TBB_RESUMABLE_TASKS && !defined(WINAPI_FAMILY) + + #include "oneapi/tbb/task.h" + #include "oneapi/tbb/task_group.h"
meta-oe/recipes-support/tbb/files/0002-test-malloc_overload-Only-use-glibc-malloc-extension.patch new file +57 -0
57 lines not on this page · raw message
meta-oe/recipes-support/tbb/tbb_2023.1.0.bb +2 -0
@@ -16,6 +16,8 @@ BRANCH = "onetbb_2023" SRCREV = "3046c8b0c29df995980003ea24f4d78c80ec0c8d" SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \ file://run-ptest \ + file://0001-test-Skip-conformance_resumable_tasks-when-resumable.patch \ + file://0002-test-malloc_overload-Only-use-glibc-malloc-extension.patch \ " LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"