From patchwork Tue Sep 15 03:03:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sedat Dilek X-Patchwork-Id: 7179771 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36312BEEC1 for ; Tue, 15 Sep 2015 03:03:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3338C2070B for ; Tue, 15 Sep 2015 03:03:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 172B9206EB for ; Tue, 15 Sep 2015 03:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbbIODDP (ORCPT ); Mon, 14 Sep 2015 23:03:15 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:35301 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766AbbIODDO (ORCPT ); Mon, 14 Sep 2015 23:03:14 -0400 Received: by wicge5 with SMTP id ge5so8915988wic.0; Mon, 14 Sep 2015 20:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wfoSKkye6I50nE6H4Lpkaks2ck5R1CD2taPHdULIvaU=; b=rgdAvvyCys5IT0gPn39fvTGCA5DhSAilNt4sjswsYbbpHs20lbXgkeqjgTIYf/Jt/1 jnD4D5Ey36yuHqpAz86a8JTsCUmBjjK3LoxDlmF5TCSAFLa2H0oEwzePKZWok/OfoTw4 n+noRZKSg1lTW5eT3EjA7h3ocixyWFPpNPjasGjuoj8EpjqprjG6FkNVG90G7PlgezMy /cO7Tz3pFL1CF90lbLU9M+yLsWQBnmkxI6tt5+6qz6D96iyt3pkMS5bRlei5gGkM0Y87 4fbYCVI2PHGp0o56IjX8dET7pAQY0FRn9lLt59wGMDKWWBjrI1TXOtEg61OjKbCTS+rk hfNg== X-Received: by 10.180.86.138 with SMTP id p10mr2464151wiz.39.1442286191387; Mon, 14 Sep 2015 20:03:11 -0700 (PDT) Received: from fambox.fambox-domain ([176.0.84.143]) by smtp.gmail.com with ESMTPSA id ft3sm17317036wib.17.2015.09.14.20.03.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 20:03:10 -0700 (PDT) From: Sedat Dilek To: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sedat Dilek Subject: [PATCH] kbuild: llvmlinux: Fix -fno-delete-null-pointer-checks compiler-flag Date: Tue, 15 Sep 2015 05:03:00 +0200 Message-Id: <1442286180-11050-1-git-send-email-sedat.dilek@gmail.com> X-Mailer: git-send-email 2.5.2 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,)