[PATCH v2 06/11] tools/nolibc: add option to disable runtime
Thomas Weißschuh
linux at weissschuh.net
Sat Sep 20 02:08:36 PDT 2025
On 2025-09-19 17:34:15+0200, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg at intel.com>
>
> In principle, it is possible to use nolibc for only some object files in
> a program. In that case, the startup code in _start and _start_c is not
> going to be used. Add the NOLIBC_NO_RUNTIME compile time option to
> disable it entirely and also remove anything that depends on it.
>
> Doing this avoids warnings from modpost for UML as the _start_c code
> references the main function from the .init.text section while it is not
> inside .init itself.
>
> Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
Acked-by: Thomas Weißschuh <linux at weissschuh.net>
>
> ---
> v2:
> - Renamed from NOLIBC_NO_STARTCODE to NOLIBC_NO_RUNTIME
> - Put the #ifdef around relevant comments
> ---
> tools/include/nolibc/arch-arm.h | 2 ++
> tools/include/nolibc/arch-arm64.h | 2 ++
> tools/include/nolibc/arch-loongarch.h | 2 ++
> tools/include/nolibc/arch-m68k.h | 2 ++
> tools/include/nolibc/arch-mips.h | 2 ++
> tools/include/nolibc/arch-powerpc.h | 2 ++
> tools/include/nolibc/arch-riscv.h | 2 ++
> tools/include/nolibc/arch-s390.h | 2 ++
> tools/include/nolibc/arch-sh.h | 2 ++
> tools/include/nolibc/arch-sparc.h | 2 ++
> tools/include/nolibc/arch-x86.h | 4 ++++
> tools/include/nolibc/crt.h | 3 +++
> tools/include/nolibc/stackprotector.h | 2 ++
> tools/include/nolibc/stdlib.h | 2 ++
> tools/include/nolibc/sys.h | 3 ++-
> tools/include/nolibc/sys/auxv.h | 3 +++
> 16 files changed, 36 insertions(+), 1 deletion(-)
(...)
More information about the linux-um
mailing list