From patchwork Tue Aug 17 00:21:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6C52C4338F for ; Tue, 17 Aug 2021 00:21:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D131A60E09 for ; Tue, 17 Aug 2021 00:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234592AbhHQAVw (ORCPT ); Mon, 16 Aug 2021 20:21:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbhHQAVw (ORCPT ); Mon, 16 Aug 2021 20:21:52 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB39CC061764 for ; Mon, 16 Aug 2021 17:21:19 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b4-20020a252e440000b0290593da85d104so18619565ybn.6 for ; Mon, 16 Aug 2021 17:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=0flG7tBXqwB6ZGV3wjc6S5xzmJOwRAtpip9gnXv+kK8=; b=TarIsOJvY1bE0qOoUbWMmmJpkQMY8ULADIPRKNNtrtDc7Ws2wk90HegcRbVT7dKxdh k23RttyME3Q75+8mPkvubTaWfXRV6yWrjFXqZgToyM7yyf0H7wgMNyvMjm49eM4ppUY3 BekQhk0gn8TMG8cBzDQtfwhquw1pScMhsk8WYgDc2GaohqLE/CcTNb58/fPxpXCB3gj1 3/upEdc1m4/+2GOxxYB/qld2s3Y/eM5QMAf51TQbOp1MwnT7Z1yjrWzUzn3KD0Or0SkW obUxgR9DGtYR6/6ZBb5mu688kqcja4RUnZs6quvA6XC1bB4u0QfkO5lDfXRLXghcFQCb 87tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=0flG7tBXqwB6ZGV3wjc6S5xzmJOwRAtpip9gnXv+kK8=; b=keygGe0nc/fqIywliZCqwnSsxSSEdzrqOztuqR/04YbM0RGv7ZKb4t33Ip6qxDrC1N zOJKE08yLJXDw48YoDOVWwq0OwpKtqgw4GmivNUy5tOzyBquPjlFe5tyshdl4cOw4Dkw tF7LkU/UXB6ioMeFZcjJOTCyM23RKnPc2nwXgNCENUubiSfcUHoqSnedf2EWK3cF/snk NSgsLVjokUUIYuEAq5GsPfdztJj6LK3bWG24wp76YnoXqK8nV+PPNH2WGQoiOMnOOFO3 E61IKLi3bzZmMefRIdnJ/8SGj0y5mbvNhm0Zs08bB77Mfi71wpuA8ky3ij2auIPs4orw NCPg== X-Gm-Message-State: AOAM531iO3kM4CAj+BbTpmUgv6yDpgwD/mciCK3FsOWIIJw/oKsrmOYK 3aiAcEOno18rxYEAYFgbCGxJINfOz2siegOHSTs= X-Google-Smtp-Source: ABdhPJwpIAkKNjLf2vx9eVQNWH+HzzufKSeCghOiKW6+XXOeiLmDa9rFRoRAe5/z8iyPTTrjlO3oVJPvxYI2npLP6/I= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a25:7ac6:: with SMTP id v189mr870163ybc.485.1629159679127; Mon, 16 Aug 2021 17:21:19 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:03 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-2-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 1/7] MIPS: replace cc-option-yn uses with cc-option From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Thomas Bogendoerfer , linux-mips@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Nick Desaulniers --- arch/mips/Makefile | 44 ++++++++++++++++++------------------- arch/mips/sgi-ip22/Platform | 4 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index ea3cd080a1c7..f4b9850f17fa 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -58,9 +58,7 @@ endif ifdef CONFIG_FUNCTION_GRAPH_TRACER ifndef KBUILD_MCOUNT_RA_ADDRESS - ifeq ($(call cc-option-yn,-mmcount-ra-address), y) - cflags-y += -mmcount-ra-address -DKBUILD_MCOUNT_RA_ADDRESS - endif + cflags-y += $(call cc-option,-mmcount-ra-address -DKBUILD_MCOUNT_RA_ADDRESS) endif endif cflags-y += $(call cc-option, -mno-check-zero-division) @@ -208,31 +206,33 @@ cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,) # been fixed properly. mips-cflags := $(cflags-y) ifeq ($(CONFIG_CPU_HAS_SMARTMIPS),y) -smartmips-ase := $(call cc-option-yn,$(mips-cflags) -msmartmips) -cflags-$(smartmips-ase) += -msmartmips -Wa,--no-warn +cflags-y += $(call cc-option,-msmartmips -Wa$(comma)--no-warn) endif ifeq ($(CONFIG_CPU_MICROMIPS),y) -micromips-ase := $(call cc-option-yn,$(mips-cflags) -mmicromips) -cflags-$(micromips-ase) += -mmicromips +cflags-y += $(call cc-option,-mmicromips) endif ifeq ($(CONFIG_CPU_HAS_MSA),y) -toolchain-msa := $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(comma)-mmsa) -cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA +ifneq ($(call cc-option,-mhard-float -mfp64 -Wa$(comma)-mmsa),) +cflags-y += -DTOOLCHAIN_SUPPORTS_MSA +endif +endif +ifneq ($(call cc-option,-mvirt),) +cflags-y += -DTOOLCHAIN_SUPPORTS_VIRT endif -toolchain-virt := $(call cc-option-yn,$(mips-cflags) -mvirt) -cflags-$(toolchain-virt) += -DTOOLCHAIN_SUPPORTS_VIRT # For -mmicromips, use -Wa,-fatal-warnings to catch unsupported -mxpa which # only warns -xpa-cflags-y := $(mips-cflags) -xpa-cflags-$(micromips-ase) += -mmicromips -Wa$(comma)-fatal-warnings -toolchain-xpa := $(call cc-option-yn,$(xpa-cflags-y) -mxpa) -cflags-$(toolchain-xpa) += -DTOOLCHAIN_SUPPORTS_XPA -toolchain-crc := $(call cc-option-yn,$(mips-cflags) -Wa$(comma)-mcrc) -cflags-$(toolchain-crc) += -DTOOLCHAIN_SUPPORTS_CRC -toolchain-dsp := $(call cc-option-yn,$(mips-cflags) -Wa$(comma)-mdsp) -cflags-$(toolchain-dsp) += -DTOOLCHAIN_SUPPORTS_DSP -toolchain-ginv := $(call cc-option-yn,$(mips-cflags) -Wa$(comma)-mginv) -cflags-$(toolchain-ginv) += -DTOOLCHAIN_SUPPORTS_GINV +ifneq ($(call cc-option,-mmicromips -Wa$(comma)-fatal-warnings -mxpa),) +cflags-y += -DTOOLCHAIN_SUPPORTS_XPA +endif +ifneq ($(call cc-option,-Wa$(comma)-mcrc),) +cflags-y += -DTOOLCHAIN_SUPPORTS_CRC +endif +ifneq ($(call cc-option,-Wa$(comma)-mdsp),) +cflags-y += -DTOOLCHAIN_SUPPORTS_DSP +endif +ifneq ($(call cc-option,-Wa$(comma)-mginv),) +cflags-y += -DTOOLCHAIN_SUPPORTS_GINV +endif # # Firmware support @@ -277,7 +277,7 @@ ifdef CONFIG_64BIT endif endif - ifeq ($(KBUILD_SYM32)$(call cc-option-yn,-msym32), yy) + ifeq ($(KBUILD_SYM32)$(call cc-option,-msym32), y-msym32) cflags-y += -msym32 -DKBUILD_64BIT_SYM32 else ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y) diff --git a/arch/mips/sgi-ip22/Platform b/arch/mips/sgi-ip22/Platform index 62fa30bb959e..fd8f1d01c867 100644 --- a/arch/mips/sgi-ip22/Platform +++ b/arch/mips/sgi-ip22/Platform @@ -24,8 +24,8 @@ endif # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys # ifdef CONFIG_SGI_IP28 - ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n) - $(error gcc doesn't support needed option -mr10k-cache-barrier=store) + ifeq ($(call cc-option,-march=r10000 -mr10k-cache-barrier=store),) + $(error $(CC) doesn't support needed option -mr10k-cache-barrier=store) endif endif cflags-$(CONFIG_SGI_IP28) += -mr10k-cache-barrier=store -I$(srctree)/arch/mips/include/asm/mach-ip28 From patchwork Tue Aug 17 00:21:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DB28C4338F for ; Tue, 17 Aug 2021 00:21:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A2926056B for ; Tue, 17 Aug 2021 00:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234599AbhHQAVy (ORCPT ); Mon, 16 Aug 2021 20:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbhHQAVy (ORCPT ); Mon, 16 Aug 2021 20:21:54 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23F0BC061764 for ; Mon, 16 Aug 2021 17:21:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id b4-20020a252e440000b0290593da85d104so18619630ybn.6 for ; Mon, 16 Aug 2021 17:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=GevpZaQQXx6uJazNaaL+jipz4XqGAMmvjabHC4B/TIQ=; b=MScZ8npAWuWl2n5WACKsqP8jI8+/lFmzfUiNk9uT7xhF6EzFjzIikN/4YhY3uTeZ2x K8coom07pnPTFK3+tFw60liHvWz6Z7w5kbuUiwgu7/cSpVlWzAR+pnpPZqSkCkVSzLR3 tUNh36dKOSdq0S6zkfn4e6KjPFg2LJq97SrGIM8AiEmlF/j4TGZ3lnxHuJZnXZ+QAi6R R6hprfvD6Js8ESDZZYcfEkIW+qnf70q3gcHsRHViGriHkuwWDMDDgNPNiz1zrClzNxI7 H2AWhD+4szOvfOVdzeOMaGyuEx/4GfP3AlsFPougYaSMIXQDQQYBtCXa4DbfQgBg+Aut zc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=GevpZaQQXx6uJazNaaL+jipz4XqGAMmvjabHC4B/TIQ=; b=HZtImsodo1flKjx+25OXKDLeqj9VlxUbv+7xJUyJ+oXGtvr1aC808o3S5fv+fp7Msa 1ccty3KEahWbUsJ6sSgvsJvi5xTPNxZI+CrPbhCgqyEQpyrWkLRhpfNFGNH5A1UkWJCi 3mwb7VuF/hDEqnjFkphwEHDRhZodOH9NvD/lc9h99Xaowm0kypUOGLl9EeIAU12JE5hF Lh9itWP+p6+CwmEz9Uq+AYoVDUr7gC0cTdFoppXXbccySJhU3/KpIDke/bUwK9LTA466 8pd2bJAdt8092QyVTAHj6kLi3jvenbaOXeIij8m48LHjArAz3Miey1zd/JdJF//qeMWi 42Ag== X-Gm-Message-State: AOAM533P92n072zZO4H85HdNnKjx2fqWktK653JC//Xt6l4jTGGxb/Yq BLFF0jydVTX91MpTNX1cUZF2t0x7SX0YvSqtXKc= X-Google-Smtp-Source: ABdhPJxL7VirAAAFQMCSntsswKKgERjdwzETy0eVm86bC90eEJ+t7AvAdwCfkOc72YkQySg3+82ZTFoLk2T9BRbqHBQ= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a25:b845:: with SMTP id b5mr888141ybm.343.1629159681391; Mon, 16 Aug 2021 17:21:21 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:04 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-3-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 2/7] s390: replace cc-option-yn uses with cc-option From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: linux-s390@vger.kernel.org Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Acked-by: Heiko Carstens --- arch/s390/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 17dc4f1ac4fa..a3cf33ad009f 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -70,7 +70,7 @@ cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include # cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls -ifeq ($(call cc-option-yn,-mpacked-stack -mbackchain -msoft-float),y) +ifneq ($(call cc-option,-mpacked-stack -mbackchain -msoft-float),) cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK endif @@ -78,22 +78,22 @@ endif KBUILD_AFLAGS_DECOMPRESSOR += $(aflags-y) KBUILD_CFLAGS_DECOMPRESSOR += $(cflags-y) -ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) +ifneq ($(call cc-option,-mstack-size=8192 -mstack-guard=128),) cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) -ifneq ($(call cc-option-yn,-mstack-size=8192),y) +ifeq ($(call cc-option,-mstack-size=8192),) cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) endif endif ifdef CONFIG_WARN_DYNAMIC_STACK - ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) + ifneq ($(call cc-option,-mwarn-dynamicstack),) KBUILD_CFLAGS += -mwarn-dynamicstack KBUILD_CFLAGS_DECOMPRESSOR += -mwarn-dynamicstack endif endif ifdef CONFIG_EXPOLINE - ifeq ($(call cc-option-yn,$(CC_FLAGS_MARCH) -mindirect-branch=thunk),y) + ifneq ($(call cc-option,$(CC_FLAGS_MARCH) -mindirect-branch=thunk),) CC_FLAGS_EXPOLINE := -mindirect-branch=thunk CC_FLAGS_EXPOLINE += -mfunction-return=thunk CC_FLAGS_EXPOLINE += -mindirect-branch-table @@ -104,10 +104,10 @@ ifdef CONFIG_EXPOLINE endif ifdef CONFIG_FUNCTION_TRACER - ifeq ($(call cc-option-yn,-mfentry -mnop-mcount),n) + ifeq ($(call cc-option,-mfentry -mnop-mcount),) # make use of hotpatch feature if the compiler supports it cc_hotpatch := -mhotpatch=0,3 - ifeq ($(call cc-option-yn,$(cc_hotpatch)),y) + ifneq ($(call cc-option,$(cc_hotpatch)),) CC_FLAGS_FTRACE := $(cc_hotpatch) KBUILD_AFLAGS += -DCC_USING_HOTPATCH KBUILD_CFLAGS += -DCC_USING_HOTPATCH From patchwork Tue Aug 17 00:21:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89988C4338F for ; Tue, 17 Aug 2021 00:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 755B460EE4 for ; Tue, 17 Aug 2021 00:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233010AbhHQAV5 (ORCPT ); Mon, 16 Aug 2021 20:21:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbhHQAV4 (ORCPT ); Mon, 16 Aug 2021 20:21:56 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82EA3C061764 for ; Mon, 16 Aug 2021 17:21:24 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b9-20020a5b07890000b0290558245b7eabso18632048ybq.10 for ; Mon, 16 Aug 2021 17:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=3mIJT3ikKBz70xHqPeYP9DUuj3yJmyYSvnlROWprNU0=; b=jkUmqiWkUIn11XZwndfNewlhPuEQQy8ysb2pdFSiPo5hAHF2dxek21dMO+EdjI7641 /QeXZBfXv0zovdWxI0x5OjZ30z+ss9QsEBiRa/67SyuQm48imip28lKvf9UeImZt1uUe ZS2zuIMf3X5fCZCnXYrDxAu/NxPAN/UPBHgVFRlgUOHFpU3WZWgNosd4NNATCZ8666aR HQ2Ubw0j/af2Yhf0zeBGo8lD7GmzghODJyC0K6zT6/xIpOVOHUi6ID/HVcsW2Aadifqo K7fO0AGZlV23M+MHKq/xh76t24+tK9cwHpW34jjrZYXB5aDlRZU3STy/oLio97USMv+4 f8aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=3mIJT3ikKBz70xHqPeYP9DUuj3yJmyYSvnlROWprNU0=; b=PSzIEfz7OCRsDEUjSDrZLSEnFNxuLHFqHNYG0yoG0d3H1kjxjS0IjHs93+XREsh64l rgXvhDYirTUo+9uKNZea3jOs71il7tz0aqYDTMp3a11Hd3cUdfpSsE1zxIbhf51Xizms U/c7wzrASfUV8ffUuAkcKPtGuOmhdnLKANX9llMUG50qrSxCDn/hjdKPiKgp0ITEIt9f nOBhueW3/H5mtPyTYjHbVCkfzws6lHoOuBBdOrxxoew7Lpes7cGMFh3qiEqG2u/UwVp5 pVRi797Sczm/MwvD8HRIChD5ZGekwg5XFzrLLUBGnBICdrIIg6dqbBZb94SqZle6+aEd W9WA== X-Gm-Message-State: AOAM530vOv3Fueq+IN7+ZWJFgIi5X+lLBaI/2rbSLw86BxqomrWXtgil D3COm/HNqBbwjX/dMuosplHpaTOY35URLDKlKcc= X-Google-Smtp-Source: ABdhPJz+WFisbuTUhA9xMZaACAa+nhKyIKSUZly6CfYDeYL5RkUfu40rrbH/kYqR1wHiskhIB9bQNCgkGJwAypmpY8g= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a25:ca8b:: with SMTP id a133mr882102ybg.339.1629159683765; Mon, 16 Aug 2021 17:21:23 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:05 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-4-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 3/7] powerpc: replace cc-option-yn uses with cc-option From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nick Desaulniers --- arch/powerpc/Makefile | 12 ++++++------ arch/powerpc/boot/Makefile | 5 +---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 9aaf1abbc641..85e224536cf7 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -12,12 +12,12 @@ # Rewritten by Cort Dougan and Paul Mackerras # -HAS_BIARCH := $(call cc-option-yn, -m32) +HAS_BIARCH := $(call cc-option,-m32) # Set default 32 bits cross compilers for vdso and boot wrapper CROSS32_COMPILE ?= -ifeq ($(HAS_BIARCH),y) +ifeq ($(HAS_BIARCH),-m32) ifeq ($(CROSS32_COMPILE),) ifdef CONFIG_PPC32 # These options will be overridden by any -mcpu option that the CPU @@ -107,7 +107,7 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian -ifeq ($(HAS_BIARCH),y) +ifeq ($(HAS_BIARCH),-m32) KBUILD_CFLAGS += -m$(BITS) KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) @@ -125,7 +125,9 @@ LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) ifdef CONFIG_PPC64 -ifeq ($(call cc-option-yn,-mcmodel=medium),y) +ifeq ($(call cc-option,-mcmodel=medium),) + export NO_MINIMAL_TOC := -mno-minimal-toc +else # -mcmodel=medium breaks modules because it uses 32bit offsets from # the TOC pointer to create pointers where possible. Pointers into the # percpu data area are created by this method. @@ -135,8 +137,6 @@ ifeq ($(call cc-option-yn,-mcmodel=medium),y) # kernel percpu data space (starting with 0xc...). We need a full # 64bit relocation for this to work, hence -mcmodel=large. KBUILD_CFLAGS_MODULE += -mcmodel=large -else - export NO_MINIMAL_TOC := -mno-minimal-toc endif endif diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 10c0fb306f15..33e1de5d1c95 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -66,10 +66,7 @@ ifdef CONFIG_DEBUG_INFO BOOTCFLAGS += -g endif -ifeq ($(call cc-option-yn, -fstack-protector),y) -BOOTCFLAGS += -fno-stack-protector -endif - +BOOTCFLAGS += $(call cc-option,-fstack-protector) BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) DTC_FLAGS ?= -p 1024 From patchwork Tue Aug 17 00:21:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E286C432BE for ; Tue, 17 Aug 2021 00:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FD9360F39 for ; Tue, 17 Aug 2021 00:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232929AbhHQAV7 (ORCPT ); Mon, 16 Aug 2021 20:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234864AbhHQAV7 (ORCPT ); Mon, 16 Aug 2021 20:21:59 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0826EC061764 for ; Mon, 16 Aug 2021 17:21:27 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id y185-20020a3764c20000b02903d2c78226ceso8424218qkb.6 for ; Mon, 16 Aug 2021 17:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=GoHRqY6WMaY6q/Xzrr4/n035GxGMZNNS93sY1WbcrOg=; b=TRXaJLDpWOVuB4lUnlR+yoS05hBwCJTWDCzu/pBp8cTnnT6F7Cj+KPqeJzpyjiuk9r D0TRbzxeB9Zm7bNFH9MsLf12RvSLW+1UOYiut9GL2AKqK2fXU7eS/y/1UG1PQ5o6FsBq nnDHDHobEWdCpHsYkT8jH8fhkzfbLxq3aL44Xvr9jF2ld0ZNagA7V0vv+QZ3qIfPjwrT qt7rhl74MpeqnLmGLafLTXAix2cNJWfEkg0DYO40xeQsuYCvcoj+Bk7IgkVdocaIUUej mMAI+Lt6hiJoGKph+Upxe2H1liP+TIPFQO6VnTiVprHWHg0ozuE/6Ztn3NQ5P6hvgtYS US2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=GoHRqY6WMaY6q/Xzrr4/n035GxGMZNNS93sY1WbcrOg=; b=pNCD6g5Od2U14ztTRQ/o/K8AJh/cNez59iFWTBrYhbqbs8bO/djnRC7JDwDBnNHujX uDVSTcPjW5R2XwqLhpORxHdDHt6J+4lWqtvBbH6Z7uO6SwEb+5yZAoRi9QU4EkyND5LC mHlFbgrNmI/l6g5jjrgmJM3lWAvmOvJdVEdkVRmwHHgESJybEnp+uclCEt8vSkugk5JE ZvuzRz0c77taTF8rznACXgpaxtXhJu48Y//I61CYYqA7NQLqlqImi8CGyJSjE3eCDwyF yCNG9ACMHCAYQilzDQlUriLOu+j0w0Hf/lsQPnW/usgXxM8HgWOOCR2Eg/Wnvsk15MVv JGJQ== X-Gm-Message-State: AOAM530U8rCHiRWVSvOMQk+gqOD7xR7+v24FXLTTJ+rLkGXhPHhxEooP 5L765++BIv5frAxT2D1kpAGzyHQ0r0BIyM6sm+4= X-Google-Smtp-Source: ABdhPJzQ7I5BJ/a8ZE26weFpk5AiUI/hLKNy4VKXu2vcVT32Uc9/c1Tf1DTt8IkYNyTPOt5ZrpKMfHQkkk9cIfkMEUQ= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a05:6214:410e:: with SMTP id kc14mr705288qvb.33.1629159686159; Mon, 16 Aug 2021 17:21:26 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:06 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-5-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 4/7] arc: replace cc-option-yn uses with cc-option From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Vineet Gupta , linux-snps-arc@lists.infradead.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- arch/arc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arc/Makefile b/arch/arc/Makefile index c0d87ac2e221..8782a03f24a8 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -18,8 +18,7 @@ ifeq ($(CONFIG_ARC_TUNE_MCPU),"") cflags-y += $(tune-mcpu-def-y) else tune-mcpu := $(shell echo $(CONFIG_ARC_TUNE_MCPU)) -tune-mcpu-ok := $(call cc-option-yn, $(tune-mcpu)) -ifeq ($(tune-mcpu-ok),y) +ifneq ($(call cc-option,$(tune-mcpu)),) cflags-y += $(tune-mcpu) else # The flag provided by 'CONFIG_ARC_TUNE_MCPU' option isn't known by this compiler From patchwork Tue Aug 17 00:21:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F238C4338F for ; Tue, 17 Aug 2021 00:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 832D160F55 for ; Tue, 17 Aug 2021 00:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232955AbhHQAWC (ORCPT ); Mon, 16 Aug 2021 20:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235031AbhHQAWB (ORCPT ); Mon, 16 Aug 2021 20:22:01 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FD80C061764 for ; Mon, 16 Aug 2021 17:21:29 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id p123-20020a378d810000b02903ad5730c883so14345873qkd.22 for ; Mon, 16 Aug 2021 17:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=lCzitv5KqDP2zQ/J1/ah211/+gv0A0rekzxCvgbF1SI=; b=EgGa8cEH+cvjhc8CYpQIpJ9bQQSvcQJ4L4U3Q5pjjb9uWqW39zYx2jd0FMB+lQnkbE An0x6lIh6/Eb2RnktrEIvf4PTAzr48EtGUDig7J1RtSF2QntYJsXF2laVbd3JKdeWe/U Dd1CG6gSytOTHWjxCEP5knKL//vo4QDmc3+Su6ZXS12JcBpMxATFmGNvSV5oUmELdjvp cklZsCd9ke/DGS8HtZTndN2TZtMVSwF/DvZVRsmNZbpY68PaGQv49ftiR3ETwF8gw45d m0nHO0GBN5jO3l25eLmqwcvjegOBZ7UsyONdq+Jc1YRwXhAhqClvgw2YdkHWidHf7mjI ksNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=lCzitv5KqDP2zQ/J1/ah211/+gv0A0rekzxCvgbF1SI=; b=EKf88UtT0AbXRtexJIpZIn+qWh4h/jrBQ7aHWsO56tJYVyGiUIw9aBhsyJ5BR2jJTo wz8fq7afDiUrBUYQokZeLjtTxSoks5s1rb8WU3rlRxDJvekcZ3jTaapy04yiITbjPxO4 4yx8boAMClGpMfyWGl+llucHhW6p6Jj25jxWYzgv8pPu3blw/d2OJZLjPt7YhjHptQAE 27l4vXBBwJJ7bT5pZJ6pfH14vheQO0OYMRzA7Vmy7LJIGStOgswrG7A2TKbNGEOvyuI4 CAL+OjORn0MZFplqic3y/GGl8IaprnHLEcNoe7MMcyMqhvWTcMgZ9UcwtQfgAt+Zq4in kkKA== X-Gm-Message-State: AOAM530RqpU2zBPYfv9284izmYza8IdOcs35HfzpobRJYLwb27+lzClD 2HE5PA57m9rl5r9w2tjG09EAQ+2jpTPAztrPo0c= X-Google-Smtp-Source: ABdhPJxi7Y4buskEdvwZ/sGx9Lmt0Tg50dSSuBLHSqynJCtblkmu1ij0dsS1ePWyu6nksQuQq/VUBS3KV2lZvZZh+vs= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a05:6214:2408:: with SMTP id fv8mr715411qvb.4.1629159688552; Mon, 16 Aug 2021 17:21:28 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:07 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-6-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 5/7] x86: remove cc-option-yn test for -mtune= From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org As noted in the comment, -mtune= has been supported since GCC 3.4. The minimum required version of GCC to build the kernel (as specified in Documentation/process/changes.rst) is GCC 4.9. tune is not immediately expanded. Instead it defines a macro that will test via cc-option later values for -mtune=. But we can skip the test whether to use -mtune= vs. -mcpu=. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: H. Peter Anvin Cc: x86@kernel.org Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Reviewed-by: Miguel Ojeda --- arch/x86/Makefile_32.cpu | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu index cd3056759880..e7355f8b51c2 100644 --- a/arch/x86/Makefile_32.cpu +++ b/arch/x86/Makefile_32.cpu @@ -2,13 +2,7 @@ # CPU tuning section - shared with UML. # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. -#-mtune exists since gcc 3.4 -HAS_MTUNE := $(call cc-option-yn, -mtune=i386) -ifeq ($(HAS_MTUNE),y) tune = $(call cc-option,-mtune=$(1),$(2)) -else -tune = $(call cc-option,-mcpu=$(1),$(2)) -endif cflags-$(CONFIG_M486SX) += -march=i486 cflags-$(CONFIG_M486) += -march=i486 From patchwork Tue Aug 17 00:21:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76D63C4338F for ; Tue, 17 Aug 2021 00:21:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F48E60F58 for ; Tue, 17 Aug 2021 00:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234864AbhHQAWE (ORCPT ); Mon, 16 Aug 2021 20:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234861AbhHQAWD (ORCPT ); Mon, 16 Aug 2021 20:22:03 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 839F6C061764 for ; Mon, 16 Aug 2021 17:21:31 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id m8-20020a05622a0548b029028e6910f18aso10233985qtx.4 for ; Mon, 16 Aug 2021 17:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=kQY8kOYZdYKiHWDklrQnDN9z/iRRKX3LSfg/PX+3Ycs=; b=l4JcmRDb9TBhkEtWZhsc0SxqfOzIUf9YXUnObA0+zhBM/AxirIBnlaurxqWctpKQvf SIUX7kAxcjbAPqWZvK1m0dqVy4cljFgfM6UQXl2rikBQWS+ngk0E0VOlqbGcNTJOLqLn Vpz11rhaZ3T14nLJw1/gaik1LdkWxJv6UpgRI1Apnk5voAs58cIrrH+13oO4BEJvMuZX czc49Vm58VCoIgBTuRJYcxVEFF865M6NSMTa8qLwPMHkqRBDkqN0TF4o6C0rP7i15k/r CuG/Xux2YsBusNXKOAGsdNyCSr2lNbKw8+MOWcwB02jDbpHhic2l6W/8sDRKAPbH7C2g OmEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=kQY8kOYZdYKiHWDklrQnDN9z/iRRKX3LSfg/PX+3Ycs=; b=psoYgJFaynt7cUuYsUZxDT0+ete1nOIT7oRW4laH+Su4BJkJM97arjpXukual/U5BC McK4pYGxZl3CpRmb9O7qBafdKp1Q4wQcobuh25lpaTOsXOnXRGd2vlr/q+4taSHMLqx2 QyjUIkx3tDeySp+wAkWOBI6uPMmohGHy56UfvtHbGr/yJFe7Eyl3kAj0U0kzTA07+STE XSadVMaSq3y0fMwKNLZ5Q6KhZ44Q841JTNaIec84FyRBXA3buIXk9UtCL/FBKf4WaJJW 956oJpAb8g6Ob32LvXBQWIYoHvpm1cnzFyb0pt/I2o1eg/nfimZRoWVYiKn7uM3AJ6r3 vFVw== X-Gm-Message-State: AOAM533QttqycOEUn8bW3/ceK8BVC4hlHenBH+x34i0M1+TCJZ7F8kKP bGVIhxBJqTtvQVSEeO9g5Lvd22nh5Snk/WE2Q8Q= X-Google-Smtp-Source: ABdhPJxTkZIv04ZmEfD+6QrC3ov/cXwEg1cbKJC+LxC+u+pxEQRLUIfuWwYxbvNk8n9zhFj4s1tTHYy/BW242JVyydo= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a05:6214:324:: with SMTP id j4mr727123qvu.34.1629159690697; Mon, 16 Aug 2021 17:21:30 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:08 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-7-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 6/7] Makefile: replace cc-option-yn uses with cc-option From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to pursue removing cc-option-yn. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 72f9e2b0202c..f76be5f62d79 100644 --- a/Makefile +++ b/Makefile @@ -967,7 +967,7 @@ ifdef CONFIG_FUNCTION_TRACER ifdef CONFIG_FTRACE_MCOUNT_USE_CC CC_FLAGS_FTRACE += -mrecord-mcount ifdef CONFIG_HAVE_NOP_MCOUNT - ifeq ($(call cc-option-yn, -mnop-mcount),y) + ifneq ($(call cc-option, -mnop-mcount),) CC_FLAGS_FTRACE += -mnop-mcount CC_FLAGS_USING += -DCC_USING_NOP_MCOUNT endif From patchwork Tue Aug 17 00:21:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12439537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A56B8C4338F for ; Tue, 17 Aug 2021 00:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8823160F39 for ; Tue, 17 Aug 2021 00:21:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234592AbhHQAWG (ORCPT ); Mon, 16 Aug 2021 20:22:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234935AbhHQAWF (ORCPT ); Mon, 16 Aug 2021 20:22:05 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE10BC061764 for ; Mon, 16 Aug 2021 17:21:33 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id f8-20020a2585480000b02905937897e3daso18476882ybn.2 for ; Mon, 16 Aug 2021 17:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=qcMahTy1suowLl0Za6h1NGXvaZHNK4dybAs/n3NhjkY=; b=JUWAV2ZYEqIQC3Ux793DZlWX9iwor5YW8CdB6qGRVZ/rRwnEz7GfmfZIcsvg5K4hoo 6Jr0n3VkX+TMyaLqpggQSjsX5PByPxo1Ic12Q5YB6HkRDbYPllDj0EuP1wg6X6aED/9a qU8AyCnA3uYFyAljtSUoQfeQ4RvoL+WlO/bLA+PuszjA3cKWjSCgi/4VoXMSJ4MDD1jE dcjA8gJUm5juKPCSYmBND5eCbCHhXNysG2U1xgrlKy1C9I2amsE9AW0bF3ilNqTeN/i3 FsPuy7vA3ciJm0p5Zb+jq+6lFcDW/P9h/uQG6Pgxlh+BcptF0WHCEH4JSxxCVEo3bPg3 auQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=qcMahTy1suowLl0Za6h1NGXvaZHNK4dybAs/n3NhjkY=; b=SMKirW81hEwWCERvB8LzhEagrNISCELLl3sklrlGNmkqO09+/R1sgOr0/KGJkEJuHp N8WczhnLLUju7gdeA6YgnRZU+9XYEYRwNDC4c8XxSBwX/czuIB9sU0lNy+wbMquVrSJA jE04GmHoJha9ApwYr7tActJ3E8wZe+9xnMIfwkTlgVrprhR/4tJ5/Mg/pjqgB3L83eUW WgkDMfnJxNa4eOmYetIL5dAfNDpcUisispcXxToEzIHbNkA5OtDEWrcqp2xyUtPTeaWd rpiC0K0D8PNE4ILK2+3KVlZabRcOQBzxCjEHRWNuC8DpCBhXVMdPLiLBoFC5i/UUfxSw aPww== X-Gm-Message-State: AOAM533qnaq67MZeTAuP6IYnpPC0ah7K3cTAXsK1WUIlCu7RV5TZZNM7 p03Hvl7G9KK92L8l7vYvBGCBcF4GAUasOD0T54c= X-Google-Smtp-Source: ABdhPJzmODTvvWWrj64eZq4jP794VshTQWPrTYo1h1WBN76TvzGVmHkmxCkYVpNH22qya/3hLKhwppUYj4Xx9J9MUg0= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:478:6e44:5cf7:fcde]) (user=ndesaulniers job=sendgmr) by 2002:a25:83cd:: with SMTP id v13mr865069ybm.325.1629159692935; Mon, 16 Aug 2021 17:21:32 -0700 (PDT) Date: Mon, 16 Aug 2021 17:21:09 -0700 In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com> Message-Id: <20210817002109.2736222-8-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210817002109.2736222-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH 7/7] kbuild: remove cc-option-yn, update Docs From: Nick Desaulniers To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-option-yn can be replaced with cc-option. ie. Checking for support: ifeq ($(call cc-option-yn,$(FLAG)),y) becomes: ifneq ($(call cc-option,$(FLAG)),) Checking for lack of support: ifeq ($(call cc-option-yn,$(FLAG)),n) becomes: ifeq ($(call cc-option,$(FLAG)),) This allows us to remove cc-option-yn. Do so and update the docs with examples. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- Documentation/kbuild/makefiles.rst | 22 +++++++++------------- scripts/Makefile.compiler | 5 ----- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst index db3af0b45baf..4538c36d8df0 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -650,24 +650,20 @@ more details, with real examples. -march=pentium-mmx if supported by $(CC), otherwise -march=i586. The second argument to cc-option is optional, and if omitted, cflags-y will be assigned no value if first option is not supported. - Note: cc-option uses KBUILD_CFLAGS for $(CC) options + Note: cc-option uses KBUILD_CFLAGS for $(CC) options. - cc-option-yn - cc-option-yn is used to check if gcc supports a given option - and return 'y' if supported, otherwise 'n'. + cc-option can be combined with conditionals to perform actions based on tool + support. Example:: - #arch/ppc/Makefile - biarch := $(call cc-option-yn, -m32) - aflags-$(biarch) += -a32 - cflags-$(biarch) += -m32 + ifneq ($(call cc-option,$(FLAG)),) + # $(FLAG) is supported - In the above example, $(biarch) is set to y if $(CC) supports the -m32 - option. When $(biarch) equals 'y', the expanded variables $(aflags-y) - and $(cflags-y) will be assigned the values -a32 and -m32, - respectively. - Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options + Or:: + + ifeq ($(call cc-option,$(FLAG)),) + # $(FLAG) is not supported cc-disable-warning cc-disable-warning checks if gcc supports a given warning and returns diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index 86ecd2ac874c..c19c0b544c0f 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -51,11 +51,6 @@ __cc-option = $(call try-run,\ cc-option = $(call __cc-option, $(CC),\ $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2)) -# cc-option-yn -# Usage: flag := $(call cc-option-yn,-march=winchip-c6) -cc-option-yn = $(call try-run,\ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) - # cc-disable-warning # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) cc-disable-warning = $(call try-run,\