Re: [PATCH] kbuild: add most of Clang-specific flags unconditionally

From: Nick Desaulniers
Date: Fri May 10 2019 - 13:58:40 EST


On Fri, May 10, 2019 at 6:54 AM Masahiro Yamada
<yamada.masahiro@xxxxxxxxxxxxx> wrote:
>
> On Thu, May 9, 2019 at 4:06 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
> >
> > On Thu, May 9, 2019 at 8:45 AM Masahiro Yamada
> > <yamada.masahiro@xxxxxxxxxxxxx> wrote:
> > >
> > > We do not support old Clang versions. Upgrade your clang version
> > > if any of these flags is unsupported.
> > >
> > > Let's add flags within ifdef CONFIG_CC_IS_CLANG unconditionally,
> > > except -fcatch-undefined-behavior.
> > >
> > > Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
> >
> > Looks good to me.
> >
> > Reviewed-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
> >
> > Just as sidenote:
> > I experimented with a snapshot version of clang-9 and lld-9 and could
> > build, link and boot on bare-metal with '-mglobal-merge' on
> > Debian/buster AMD64.
>
>
> The comment says
> # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
> # source of a reference will be _MergedGlobals and not on of the
> whitelisted names.
> # See modpost pattern 2
>
> So, it seems it is just a matter of modpost,
> but I am not sure enough.
>
> This flag has been here since the initial support.
> (61163efae02040f66a95c8ed17f4407951ba58fa)
>
>
> Perhaps, we should review clang flags one by one again?

Yes, it's always good to re-evaluate if something is just cruft and
can be removed.

+Behan

I don't quite understand the comment about _MergedGlobals, Behan, do
happen to have more context?
--
Thanks,
~Nick Desaulniers