]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/nolibc: add cc-option compatible with clang cross builds
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 7 Aug 2024 21:51:47 +0000 (23:51 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Mon, 12 Aug 2024 20:22:15 +0000 (22:22 +0200)
The cc-option macro from Build.include is not compatible with clang
cross builds, as it does not respect the "--target" and similar flags,
set up by Mekfile.include.

Provide a custom variant which works correctly.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-11-c20f2f5fc7c2@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/testing/selftests/nolibc/Makefile

index cdff317c35f2b9a0af00ac29321349ea8d982cf4..b8577086e00865c459ab04dce84f91c1c0aa8ad2 100644 (file)
@@ -6,8 +6,8 @@ srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
 endif
 
 include $(srctree)/tools/scripts/utilities.mak
-# We need this for the "cc-option" macro.
-include $(srctree)/tools/build/Build.include
+# We need this for the "__cc-option" macro.
+include $(srctree)/scripts/Makefile.compiler
 
 ifneq ($(O),)
 ifneq ($(call is-absolute,$(O)),y)
@@ -23,6 +23,8 @@ include $(srctree)/scripts/subarch.include
 ARCH = $(SUBARCH)
 endif
 
+cc-option = $(call __cc-option, $(CC),$(CLANG_CROSS_FLAGS),$(1),$(2))
+
 # XARCH extends the kernel's ARCH with a few variants of the same
 # architecture that only differ by the configuration, the toolchain
 # and the Qemu program used. It is copied as-is into ARCH except for