direwolf: actually disable neon on arm32

fixes #48299
This commit is contained in:
classabbyamp 2024-01-21 15:17:34 -05:00
parent f60a4892ed
commit 16b99b0cd8
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
2 changed files with 34 additions and 12 deletions

View File

@ -0,0 +1,33 @@
disable NEON instructions on arm32
--- a/cmake/modules/FindCPUflags.cmake
+++ b/cmake/modules/FindCPUflags.cmake
@@ -350,27 +350,7 @@ else ()
set(HAS_AVX512 OFF CACHE BOOL "Architecture does not have AVX512 SIMD enabled")
endif()
elseif(ARCHITECTURE_ARM)
- if(C_MSVC)
- try_run(RUN_NEON COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS /O0)
- else()
- if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_SYSTEM_PROCESSOR})
- try_run(RUN_NEON COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS -mfpu=neon -O0)
- else()
- try_compile(COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS -mfpu=neon -O0)
- set(RUN_NEON 0)
- endif()
- endif()
- if(COMPILE_NEON AND RUN_NEON EQUAL 0)
- set(HAS_NEON ON CACHE BOOL "Architecture has NEON SIMD enabled")
- message(STATUS "Use NEON SIMD instructions")
- if(C_GCC OR C_CLANG)
- set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon" )
- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon" )
- add_definitions(-DUSE_NEON)
- endif()
- else()
- set(HAS_NEON OFF CACHE BOOL "Architecture does not have NEON SIMD enabled")
- endif()
+ set(HAS_NEON OFF CACHE BOOL "Architecture does not have NEON SIMD enabled")
elseif(ARCHITECTURE_ARM64)
# Advanced SIMD (aka NEON) is mandatory for AArch64
set(HAS_NEON ON CACHE BOOL "Architecture has NEON SIMD enabled")

View File

@ -1,7 +1,7 @@
# Template file for 'direwolf'
pkgname=direwolf
version=1.7
revision=2
revision=3
build_style=cmake
makedepends="alsa-lib-devel hamlib-devel eudev-libudev-devel"
short_desc="AX.25 packet modem/TNC and APRS encoder/decoder"
@ -16,14 +16,3 @@ python_version=3
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*) configure_args+=" -DFORCE_SSE=ON" ;;
esac
post_patch() {
# rpi armv6 doesn't support neon, impossible to disable properly on cross
case "$XBPS_TARGET_MACHINE" in
armv6*)
vsed -i cmake/modules/FindCPUflags.cmake \
-e 's/HAS_NEON ON/HAS_NEON OFF/g' \
-e '/STATUS "Use NEON/d'
;;
esac
}