summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Lin <dtwlin@google.com>2017-10-20 14:09:13 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-27 16:07:58 +0100
commit03e4b23ec9ab053b6cbf39eca2fd821116022665 (patch)
tree43cfe707b728d8fc77cc94bf1622ff184118b860 /Makefile
parent0925fe3d2eb6907dd2bf6e6521be6c8d52045c2d (diff)
kbuild: clang: fix build failures with sparse check
commit bb3f38c3c5b759163e09b9152629cc789731de47 upstream. 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> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6a15a2a851c8..0598c61f77ee 100644
--- a/Makefile
+++ b/Makefile
@@ -614,11 +614,11 @@ all: vmlinux
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)