Re: [PATCH] Makefile: remove stale cc-option checks

From: Nick Desaulniers
Date: Mon Aug 16 2021 - 16:06:29 EST


On Fri, Aug 13, 2021 at 6:43 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
>
> On Wed, Aug 11, 2021 at 5:42 AM Nick Desaulniers
> <ndesaulniers@xxxxxxxxxx> wrote:
> >
> > diff --git a/Makefile b/Makefile
> > index 027fdf2a14fe..3e3fb4affba1 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -798,7 +801,7 @@ include/config/auto.conf:
> > endif # may-sync-config
> > endif # need-config
> >
> > -KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
> > +KBUILD_CFLAGS += -fno-delete-null-pointer-checks
> > KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
> > KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
> > KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
> > @@ -844,17 +847,17 @@ KBUILD_RUSTFLAGS += -Copt-level=z
> > endif
> >
> > # Tell gcc to never replace conditional load with a non-conditional one
> > -KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
> > +ifdef CONFIG_CC_IS_GCC
>
>
> Can you insert a comment here?
>
> # GCC 10 renamed --param=allow-store-data-races=0 to --allow-store-data-races
>
>
> It will remind us of dropping this conditional
> in the (long long distant) future.
>
>
>
>
> > +KBUILD_CFLAGS += $(call cc-option,--allow-store-data-races,--param=allow-store-data-races=0)
> > KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
> > +endif

So it looks like `-fallow-store-data-races` was also supported. Reading through
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97309
https://gcc.gnu.org/wiki/Atomic/GCCMM/ExecutiveSummary
it seems that the default is not to allow "store data races." So I
should not be adding `--allow-store-data-races` or
`-fallow-store-data-races`; so this just should be the existing test,
with a comment that it can be removed once gcc-10+ is the minimum.
Will update that in v2.
--
Thanks,
~Nick Desaulniers