Skip to content

Commit 43c509a

Browse files
dtwlinpundiramit
authored andcommitted
FROMLIST: 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> (cherry picked from linux-kbuild commit bb3f38c3c5b759163e09b9152629cc789731de47) Bug: 66969589 Change-Id: I055719cbc89e7a12d1f46f0a9c2152738a278d2a [ghackmann@google.com: tweak to preserve AOSP-specific CLANG_TRIPLE] Signed-off-by: Greg Hackmann <ghackmann@google.com>
1 parent 8ba70e0 commit 43c509a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,11 @@ KBUILD_CFLAGS += $(stackp-flag)
696696
ifeq ($(cc-name),clang)
697697
ifneq ($(CROSS_COMPILE),)
698698
CLANG_TRIPLE ?= $(CROSS_COMPILE)
699-
CLANG_TARGET := -target $(notdir $(CLANG_TRIPLE:%-=%))
699+
CLANG_TARGET := --target=$(notdir $(CLANG_TRIPLE:%-=%))
700700
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
701701
endif
702702
ifneq ($(GCC_TOOLCHAIN),)
703-
CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN)
703+
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
704704
endif
705705
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
706706
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)

0 commit comments

Comments
 (0)