summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian-armel-armhf-buildflags.patch
blob: e9a450aa585f1c0326592b49d1a87beb2b24074b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- a/cmake/modules/SIMDExt.cmake
+++ b/cmake/modules/SIMDExt.cmake
@@ -40,11 +40,14 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch
 
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm|ARM")
   set(HAVE_ARM 1)
-  CHECK_C_COMPILER_FLAG(-mfpu=neon HAVE_ARM_NEON)
-  if(HAVE_ARM_NEON)
-    set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -mfpu=neon")
+  if(CMAKE_LIBRARY_ARCHITECTURE EQUAL "arm-linux-gnueabi")
+    set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} --with-arch=armv5te --with-float=soft")
+  else()
+    CHECK_C_COMPILER_FLAG(-mfpu=neon HAVE_ARM_NEON)
+    if(HAVE_ARM_NEON)
+      set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -mfpu=neon")
+    endif()
   endif()
-
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|amd64|x86_64|AMD64")
   set(HAVE_INTEL 1)
   if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686|amd64|x86_64|AMD64")
--- a/src/erasure-code/jerasure/gf-complete/m4/ax_ext.m4
+++ b/src/erasure-code/jerasure/gf-complete/m4/ax_ext.m4
@@ -19,10 +19,17 @@ AC_DEFUN([AX_EXT],
       ;;
 
     arm*)
-      AC_CACHE_CHECK([whether NEON is enabled], [ax_cv_have_neon_ext], [ax_cv_have_neon_ext=yes])
-      if test "$ax_cv_have_neon_ext" = yes; then
-        AX_CHECK_COMPILE_FLAG(-mfpu=neon, [SIMD_FLAGS="$SIMD_FLAGS -mfpu=neon -DARM_NEON"], [ax_cv_have_neon_ext=no])
-      fi
+      case $host_cpu in
+          arm-linux-gnueabi)
+            AX_CHECK_COMPILE_FLAG(-mfpu=soft, [SIMD_FLAGS="$SIMD_FLAGS -mfpu=soft -march=armv5te"], [ax_cv_have_neon_ext=no])
+          ;;
+          *)
+            AC_CACHE_CHECK([whether NEON is enabled], [ax_cv_have_neon_ext], [ax_cv_have_neon_ext=yes])
+            if test "$ax_cv_have_neon_ext" = yes; then
+              AX_CHECK_COMPILE_FLAG(-mfpu=neon, [SIMD_FLAGS="$SIMD_FLAGS -mfpu=neon -DARM_NEON"], [ax_cv_have_neon_ext=no])
+            fi
+          ;;
+      esac
       ;;
 
     powerpc*)