Thomas WEISSSCHUH presented at kernel recipe 2025 #nolibc a minimalist #libc included in kernel. Headers files are in the kernel source tree and it grown a lot since linux-5.1 initial version, but not installed in system (at least on Arch Linux).
__
hello.c:
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
To compile it (you can notice relative path for includes here, I stll have to add `
cc -nostdinc -nostdlib -static -Iusr/include -Itools/include/nolibc/ -I/usr/include hello.c -o hello
./hello
Hello World!
- Presentation at Kernel Recipes 2025 in Paris: https://kernel-recipes.org/en/2025/schedule/nolibc-a-userspace-libc-in-the-kernel-tree/
- There is an [article about it on LWN][https://lwn.net/Articles/920158/)
__
hello.c:
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
To compile it (you can notice relative path for includes here, I stll have to add `
-I/usr/include as last -I` (include path) to have it working (from root of Linux source tree):cc -nostdinc -nostdlib -static -Iusr/include -Itools/include/nolibc/ -I/usr/include hello.c -o hello
./hello
Hello World!