summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Lin <dtwlin@google.com>2017-10-20 23:09:13 +0200
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-10-24 03:12:02 +0200
commitbb3f38c3c5b759163e09b9152629cc789731de47 (patch)
tree377a2013eb42005a876302cf3f4012ebe5b29074 /Makefile
parentkbuild doc: a bundle of fixes on makefiles.txt (diff)
downloadlinux-bb3f38c3c5b759163e09b9152629cc789731de47.tar.xz
linux-bb3f38c3c5b759163e09b9152629cc789731de47.zip
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 <dtwlin@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d5ed3cec7938..8593c4081193 100644
--- a/Makefile
+++ b/Makefile
@@ -697,11 +697,11 @@ KBUILD_CFLAGS += $(stackp-flag)
ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
-CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%))
+CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
endif
ifneq ($(GCC_TOOLCHAIN),)
-CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN)
+CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)