Skip to content

Commit 1bd75ae

Browse files
committed
selftests/nolibc: add cc-option compatible with clang cross builds
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>
1 parent ae574ae commit 1bd75ae

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tools/testing/selftests/nolibc/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
66
endif
77

88
include $(srctree)/tools/scripts/utilities.mak
9-
# We need this for the "cc-option" macro.
10-
include $(srctree)/tools/build/Build.include
9+
# We need this for the "__cc-option" macro.
10+
include $(srctree)/scripts/Makefile.compiler
1111

1212
ifneq ($(O),)
1313
ifneq ($(call is-absolute,$(O)),y)
@@ -23,6 +23,8 @@ include $(srctree)/scripts/subarch.include
2323
ARCH = $(SUBARCH)
2424
endif
2525

26+
cc-option = $(call __cc-option, $(CC),$(CLANG_CROSS_FLAGS),$(1),$(2))
27+
2628
# XARCH extends the kernel's ARCH with a few variants of the same
2729
# architecture that only differ by the configuration, the toolchain
2830
# and the Qemu program used. It is copied as-is into ARCH except for

0 commit comments

Comments
 (0)