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

From: Masahiro Yamada
Date: Fri May 10 2019 - 09:55:34 EST


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?




> But forgot to document in [1].
>
> [1] https://github.com/ClangBuiltLinux/linux/issues/431



--
Best Regards
Masahiro Yamada