]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/nolibc: scope custom flags to the nolibc-test target
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 6 Jan 2026 11:44:58 +0000 (12:44 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Sun, 11 Jan 2026 10:17:12 +0000 (11:17 +0100)
A new target for 'libc-test' is going to be added which should not be
affected by these options.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260106-nolibc-selftests-v1-2-f82101c2c505@weissschuh.net
tools/testing/selftests/nolibc/Makefile

index 40f5c2908ddaef05ac7e4422379a60141c6c0ff9..43f0b608c7960dddea18daac1e43ff0b1a71558f 100644 (file)
@@ -9,14 +9,10 @@ cc-option = $(call __cc-option, $(CC),,$(1),$(2))
 
 include Makefile.include
 
-CFLAGS = -nostdlib -nostdinc -static \
+$(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
         -isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
         $(CFLAGS_NOLIBC_TEST)
-
-ifeq ($(LLVM),)
-LDLIBS := -lgcc
-endif
-
+$(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
 $(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
 
 help: