Re: mainline build failure for x86_64 and arm64 with clang

From: Nick Desaulniers
Date: Mon Sep 26 2022 - 13:33:27 EST


On Mon, Sep 26, 2022 at 8:40 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> Thanks for testing and the report! I noticed this over the weekend, it
> comes from a new warning in clang:
>
> https://github.com/llvm/llvm-project/commit/e07ead85a368173a56e96a21d6841aa497ad80f8
>
> It was brought up on GitHub as well:
>
> https://github.com/ClangBuiltLinux/linux/issues/1720
>
> I have reported this to the clang developers upstream to see if there is
> any way that the diagnostic could be improved:
>
> https://reviews.llvm.org/D134461#3815298
>
> Otherwise, we will just have to disable it, which I will send a patch
> for later if the warning is not going to be adjusted in any way.
>
> If you wanted to continue testing with upstream LLVM, you can either
> just revert that commit or explicitly disable -Wvoid-ptr-dereference in
> the main Makefile like so, which is ultimately what I will send if I
> need to.
>
> Cheers,
> Nathan

Thanks for the reports. It sounds like the Clang developers will pare
back the warning for unevaluated contexts (sizeof, typeof). If it
takes longer than a few days for that to land, let's send your below
patch to help keep CI systems green.

Consider putting the below into
scripts/Makefile.extrawarn

>
> diff --git a/Makefile b/Makefile
> index 647a42a1f800..0bf60134f13c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -967,6 +967,9 @@ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
> # Another good warning that we'll want to enable eventually
> KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
>
> +# New warning from clang that is quite noisy due to '__is_constexpr'
> +KBUILD_CFLAGS += $(call cc-disable-warning, void-ptr-dereference)
> +
> # Enabled with W=2, disabled by default as noisy
> ifdef CONFIG_CC_IS_GCC
> KBUILD_CFLAGS += -Wno-maybe-uninitialized



--
Thanks,
~Nick Desaulniers