diff mbox series

[6/7] Makefile: replace cc-option-yn uses with cc-option

Message ID 20210817002109.2736222-7-ndesaulniers@google.com (mailing list archive)
State New, archived
Headers show
Series kbuild: remove cc-option-yn | expand

Commit Message

Nick Desaulniers Aug. 17, 2021, 12:21 a.m. UTC
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 <ndesaulniers@google.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nathan Chancellor Aug. 17, 2021, 2:09 a.m. UTC | #1
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.
> 
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>   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
>
Masahiro Yamada Aug. 25, 2021, 4:43 a.m. UTC | #2
On Tue, Aug 17, 2021 at 9:21 AM 'Nick Desaulniers' via Clang Built
Linux <clang-built-linux@googlegroups.com> 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.
>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
>  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
> --
> 2.33.0.rc1.237.g0d66db33f3-goog
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210817002109.2736222-7-ndesaulniers%40google.com.



I am fine with this change, but
is there any reason why you did not touch the following hunk?



ifdef CONFIG_HAVE_FENTRY
  # s390-linux-gnu-gcc did not support -mfentry until gcc-9.
  ifeq ($(call cc-option-yn, -mfentry),y)
    CC_FLAGS_FTRACE     += -mfentry
    CC_FLAGS_USING      += -DCC_USING_FENTRY
  endif
endif
Masahiro Yamada Aug. 25, 2021, 4:49 a.m. UTC | #3
On Wed, Aug 25, 2021 at 1:43 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Tue, Aug 17, 2021 at 9:21 AM 'Nick Desaulniers' via Clang Built
> Linux <clang-built-linux@googlegroups.com> 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.
> >
> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> > ---
> >  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
> > --
> > 2.33.0.rc1.237.g0d66db33f3-goog
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210817002109.2736222-7-ndesaulniers%40google.com.
>
>
>
> I am fine with this change, but
> is there any reason why you did not touch the following hunk?
>
>
>
> ifdef CONFIG_HAVE_FENTRY
>   # s390-linux-gnu-gcc did not support -mfentry until gcc-9.
>   ifeq ($(call cc-option-yn, -mfentry),y)
>     CC_FLAGS_FTRACE     += -mfentry
>     CC_FLAGS_USING      += -DCC_USING_FENTRY
>   endif
> endif
>


Ah, I just recalled that this hunk was restored
after a build error was reported:

https://lore.kernel.org/lkml/CAKwvOdkckey1=VUHApTcJYufyhdRJ=jb4qYs52f59g6ha7qphw@mail.gmail.com/



So, please send v2, changing -mfentry part in the same way.
diff mbox series

Patch

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