Build fails for ARM with -DENABLE_ASSEMBLY=OFF
Issue #584
new
Hi, im unable to build for armv7 with -DENABLE_ASSEMBLY=OFF
:
...
[100%] Linking CXX executable x265
/usr/bin/cmake -E cmake_link_script CMakeFiles/cli.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -DNDEBUG -rdynamic CMakeFiles/cli.dir/input/input.cpp.o CMakeFiles/cli.dir/input/y4m.cpp.o CMakeFiles/cli.dir/input/yuv.cpp.o CMakeFiles/cli.dir/output/output.cpp.o CMakeFiles/cli.dir/output/raw.cpp.o CMakeFiles/cli.dir/output/reconplay.cpp.o CMakeFiles/cli.dir/output/y4m.cpp.o CMakeFiles/cli.dir/output/yuv.cpp.o CMakeFiles/cli.dir/x265.cpp.o CMakeFiles/cli.dir/x265cli.cpp.o CMakeFiles/cli.dir/abrEncApp.cpp.o -o x265 libx265.a -lpthread -lrt -ldl
/usr/lib/gcc/armv7-alpine-linux-musleabihf/9.3.0/../../../../armv7-alpine-linux-musleabihf/bin/ld: libx265.a(cpu.cpp.o): in function `x265::cpu_detect(bool)':
cpu.cpp:(.text+0x11c): undefined reference to `x265_cpu_neon_test'
/usr/lib/gcc/armv7-alpine-linux-musleabihf/9.3.0/../../../../armv7-alpine-linux-musleabihf/bin/ld: cpu.cpp:(.text+0x130): undefined reference to `x265_cpu_fast_neon_mrc_test'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cli.dir/build.make:258: x265] Error 1
make[2]: Leaving directory '/multicoreware-x265_git-a4f320054d67/build/linux'
make[1]: *** [CMakeFiles/Makefile2:198: CMakeFiles/cli.dir/all] Error 2
I think the problem is that in source/common/primitives.cpp
the condition for including NOP functions for NEON detection have been inverted. If I change #if X265_ARCH_ARM == 0
to #if X265_ARCH_ARM != 0
it seems to work for me.