diff --git a/CMakeLists.txt b/CMakeLists.txt index 77e5398b6a..11bbe36d2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,7 +153,7 @@ if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)") arm/arm_init.c arm/filter_neon_intrinsics.c arm/palette_neon_intrinsics.c) - if(NOT MSVC) + if(NOT MSVC AND NOT TARGET_ARCH MATCHES "^(ARM64|arm64|aarch64)") list(APPEND libpng_arm_sources arm/filter_neon.S) endif() if(PNG_ARM_NEON STREQUAL "on") diff --git a/Makefile.am b/Makefile.am index 1f06c703a1..5cc27a4c8f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -107,9 +107,11 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\ png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa if PNG_ARM_NEON +if PNG_ARM_NEON_ASM +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/filter_neon.S +endif libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\ - arm/filter_neon.S arm/filter_neon_intrinsics.c \ - arm/palette_neon_intrinsics.c + arm/filter_neon_intrinsics.c arm/palette_neon_intrinsics.c endif if PNG_MIPS_MSA diff --git a/configure.ac b/configure.ac index 2c6b3333c6..e3c1536f0c 100644 --- a/configure.ac +++ b/configure.ac @@ -425,6 +425,16 @@ AM_CONDITIONAL([PNG_ARM_NEON], *) test "$enable_arm_neon" != '' ;; esac]) +# Add the assembler implementation source file. This only works on 32-bit +# ARM and causes problems even if empty on 64-bit ARM. +AM_CONDITIONAL([PNG_ARM_NEON_ASM], + [test "$enable_arm_neon" != 'no' && + case "$host_cpu" in + arm64*|aarch64*) false ;; + arm*) true ;; + *) test "$enable_arm_neon" != '' ;; + esac]) + # MIPS MSA # ========