-
Notifications
You must be signed in to change notification settings - Fork 38
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
musl compat #314
Open
matttbe
wants to merge
4
commits into
multipath-tcp:main
Choose a base branch
from
matttbe:musl-compat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
musl compat #314
Conversation
This file contains 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
Some libc like musl don't support them. Let's simply define them if they are not defined. From GNU C Library, bits/byteswap.h, under LGPL. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Some libc like musl don't support it. It is easy enough to define a simple version for our need. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
The current version taking an unlimited number of args, and with multiple levels of helpers doesn't seem to be supported on some embedded environments, e.g. Alpine Linux: configuration.c: In function 'mptcpd_config_create': configuration.c:54:47: error: pasting "l_log_set_" and "(" does not give a valid preprocessing token 54 | #define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER) | ^~~~~~~~~~ configuration.c:42:36: note: in definition of macro 'MPTCPD_CONCAT_IMPL' 42 | #define MPTCPD_CONCAT_IMPL(x, ...) x ## __VA_ARGS__ | ^ configuration.c:54:33: note: in expansion of macro 'MPTCPD_CONCAT' 54 | #define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER) | ^~~~~~~~~~~~~ configuration.c:802:9: note: in expansion of macro 'MPTCPD_SET_LOG_FUNCTION' 802 | MPTCPD_SET_LOG_FUNCTION(); // For early logging. | ^~~~~~~~~~~~~~~~~~~~~~~ configuration.c:54:47: error: implicit declaration of function 'l_log_set_'; did you mean 'l_log_set_null'? [-Werror=implicit-function-declaration] 54 | #define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER) | ^~~~~~~~~~ configuration.c:42:36: note: in definition of macro 'MPTCPD_CONCAT_IMPL' 42 | #define MPTCPD_CONCAT_IMPL(x, ...) x ## __VA_ARGS__ | ^ configuration.c:54:33: note: in expansion of macro 'MPTCPD_CONCAT' 54 | #define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER) | ^~~~~~~~~~~~~ configuration.c:802:9: note: in expansion of macro 'MPTCPD_SET_LOG_FUNCTION' 802 | MPTCPD_SET_LOG_FUNCTION(); // For early logging. | ^~~~~~~~~~~~~~~~~~~~~~~ configuration.c:54:47: error: called object is not a function or function pointer 54 | #define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER) | ^~~~~~~~~~ configuration.c:42:36: note: in definition of macro 'MPTCPD_CONCAT_IMPL' 42 | #define MPTCPD_CONCAT_IMPL(x, ...) x ## __VA_ARGS__ | ^ configuration.c:54:33: note: in expansion of macro 'MPTCPD_CONCAT' 54 | #define MPTCPD_SET_LOG_FUNCTION MPTCPD_CONCAT(l_log_set_, MPTCPD_LOGGER) | ^~~~~~~~~~~~~ configuration.c:802:9: note: in expansion of macro 'MPTCPD_SET_LOG_FUNCTION' 802 | MPTCPD_SET_LOG_FUNCTION(); // For early logging. | ^~~~~~~~~~~~~~~~~~~~~~~ It is not clear to me why it is failing, and simplifying the concatenation to two items, plus modifying the main helper to take the prefix in argument don't seem to help . A simple workaround is to have a special case for the default value, and do the concatenation only with the other cases. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Busybox's stat doesn't understand the long options: stat: unrecognized option: dereference But it does support '-L'. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Pull Request Test Coverage Report for Build 11936299435Details
💛 - Coveralls |
matttbe
commented
Dec 4, 2024
@@ -26,6 +26,16 @@ | |||
*/ | |||
///@{ | |||
#if __BYTE_ORDER == __LITTLE_ENDIAN | |||
/* These 2 helpers come from GNU C Library, under LGPL */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a macro, I guess it is fine to copy it.
If not, we only use it in one place, with one address in lib
, and multiple ones in the tests.
Maybe that's enough to hardcode the address in lib
. The tests need further modifications to support musl I think.
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.
Here are a few small patches needed to be able to compile mptcpd with musl, e.g. on AlpineLinux