Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#79612 - [musl] Building C and C++ code that uses headers from linux-api-headers fails

Attached to Project: Arch Linux
Opened by Demi Marie Obenour (Demi) - Thursday, 07 September 2023, 20:02 GMT
Last edited by Toolybird (Toolybird) - Thursday, 07 September 2023, 23:08 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
If I try to build software against musl libc that relies on Linux kernel API headers, the build fails saying that the headers cannot be found.

Additional info:
* musl: 1.2.4-1

Steps to reproduce:

Use musl-gcc to build a trivial C file that uses Linux API headers, such as the following:

#include <linux/sched.h>
int main(void) { return 0; }

I can fix the problem by running these commands as root:

ln -s ../../../include/asm-generic /usr/lib/musl/include
ln -s ../../../include/asm /usr/lib/musl/include
ln -s ../../../include/linux /usr/lib/musl/include

These commands add symlinks under /usr/lib/musl/include that point to the headers provided by linux-api-headers.
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 07 September 2023, 23:08 GMT
Reason for closing:  Not a bug
Additional comments about closing:  See comments
Comment by Toolybird (Toolybird) - Thursday, 07 September 2023, 20:11 GMT
> Critical

Rookie error [1]. Please adhere to the guidelines.

[1] https://wiki.archlinux.org/title/Bug_reporting_guidelines#Severity
Comment by AK (Andreaskem) - Thursday, 07 September 2023, 20:26 GMT
Isn't this what kernel-headers-musl is for?
Comment by Demi Marie Obenour (Demi) - Thursday, 07 September 2023, 22:07 GMT
Yes, but (1) there is no indication that it is necessary and (2) kernel-headers-musl doesn’t have the definition of struct clone_args, so compiling programs that use clone3() fails.
Comment by loqs (loqs) - Thursday, 07 September 2023, 22:19 GMT
clone3 was added in linux 5.3 so is not include in kernel-headers-musl which is based on 4.19.
Comment by Demi Marie Obenour (Demi) - Thursday, 07 September 2023, 22:21 GMT
4.19 is very outdated by now, though. Should I flag kernel-headers-musl as out of date?
Comment by loqs (loqs) - Thursday, 07 September 2023, 22:36 GMT
> 4.19 is very outdated by now, though. Should I flag kernel-headers-musl as out of date?
4.19.88-2 is the latest release [1]. See also [2].



[1] https://github.com/sabotage-linux/kernel-headers/releases/
[2] https://github.com/sabotage-linux/kernel-headers/issues/15

Loading...