| Summary: | drd/tests/swapcontext.c doesn't build with musl | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Yi Fan Yu <yifan.yu> |
| Component: | drd | Assignee: | Bart Van Assche <bart.vanassche+kde> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | rwmacleod |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | proposed patch (yocto/oe-core fix) | ||
|
Description
Yi Fan Yu
2021-03-22 16:04:20 UTC
Created attachment 136947 [details]
proposed patch (yocto/oe-core fix)
I took a look at the attached patch and noticed multiple new #ifdefs. I'm concerned that adding so many #ifdefs would make the test harder to maintain. So I added a configure test for swapcontext(). Can you take a look at commit c9e88f3459e2 ("configure, drd: Only build the swapcontext test if swapcontext() is available") and verify whether that is sufficient to make Valgrind build again against musl?
I tried applying that patch to oe-core build and it still fails with this: So musl does provide <swapcontext.h> as a header, but you cannot link to any of the *context calls. The error is a linker failure. ``` /ala-lpggp31/yyu1/oe-core/build/tmp-musl/work/core2-64-oe-linux-musl/valgrind/3.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux-musl/../../libexec/x86_64-oe-linux-musl/gcc/x8: | /usr/src/debug/valgrind/3.17.0-r0/valgrind-3.17.0/memcheck/tests/linux/stack_changes.c:23: undefined reference to `setcontext' | /ala-lpggp31/yyu1/oe-core/build/tmp-musl/work/core2-64-oe-linux-musl/valgrind/3.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux-musl/../../libexec/x86_64-oe-linux-musl/gcc/x8: | /usr/src/debug/valgrind/3.17.0-r0/valgrind-3.17.0/memcheck/tests/linux/stack_changes.c:31: undefined reference to `getcontext' | /ala-lpggp31/yyu1/oe-core/build/tmp-musl/work/core2-64-oe-linux-musl/valgrind/3.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux-musl/../../libexec/x86_64-oe-linux-musl/gcc/x8: | /usr/src/debug/valgrind/3.17.0-r0/valgrind-3.17.0/memcheck/tests/linux/stack_changes.c:60: undefined reference to `makecontext' | /ala-lpggp31/yyu1/oe-core/build/tmp-musl/work/core2-64-oe-linux-musl/valgrind/3.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux-musl/../../libexec/x86_64-oe-linux-musl/gcc/x8' | /ala-lpggp31/yyu1/oe-core/build/tmp-musl/work/core2-64-oe-linux-musl/valgrind/3.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux-musl/../../libexec/x86_64-oe-linux-musl/gcc/x8' | collect2: error: ld returned 1 exit status ``` Please retest with commit 7cd4d78163fa ("memcheck/tests/linux/stack_changes: Only run this test if setcontext() is available").
build with musl is successful. |