]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.165/kbuild-clang-fix-build-failures-with-sparse-check.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.165 / kbuild-clang-fix-build-failures-with-sparse-check.patch
CommitLineData
22b74881
GKH
1From foo@baz Wed Nov 21 18:50:39 CET 2018
2From: David Lin <dtwlin@google.com>
3Date: Fri, 20 Oct 2017 14:09:13 -0700
4Subject: kbuild: clang: fix build failures with sparse check
5
6From: David Lin <dtwlin@google.com>
7
8commit bb3f38c3c5b759163e09b9152629cc789731de47 upstream.
9
10We should avoid using the space character when passing arguments to
11clang, because static code analysis check tool such as sparse may
12misinterpret the arguments followed by spaces as build targets hence
13cause the build to fail.
14
15Signed-off-by: David Lin <dtwlin@google.com>
16Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
17Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
18Signed-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)