All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lin <dtwlin@google.com>
To: corbet@lwn.net, yamada.masahiro@socionext.com,
	michal.lkml@markovi.net, behanw@converseincode.com
Cc: ghackmann@google.com, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, David Lin <dtwlin@google.com>
Subject: [PATCH] kbuild: clang: fix build failures with sparse check
Date: Fri, 20 Oct 2017 14:09:13 -0700	[thread overview]
Message-ID: <20171020210913.64498-1-dtwlin@google.com> (raw)

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>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 05f95df0a247..c8819d0de907 100644
--- a/Makefile
+++ b/Makefile
@@ -685,11 +685,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)
-- 
2.15.0.rc0.271.g36b669edcc-goog

             reply	other threads:[~2017-10-20 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 21:09 David Lin [this message]
2017-10-24  4:13 ` [PATCH] kbuild: clang: fix build failures with sparse check Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171020210913.64498-1-dtwlin@google.com \
    --to=dtwlin@google.com \
    --cc=behanw@converseincode.com \
    --cc=corbet@lwn.net \
    --cc=ghackmann@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.