Re: cc-option-yn necessary? (vs cc-option)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 10, 2021 at 5:05 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
>
> On Wed, Aug 11, 2021 at 2:58 AM Nick Desaulniers
> <ndesaulniers@xxxxxxxxxx> wrote:
> >
> > Masahiro,
> > I was looking through the uses of cc-option, cc-option-yn, and
> > cc-disable-warning to see what we're missing support for in Clang.
> >
> > I have a short list of places where cc-option can be removed at
> > https://github.com/ClangBuiltLinux/linux/issues/1436#issuecomment-895557491
> > because all supported versions of supported toolchains support these
> > flags.  These should remove a few unnecessary compiler invocations.
> >
> > There are also a few cc-option tests that are very compiler specific,
> > so those might be convertible to just check CC_IS_* rather than
> > cc-option (I'll have to verify).
> >
> > Another thing I noticed is that it seems that most uses of
> > cc-option-yn are replaceable with simply cc-option when they use
> > cc-option-yn but check that the result is equal to y. I think even the
> > cases that check against n could be converted to:
> >
> > Examples:
> > arch/x86/Makefile
> > From:
> > ifeq ($(call cc-option-yn, -mfentry), n)
> > To:
> > ifeq ($(call cc-option,-mfentry),)
> > (Though technically, all supported versions of gcc and clang support
> > -mfentry, so this block should just be deleted)
> >
> > arch/powerpc/Makefile
> > From:
> > ifeq ($(call cc-option-yn,-mcmodel=medium),y)
> > To:
> > ifneq ($(call cc-option,-mcmodel=medium),)
> >
> > Then perhaps we could consolidate cc-option-yn into cc-option?  What
> > are your thoughts? Should I start sending you patches for all of the
> > above?
>
>
> Yes, I think it is a nice clean-up.
>
> Patches are welcome.

https://lore.kernel.org/linux-kbuild/20210817002109.2736222-8-ndesaulniers@xxxxxxxxxx/

-- 
Thanks,
~Nick Desaulniers



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux