From: Sedat Dilek <sedat.dilek@gmail.com>
To: Michal Marek <mmarek@suse.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Subject: [PATCH] kbuild: llvmlinux: Fix -fno-delete-null-pointer-checks compiler-flag
Date: Tue, 15 Sep 2015 05:03:00 +0200 [thread overview]
Message-ID: <1442286180-11050-1-git-send-email-sedat.dilek@gmail.com> (raw)
CLANG (here: v3.7) does not support '-fno-delete-null-pointer-checks'
as a compiler-flag.
Fix the HOSTCFLAGS and KBUILD_CFLAGS settings accordingly.
Furthermore, move and correct the $HOSTCC check.
Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset.
---
Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index aaf1d52bc646..4249441e535d 100644
--- a/Makefile
+++ b/Makefile
@@ -300,9 +300,9 @@ HOSTCXX = g++
HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
HOSTCXXFLAGS = -O2
-ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
-HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
- -Wno-missing-field-initializers -fno-delete-null-pointer-checks
+HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers
+ifneq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
+HOSTCFLAGS += -fno-delete-null-pointer-checks
endif
# Decide whether to build built-in, modular, or both.
@@ -617,7 +617,9 @@ ARCH_AFLAGS :=
ARCH_CFLAGS :=
include arch/$(SRCARCH)/Makefile
+ifneq ($(cc-name),clang)
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
+endif
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
--
2.5.2
next reply other threads:[~2015-09-15 3:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 3:03 Sedat Dilek [this message]
2015-10-26 20:01 ` Michal Marek
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=1442286180-11050-1-git-send-email-sedat.dilek@gmail.com \
--to=sedat.dilek@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®