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 <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent ae574ae commit 1bd75ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)