-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I#1973: fix build on musl libc #7168
base: master
Are you sure you want to change the base?
Conversation
This introduces the MUSL macro.
bits/wordsize.h is a glibc-specific header, on musl __WORD_SIZE is defined as LONG_BIT. This is okay since Linux kernel assumes the size of long is equal to a machine word.
The pre-defined config.h is adjusted to match musl's features. We also to build and link lib/error.c to provide functions for error message handling.
As DynamoRIO enables -Werror by default, such warnings will prevent a warning-aware build. Since we also issue a warnings during start up, Let's remove it.
GCC on Alpine Linux enables "-Wtrampolines" by default, breaking the test. Since Alpine is the most widely-used musl-based distribution, it's worth to work around this: let's defaults to -Wno-trampoline on musl systems.
Some glibc-specific APIs are used in the test, we need to port them to musl.
DynamoRIO defines REG_* macros for compatibility with old clients, which conflict with signal.h on musl. Use of pragma push_macro/pop_macro to avoid messing musl's header up.
@derekbruening thanks for your review |
If this PR is ready for review, please add a reviewer from the "Reviewers" list on the top-right1. |
I have no write access to the repository, thus cannot require a reviewer :/ |
This pull request allows DynamoRIO and all the tests to be built on musl libc,
stdout/stderr and suppress warnings for musl's opaque FILE type
actually a function call, instead of a constant value
Tested on Alpine Linux, half of the tests are passed and it's possible to run
some applications (busybox, mutt and telegram-desktop) and some simple clients
(bbsize).
Issue: #1973