public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com,
	Nick Desaulniers <ndesaulniers@google.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 3/7] powerpc: replace cc-option-yn uses with cc-option
Date: Mon, 16 Aug 2021 17:21:05 -0700	[thread overview]
Message-ID: <20210817002109.2736222-4-ndesaulniers@google.com> (raw)
In-Reply-To: <20210817002109.2736222-1-ndesaulniers@google.com>

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 <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 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
-- 
2.33.0.rc1.237.g0d66db33f3-goog


  parent reply	other threads:[~2021-08-17  0:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17  0:21 [PATCH 0/7] kbuild: remove cc-option-yn Nick Desaulniers
2021-08-17  0:21 ` [PATCH 1/7] MIPS: replace cc-option-yn uses with cc-option Nick Desaulniers
2021-08-17  1:59   ` Nathan Chancellor
2021-08-17  0:21 ` [PATCH 2/7] s390: " Nick Desaulniers
2021-08-17  2:03   ` Nathan Chancellor
2021-08-23 17:43   ` Heiko Carstens
2021-08-25  4:37     ` Masahiro Yamada
2021-08-17  0:21 ` Nick Desaulniers [this message]
2021-08-17  1:41   ` [PATCH 3/7] powerpc: " Nathan Chancellor
2021-08-17  2:31   ` Michael Ellerman
2021-08-19 20:04     ` Masahiro Yamada
2021-08-17  0:21 ` [PATCH 4/7] arc: " Nick Desaulniers
2021-08-17  2:05   ` Nathan Chancellor
2021-08-17 18:07     ` Nick Desaulniers
2021-08-18  1:40       ` Nathan Chancellor
2021-08-25  4:38         ` Masahiro Yamada
2021-08-17  0:21 ` [PATCH 5/7] x86: remove cc-option-yn test for -mtune= Nick Desaulniers
2021-08-17  2:08   ` Nathan Chancellor
2021-08-19 19:54   ` Masahiro Yamada
2021-08-19 22:19   ` Miguel Ojeda
2021-08-25  4:39     ` Masahiro Yamada
2021-08-17  0:21 ` [PATCH 6/7] Makefile: replace cc-option-yn uses with cc-option Nick Desaulniers
2021-08-17  2:09   ` Nathan Chancellor
2021-08-25  4:43   ` Masahiro Yamada
2021-08-25  4:49     ` Masahiro Yamada
2021-08-17  0:21 ` [PATCH 7/7] kbuild: remove cc-option-yn, update Docs Nick Desaulniers
2021-08-17  2:10   ` Nathan Chancellor

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=20210817002109.2736222-4-ndesaulniers@google.com \
    --to=ndesaulniers@google.com \
    --cc=benh@kernel.crashing.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=masahiroy@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /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