From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754707AbdCQAYG (ORCPT ); Thu, 16 Mar 2017 20:24:06 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:35000 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbdCQAYE (ORCPT ); Thu, 16 Mar 2017 20:24:04 -0400 From: Michael Davidson To: Michal Marek , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Herbert Xu , "David S. Miller" , Shaohua Li Cc: Alexander Potapenko , Dmitry Vyukov , Matthias Kaehlcke , x86@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-raid@vger.kernel.org, Michael Davidson Subject: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags Date: Thu, 16 Mar 2017 17:15:15 -0700 Message-Id: <20170317001520.85223-3-md@google.com> X-Mailer: git-send-email 2.12.0.367.g23dc2f6d3c-goog In-Reply-To: <20170317001520.85223-1-md@google.com> References: <20170317001520.85223-1-md@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unfortunately, while clang generates a warning about these flags being unsupported it still exits with a status of 0 so we have to explicitly disable them instead of just using a cc-option check. Signed-off-by: Michael Davidson --- Makefile | 2 ++ arch/x86/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index b21fd0ca2946..5e97e5fc1eea 100644 --- a/Makefile +++ b/Makefile @@ -629,7 +629,9 @@ ARCH_AFLAGS := ARCH_CFLAGS := include arch/$(SRCARCH)/Makefile +ifneq ($(cc-name),clang) KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) +endif KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 2d449337a360..894a8d18bf97 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -87,11 +87,13 @@ else KBUILD_AFLAGS += -m64 KBUILD_CFLAGS += -m64 +ifneq ($(cc-name),clang) # Align jump targets to 1 byte, not the default 16 bytes: KBUILD_CFLAGS += -falign-jumps=1 # Pack loops tightly as well: KBUILD_CFLAGS += -falign-loops=1 +endif # Don't autogenerate traditional x87 instructions KBUILD_CFLAGS += $(call cc-option,-mno-80387) -- 2.12.0.367.g23dc2f6d3c-goog