Re: [PATCH] ARM: Ensure that NEON code always compiles with Clang
From: Arnd Bergmann
Date: Mon Mar 11 2019 - 12:22:16 EST
On Sat, Dec 15, 2018 at 10:24 PM Nathan Chancellor
<natechancellor@xxxxxxxxx> wrote:
> endif
> diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c
> index a6741a895189..4600b62d845f 100644
> --- a/arch/arm/lib/xor-neon.c
> +++ b/arch/arm/lib/xor-neon.c
> @@ -14,7 +14,7 @@
> MODULE_LICENSE("GPL");
>
> #ifndef __ARM_NEON__
> -#error You should compile this file with '-mfloat-abi=softfp -mfpu=neon'
> +#error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon'
> #endif
>
I see this patch has made it in now, but I also see two other problems with the
same file that prevent it from working right with clang:
- it triggers #warning This code requires at least version 4.6 of GCC
- As I reported in https://bugs.llvm.org/show_bug.cgi?id=40976, even
when it builds cleanly, it does not get vectorized.
Has anyone actually managed to get this to do the right thing?
Arnd