Skip to content

Commit bb3f38c

Browse files
dtwlinmasahir0y
authored andcommitted
kbuild: clang: fix build failures with sparse check
We should avoid using the space character when passing arguments to clang, because static code analysis check tool such as sparse may misinterpret the arguments followed by spaces as build targets hence cause the build to fail. Signed-off-by: David Lin <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent d87e47e commit bb3f38c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,11 @@ KBUILD_CFLAGS += $(stackp-flag)
697697

698698
ifeq ($(cc-name),clang)
699699
ifneq ($(CROSS_COMPILE),)
700-
CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%))
700+
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
701701
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
702702
endif
703703
ifneq ($(GCC_TOOLCHAIN),)
704-
CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN)
704+
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
705705
endif
706706
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
707707
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)

0 commit comments

Comments
 (0)