Skip to content
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

tree wide: compilation fixes for native64 on musl systems #20730

Merged
merged 5 commits into from
Jun 15, 2024

Conversation

maribu
Copy link
Member

@maribu maribu commented Jun 5, 2024

Contribution description

With this, almost all apps build for native64 on musl.

Testing procedure

I abused the insufficient memory tool using

./dist/tools/insufficient_memory/update_insufficient_memory_board.sh --no-docker native64

on Alpine. I guess ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py would have been the more canonical tool, but the insufficient memory tool has so fancy colors in the output :)

With this, almost all apps build fine.

Issues/PRs references

None

maribu added 5 commits June 5, 2024 21:47
This fixes compilation issues on musl, where the host POSIX headers
don't mix well with RIOT's POSIX headers.

This adds an conditional `#include_next <sys/select.h>` to RIOT's
`<sys/select.h>` header.
On musl, PAGE_SIZE has a different meaning. So add an AT25_ prefix
to avoid a name clash.
On musl, `spu_set_t` is provided by system headers, so only provide
that with glibc.
musl and glibc have different types for fast atomic integers. This
selects the correct size depending on the used library.
@maribu maribu requested a review from kaspar030 as a code owner June 5, 2024 20:09
@maribu maribu marked this pull request as draft June 5, 2024 20:09
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 5, 2024
@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: drivers Area: Device drivers Area: cpu Area: CPU/MCU ports Area: sys Area: System Area: examples Area: Example Applications labels Jun 5, 2024
@riot-ci
Copy link

riot-ci commented Jun 5, 2024

Murdock results

✔️ PASSED

54702a5 examples/dtls-wolfssl: Sort Makefile.ci

Success Failures Total Runtime
10161 0 10161 19m:41s

Artifacts

@Teufelchen1
Copy link
Contributor

Is this ready for review?

@maribu maribu marked this pull request as ready for review June 14, 2024 14:24
@maribu
Copy link
Member Author

maribu commented Jun 14, 2024

Yes, sorry, forgot to mark it as ready :)

@@ -30,6 +30,7 @@ extern "C" {
#ifdef CPU_NATIVE
#include <stdio.h>

#if __GLIBC__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker for this PR but why is there no #elseif __musl__ ...?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In musl those are already provided (causing the conflict).

@@ -37,7 +37,7 @@
#define min(a, b) ((a) > (b) ? (b) : (a))
#endif

#define PAGE_SIZE (dev->params.page_size)
#define AT25_PAGE_SIZE (dev->params.page_size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha! 😸

@maribu maribu enabled auto-merge June 15, 2024 17:11
@maribu maribu added this pull request to the merge queue Jun 15, 2024
Merged via the queue into RIOT-OS:master with commit 8821f1f Jun 15, 2024
30 checks passed
@maribu maribu deleted the tree-wide/musl/fixes branch June 16, 2024 10:18
@maribu
Copy link
Member Author

maribu commented Jun 16, 2024

Thx a bunch!

@mguetschow mguetschow added this to the Release 2024.07 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: examples Area: Example Applications Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants