Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4720959imd; Tue, 30 Oct 2018 06:31:53 -0700 (PDT) X-Google-Smtp-Source: AJdET5fPFg0jQ1bFb2VMZLz2dCRLqZ1sGTj4aQS+acZ+GYdcnv0pDFUjZOJY0fHbPnbj5TdXGQuZ X-Received: by 2002:a63:cf4c:: with SMTP id b12-v6mr17785349pgj.418.1540906313834; Tue, 30 Oct 2018 06:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540906313; cv=none; d=google.com; s=arc-20160816; b=fS4CJfefye+Qg7xsYjAEYyeLFMN+ItiAVM1w7hzztltrrelx7FkhM8jAzkTZCeDrqt hRUV46PpLWEMij4joodvsPl5wSOMocSQGT7O96f05i6kyVT55Kgz8Nmx6dAtOMNICrZP aZbaaB855mPmo5lQoqtHQH70qtUEyZkCTF6Bjo/v8zr0D8PB6cilktk84mFgO2c1rrUb fo/ubcSMStInu7q39eNP2peiufkxKY64XbcORk1icHZ6oNjJIcIO/3xqzfhf56afLWFT rayF1QwwLZMDALRv5zFmJc4SfBRS1VmWUH8jVbxQHfTk9jdaIarKZ0MAR0DwwAkzB7MB 7tpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=skUFf3WNnS8Fe4IYW9gvWo00Z0AKhP9n/utRSDh/eC4=; b=uUSb9+0lDa680U+OptDE6TC+XyAfP6xxDQVebw2N3eP8eusHTnJcwR46Ta4MSP4ckd 5yzXQlgJopbKCrVGSJfGlInmFCaave7zfDMdwke1+ftEBwTc3uN8uV2RXn1xP29s1ruH 0JluBXBnBNFw2CdVtUVzrN88Je7JOCDdrMrK1VXjSkKXciOThuOREtXqbrra4GV+OMVi f8hdnLQg5PWqgjTUISHbxWD9HbAjQnvnMuWoMTJI14ygeAY6eQLKwnXRgg8t7mi9+hkx lLJfTZxmxtxN7QrZX9e7iye6dTjJITD3f7PB2cXt+/jMKu9r2Ot6414D21q5o7Q5qDeJ e2iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=PbOFWe21; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19-v6si22244543plr.127.2018.10.30.06.31.38; Tue, 30 Oct 2018 06:31:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=PbOFWe21; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728685AbeJ3WWD (ORCPT + 99 others); Tue, 30 Oct 2018 18:22:03 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:38426 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbeJ3WWC (ORCPT ); Tue, 30 Oct 2018 18:22:02 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w9UDQcm0022568; Tue, 30 Oct 2018 22:26:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w9UDQcm0022568 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1540905999; bh=skUFf3WNnS8Fe4IYW9gvWo00Z0AKhP9n/utRSDh/eC4=; h=From:To:Cc:Subject:Date:From; b=PbOFWe21d7KJAJtQgRPuTATo7B3/HuloM6ffOv3sk4aV+4bCDF3HNBKYgejbulHZ0 L/NMow1PfvQPfMsZcc6b3hoXxQ355jLDhk5TCabuQ0tH8ExhkHWCHkuJtSkkTBKBjg LEopFs2hvA+JhbIpSeplGSrP2/w9/U2xrg4/GCnJV96ikeh+aDaAG9H+5wIEEW5p1J Uy1/jk4PWgCO9hyFnfT6WYEMvYIeqZy58EQ2dGgMFSUXpnfV+dczHXJdW3BWH6aIYv aCOb8uj7c1cwdOn9xm6/hPlwa2TcSgBp4YsQlxAJb96GT3uS8iQLd/RT52Qd7gu1Mq oikoVXyhBHchA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-mips@linux-mips.org, James Hogan , Michael Ellerman , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Michal Marek , Paul Mackerras , Paul Burton , Ralf Baechle , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 1/2] kbuild: replace cc-name test with CONFIG_CC_IS_CLANG Date: Tue, 30 Oct 2018 22:26:33 +0900 Message-Id: <1540905994-6073-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Evaluating cc-name invokes the compiler every time even when you are not compiling anything, like 'make help'. This is not efficient. The compiler type has been already detected in the Kconfig stage. Use CONFIG_CC_IS_CLANG, instead. Signed-off-by: Masahiro Yamada Acked-by: Michael Ellerman (powerpc) --- Changes in v2: - Use ifdef/ifndef insteaed of ifeq/ifneq Makefile | 2 +- arch/mips/Makefile | 2 +- arch/mips/vdso/Makefile | 2 +- arch/powerpc/Makefile | 4 ++-- scripts/Makefile.extrawarn | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0a42d06..1c0696d 100644 --- a/Makefile +++ b/Makefile @@ -707,7 +707,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong KBUILD_CFLAGS += $(stackp-flags-y) -ifeq ($(cc-name),clang) +ifdef CONFIG_CC_IS_CLANG KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 15a84cf..6841049 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -128,7 +128,7 @@ cflags-y += -ffreestanding # clang's output will be based upon the build machine. So for clang we simply # unconditionally specify -EB or -EL as appropriate. # -ifeq ($(cc-name),clang) +ifdef CONFIG_CC_IS_CLANG cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -EL else diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile index 34605ca..58a0315 100644 --- a/arch/mips/vdso/Makefile +++ b/arch/mips/vdso/Makefile @@ -10,7 +10,7 @@ ccflags-vdso := \ $(filter -march=%,$(KBUILD_CFLAGS)) \ -D__VDSO__ -ifeq ($(cc-name),clang) +ifdef CONFIG_CC_IS_CLANG ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS)) endif diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 17be664..8a2ce14 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -96,7 +96,7 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 endif -ifneq ($(cc-name),clang) +ifndef CONFIG_CC_IS_CLANG cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align endif @@ -175,7 +175,7 @@ endif # Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828 -ifneq ($(cc-name),clang) +ifndef CONFIG_CC_IS_CLANG CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog) endif endif diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 24b2fb1..800a10f 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -64,7 +64,7 @@ endif KBUILD_CFLAGS += $(warning) else -ifeq ($(cc-name),clang) +ifdef CONFIG_CC_IS_CLANG KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) KBUILD_CFLAGS += $(call cc-disable-warning, format) -- 2.7.4