android_kernel_oneplus_msm8998/arch/arm/lib
Nathan Chancellor b67ef52116 ARM: 8833/1: Ensure that NEON code always compiles with Clang
[ Upstream commit de9c0d49d85dc563549972edc5589d195cd5e859 ]

While building arm32 allyesconfig, I ran into the following errors:

  arch/arm/lib/xor-neon.c:17:2: error: You should compile this file with
  '-mfloat-abi=softfp -mfpu=neon'

  In file included from lib/raid6/neon1.c:27:
  /home/nathan/cbl/prebuilt/lib/clang/8.0.0/include/arm_neon.h:28:2:
  error: "NEON support not enabled"

Building V=1 showed NEON_FLAGS getting passed along to Clang but
__ARM_NEON__ was not getting defined. Ultimately, it boils down to Clang
only defining __ARM_NEON__ when targeting armv7, rather than armv6k,
which is the '-march' value for allyesconfig.

>From lib/Basic/Targets/ARM.cpp in the Clang source:

  // This only gets set when Neon instructions are actually available, unlike
  // the VFP define, hence the soft float and arch check. This is subtly
  // different from gcc, we follow the intent which was that it should be set
  // when Neon instructions are actually available.
  if ((FPU & NeonFPU) && !SoftFloat && ArchVersion >= 7) {
    Builder.defineMacro("__ARM_NEON", "1");
    Builder.defineMacro("__ARM_NEON__");
    // current AArch32 NEON implementations do not support double-precision
    // floating-point even when it is present in VFP.
    Builder.defineMacro("__ARM_NEON_FP",
                        "0x" + Twine::utohexstr(HW_FP & ~HW_FP_DP));
  }

Ard Biesheuvel recommended explicitly adding '-march=armv7-a' at the
beginning of the NEON_FLAGS definitions so that __ARM_NEON__ always gets
definined by Clang. This doesn't functionally change anything because
that code will only run where NEON is supported, which is implicitly
armv7.

Link: https://github.com/ClangBuiltLinux/linux/issues/287

Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-27 09:33:51 +02:00
..
ashldi3.S
ashrdi3.S
backtrace.S
bitops.h
bswapsdi2.S
call_with_stack.S ARM: replace BSYM() with badr assembly macro 2015-05-08 17:33:50 +01:00
changebit.S
clear_user.S ARM: 8438/1: Add unwinding to __clear_user_std() 2015-10-03 16:36:45 +01:00
clearbit.S
copy_from_user.S ARM: uaccess: provide uaccess_save_and_enable() and uaccess_restore() 2015-08-25 16:14:43 +01:00
copy_page.S
copy_template.S ARM: 8225/1: Add unwinding support for memory copy functions 2014-11-27 16:00:25 +00:00
copy_to_user.S ARM: uaccess: provide uaccess_save_and_enable() and uaccess_restore() 2015-08-25 16:14:43 +01:00
csumipv6.S
csumpartial.S
csumpartialcopy.S
csumpartialcopygeneric.S
csumpartialcopyuser.S ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch 2018-03-03 10:19:41 +01:00
delay-loop.S
delay.c ARM: ensure delay timer has sufficient accuracy for delays 2015-04-14 22:28:07 +01:00
div64.S
ecard.S
findbit.S
floppydma.S
getuser.S ARM: 8772/1: kprobes: Prohibit kprobes on get_user functions 2018-05-26 08:48:57 +02:00
io-acorn.S
io-readsb.S
io-readsl.S
io-readsw-armv3.S
io-readsw-armv4.S
io-writesb.S
io-writesl.S
io-writesw-armv3.S
io-writesw-armv4.S
lib1funcs.S ARM: lib/lib1funcs.S: fix typo s/substractions/subtractions/ 2015-05-26 15:28:34 +02:00
lshrdi3.S
Makefile ARM: 8833/1: Ensure that NEON code always compiles with Clang 2019-04-27 09:33:51 +02:00
memchr.S
memcpy.S ARM: avoid unwanted GCC memset()/memcpy() optimisations for IO variants 2015-07-03 20:46:15 +01:00
memmove.S ARM: 8224/1: Add unwinding support for memmove function 2014-11-27 16:00:24 +00:00
memset.S ARM: avoid unwanted GCC memset()/memcpy() optimisations for IO variants 2015-07-03 20:46:15 +01:00
memzero.S ARM: 8223/1: Add unwinding support for __memzero function 2014-11-27 16:00:23 +00:00
muldi3.S
putuser.S
setbit.S
strchr.S
strrchr.S
testchangebit.S
testclearbit.S
testsetbit.S
uaccess_with_memcpy.c ARM: fix uaccess_with_memcpy() with SW_DOMAIN_PAN 2015-12-15 11:51:02 +00:00
ucmpdi2.S
xor-neon.c ARM: 8833/1: Ensure that NEON code always compiles with Clang 2019-04-27 09:33:51 +02:00