selftests/nolibc: always compile the kernel with GCC
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 19 Jul 2025 15:38:29 +0000 (17:38 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Mon, 18 Aug 2025 14:05:41 +0000 (16:05 +0200)
LLVM/clang can not build the kernel for all architectures supported by
nolibc. The current setup uses the same compiler to build the kernel as
is used for nolibc-test. This prevents using the full qemu-system tests
for LLVM builds.

Instead always build the kernel with GCC. For the nolibc testsuite the
kernel does not need to be built with LLVM.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20250719-nolibc-llvm-system-v1-3-1730216ce171@weissschuh.net
tools/testing/selftests/nolibc/Makefile.nolibc

index ebb097d..330e000 100644 (file)
@@ -263,7 +263,7 @@ REPORT  ?= awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{if (!f) printf("\n"); f++
                printf("\nSee all results in %s\n", ARGV[1]); }'
 
 # Execute the toplevel kernel Makefile
-KBUILD_MAKE = $(MAKE) -C $(srctree) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
+KBUILD_MAKE = $(MAKE) -C $(srctree) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) LLVM=
 
 help:
        @echo "Supported targets under selftests/nolibc:"
@@ -276,8 +276,8 @@ help:
        @echo "  initramfs.cpio    prepare the initramfs archive with nolibc-test"
        @echo "  initramfs         prepare the initramfs tree with nolibc-test"
        @echo "  defconfig         create a fresh new default config (uses \$$XARCH)"
-       @echo "  kernel            (re)build the kernel (uses \$$XARCH)"
-       @echo "  kernel-standalone (re)build the kernel with the initramfs (uses \$$XARCH)"
+       @echo "  kernel            (re)build the kernel (uses \$$XARCH, \$$CROSS_COMPILE)"
+       @echo "  kernel-standalone (re)build the kernel with the initramfs (uses \$$XARCH, \$$CROSS_COMPILE)"
        @echo "  run               runs the kernel in QEMU after building it (uses \$$XARCH, \$$TEST)"
        @echo "  rerun             runs a previously prebuilt kernel in QEMU (uses \$$XARCH, \$$TEST)"
        @echo "  clean             clean the sysroot, initramfs, build and output files"