Re: [PATCH v4 0/4] pass -march= only to compiler

From: Nick Desaulniers
Date: Fri Oct 14 2022 - 16:17:08 EST


On Fri, Oct 14, 2022 at 1:14 PM Nick Desaulniers
<ndesaulniers@xxxxxxxxxx> wrote:
>
> When both -march= and -Wa,-march= are specified for assembler or
> assembler-with-cpp sources, GCC and Clang will prefer the -Wa,-march=
> value but Clang will warn that -march= is unused.
>
> warning: argument unused during compilation: '-march=armv6k'
> [-Wunused-command-line-argument]
>
> This is the top group of warnings we observe when using clang to
> assemble the kernel via `ARCH=arm make LLVM=1`.
>
> Arnd sent a v2 of my previous patch
> https://lore.kernel.org/linux-arm-kernel/20210928154143.2106903-14-arnd@xxxxxxxxxx/
> I added yet a few more instances I found since then. Nathan pointed out
> a new one too that I've fixed since v3.
>
> Fixing this will allow us to enable
> -Werror=unused-command-line-argument for clang builds.
>
> v3 had an issue wrt. __thumb2__
> https://lore.kernel.org/llvm/CAKwvOdmkd2PxvMUZA=A-72eATGDZkqDj--Bv1W+Xt_K_LWdROA@xxxxxxxxxxxxxx/
> I've incorporated idea from Nathan and Ard on that.

I probably should have made a note: the base of this series is a
little funny. It's based on today's linux-next (20221014) but with
0a7606a9832ab375a38425a659bda13712ca89ae reverted. It sounds like
0a7606a9832ab375a38425a659bda13712ca89ae might be dropped from -next
imminently
https://lore.kernel.org/linux-next/CAK7LNARg8OpqLR_71PJV3ZoLuDV8+mz9mphg=CzEeEEMY0G3rw@xxxxxxxxxxxxxx/.
--
Thanks,
~Nick Desaulniers