tests: fix build on musl-based systems - #775
Merged
Merged
Conversation
akodanev
force-pushed
the
ak/fix-musl-tests-build
branch
2 times, most recently
from
September 25, 2025 07:23
4c46335 to
8e04ef6
Compare
Contributor
Author
|
Only mkosi/boot fedora* checks fail. All are as follows: This is unrelated to the test build in the PR, but rather to recent changes in f44 that may be possible in binutils (2.45.50-3.fc44). |
Contributor
Author
|
I checked the previous version in f44, downgrading from 2.45.50-3.fc44 to 2.45-1.fc43 fixes objcopy. |
bluca
reviewed
Sep 25, 2025
akodanev
force-pushed
the
ak/fix-musl-tests-build
branch
from
September 26, 2025 12:06
8e04ef6 to
6f6e71c
Compare
Musl libc does not provide the backtrace functions in its implementation. These functions are typically provided by glibc's <execinfo.h>. As a fallback for musl-based systems, support linking against the external libunwind library and using dladdr() to obtain similar stack trace info. Note that the usage of dladdr() is similar to that of backtrace_symbols in glibc, and it can be used with glibc as well. Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
GNUC_PREREQ macro is provided by shim.h and implements the same functionality. Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
akodanev
force-pushed
the
ak/fix-musl-tests-build
branch
from
March 20, 2026 12:05
6f6e71c to
142d4a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses two issues related to glibc-specific usage in the tests to ensure they can be built with musl libc too:
__GNUC_PREREQmacro fromfeatures.h- replaced with GNUC_PREREQ that is provided byshim.hand implements the same functionality.execinfo.h(backtrace functions) - musl libc does not provide the backtrace functions in its implementation. These functions are typically provided by glibc'sexecinfo.h. As a fallback for musl-based systems, support linking against the external libunwind library and using dladdr() to obtain similar stack trace info. Note that the usage of dladdr() is similar to that of backtrace_symbols in glibc, and it can be used with glibc as well.