Message ID | 20210817002109.2736222-3-ndesaulniers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | kbuild: remove cc-option-yn | expand |
On 8/16/2021 5:21 PM, 'Nick Desaulniers' via Clang Built Linux wrote: > 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 <hca@linux.ibm.com> > Cc: Vasily Gorbik <gor@linux.ibm.com> > Cc: Christian Borntraeger <borntraeger@de.ibm.com> > Cc: linux-s390@vger.kernel.org > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> > --- > 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 >
On Mon, Aug 16, 2021 at 05:21:04PM -0700, Nick Desaulniers wrote: > 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 <hca@linux.ibm.com> > Cc: Vasily Gorbik <gor@linux.ibm.com> > Cc: Christian Borntraeger <borntraeger@de.ibm.com> > Cc: linux-s390@vger.kernel.org > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> > --- > arch/s390/Makefile | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Acked-by: Heiko Carstens <hca@linux.ibm.com>
On Tue, Aug 24, 2021 at 2:43 AM Heiko Carstens <hca@linux.ibm.com> wrote: > > On Mon, Aug 16, 2021 at 05:21:04PM -0700, Nick Desaulniers wrote: > > 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 <hca@linux.ibm.com> > > Cc: Vasily Gorbik <gor@linux.ibm.com> > > Cc: Christian Borntraeger <borntraeger@de.ibm.com> > > Cc: linux-s390@vger.kernel.org > > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> > > --- > > arch/s390/Makefile | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > Acked-by: Heiko Carstens <hca@linux.ibm.com> Applied to linux-kbuild.
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
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 <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: linux-s390@vger.kernel.org Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> --- arch/s390/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)