[PATCH v3 04/16] kbuild: userprogs: add nolibc support

Nicolas Schier nicolas.schier at linux.dev
Wed Jun 11 07:09:01 PDT 2025


On Wed, Jun 11, 2025 at 09:38:10AM +0200, Thomas Weißschuh wrote:
> Userprogs are built with the regular kernel compiler $CC.
> A kernel compiler does not necessarily contain a libc which is required
> for a normal userspace application.
> However the kernel tree does contain a minimal libc implementation
> "nolibc" which can be used to build userspace applications.
> 
> Introduce support to build userprogs against nolibc instead of the
> default libc of the compiler, which may not exist.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
> 
> ---
> This could probably be moved out of the generic kbuild makefiles.
> I think the ergonimics would suffer and this functionality could be
> used by other users of userprogs.
> 
> Also this does currently not support out-of-tree builds.
> For that tools/include/nolibc/*.h and usr/include/*.h would need to be
> installed into the build directory.

Thanks!

Reviewed-by: Nicolas Schier <n.schier at avm.de>

Probably overkill, but might it make sense to abort *-nolibc compilation 
requests for out-of-tree builds?

Kind regards,
Nicolas



More information about the linux-riscv mailing list