Missing -mfpu=neon in CFLAGS/CXXFLAGS when building for ARM and NEON is supported but not gcc's default
You get errors like :
/tmp/cc8SYNiA.s:30: Error: selected FPU does not support instruction -- `vmov.f32 q8,#0.0'
And when using verbose mode, you can see there is no -mfpu=neon given to GCC. Retrying the same command with -mfpu=neon makes it compile.
The platform was a zynq, so it does support NEON and cmake properly detected support of it.
#1 Updated by Philip Balister 12 months ago
Use a toolchain file. Auto detect for NEON is broken in the cmake. See:
for an example.
#3 Updated by Sylvain Munaut 11 months ago
Well yes, using a toolchain file "fixes it" ... but IMHO that's only a work around. The build process does detect neon automatically properly and put the HAS_NEON (or similar) defines, but it doesn't set -mfpu=neon in the CFLAGS and it should do that on its own IMHO.
#5 Updated by Sylvain Munaut 11 months ago
My main point here is the behavior is not consistent. Either it uses neon automatically and it should set that CFLAG. Or it doesn't and expect the use to manually enable it and use a toolchain file. But here it enables assembly neon code automatically but doesn't set the CFLAG.
And my cmake sucks too or there would be a patch attached to this ticket :p