]>
Commit | Line | Data |
---|---|---|
22b74881 GKH |
1 | From foo@baz Wed Nov 21 18:50:39 CET 2018 |
2 | From: David Lin <dtwlin@google.com> | |
3 | Date: Fri, 20 Oct 2017 14:09:13 -0700 | |
4 | Subject: kbuild: clang: fix build failures with sparse check | |
5 | ||
6 | From: David Lin <dtwlin@google.com> | |
7 | ||
8 | commit bb3f38c3c5b759163e09b9152629cc789731de47 upstream. | |
9 | ||
10 | We should avoid using the space character when passing arguments to | |
11 | clang, because static code analysis check tool such as sparse may | |
12 | misinterpret the arguments followed by spaces as build targets hence | |
13 | cause the build to fail. | |
14 | ||
15 | Signed-off-by: David Lin <dtwlin@google.com> | |
16 | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> | |
17 | Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | --- | |
20 | Makefile | 4 ++-- | |
21 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
22 | ||
23 | --- a/Makefile | |
24 | +++ b/Makefile | |
25 | @@ -614,11 +614,11 @@ all: vmlinux | |
26 | ||
27 | ifeq ($(cc-name),clang) | |
28 | ifneq ($(CROSS_COMPILE),) | |
29 | -CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%)) | |
30 | +CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) | |
31 | GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..) | |
32 | endif | |
33 | ifneq ($(GCC_TOOLCHAIN),) | |
34 | -CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN) | |
35 | +CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) | |
36 | endif | |
37 | KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) | |
38 | KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) |