cpu/native: fix build with musl
Contribution description
This changes a bunch of things that allows building with BOARD=native on 32-bit arches with the musl C lib, provided that libucontext-dev and pkg-config is installed.
Note that installing libucontext makes absolutely zero sense on C libs that do natively provide this deprecated System V API, such as glibc. Hence, it no sane glibc setup is expected to ever have libucontext installed.
Testing procedure
make BOARD=native -C examples/default
On a 32 bit system with musl as C lib and pkg-config as well as libucontext-dev installed should now succeed. The generated binary on glibc based 32 bit or multiarch systems should not change compared to master.
Issues/PRs references
Fixes https://github.com/RIOT-OS/RIOT/issues/18937
Murdock results
:heavy_check_mark: PASSED
e93b5e4b98a8bb6254dbab5047669dd02a4f2ef0 core/thread: fix thread_measure_stack_free()
| Success | Failures | Total | Runtime |
|---|---|---|---|
| 10160 | 0 | 10161 | 17m:22s |
Artifacts
What do you need to get this merged @maribu? 🙂
Looks like native64 is crashing in CI now :confused:
Can I haz ACKs?
Hooray :tada: Thx a bunch!
This breaks the stack free measurement :(
> ps
2024-06-04 16:27:07,709 # pid | name | state Q | pri | stack ( used) ( free) | base addr | current
2024-06-04 16:27:07,718 # - | isr_stack | - - | - | 512 ( 172) ( 340) | 0x20000000 | 0x200001c8
2024-06-04 16:27:07,726 # 1 | main | running Q | 7 | 1536 ( 1536) ( 0) | 0x20000340 | 0x20000854
2024-06-04 16:27:07,736 # 2 | pktdump | bl rx _ | 6 | 1472 ( 1472) ( 0) | 0x20002fb0 | 0x200034c4
2024-06-04 16:27:07,744 # 3 | ipv6 | bl rx _ | 4 | 960 ( 960) ( 0) | 0x20000a5c | 0x20000d54
2024-06-04 16:27:07,752 # 4 | udp | bl rx _ | 5 | 448 ( 448) ( 0) | 0x20003bfc | 0x20003cfc
2024-06-04 16:27:07,761 # 5 | sam0_eth | bl anyfl _ | 2 | 896 ( 896) ( 0) | 0x200013b8 | 0x2000167c
2024-06-04 16:27:07,770 # 6 | RPL | bl rx _ | 5 | 1024 ( 1024) ( 0) | 0x200037b8 | 0x20003aec
2024-06-04 16:27:07,776 # | SUM | | | 6848 ( 6508) ( 340)