Disable hardware acceleration support on armel
authorYOKOTA Hiroshi <yokota.hgml@gmail.com>
Tue, 14 Sep 2021 14:51:04 +0000 (23:51 +0900)
committerCesare Falco <c.falco@ubuntu.com>
Thu, 26 Sep 2024 09:44:48 +0000 (11:44 +0200)
Forwarded: https://sourceforge.net/p/sevenzip/patches/369/

Use "__ARM_ARCH" to split "armel" and "armhf".

ARM v7 feature breaks ARM v5 compiler because the feature is not supported
by ARM v5 compiler.

__ARM_ARCH:
  armel = 5
  armhf = 7

Gbp-Pq: Name 0003-Disable-hardware-acceleration-support-on-armel.patch

3rdparty/lzma/C/Aes.c
3rdparty/lzma/C/AesOpt.c
3rdparty/lzma/C/Sha256.c
3rdparty/lzma/C/Sha256Opt.c
3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp

index bcaafab1188f6268576e8d66ac5a77aeb2fa3ccd..851cc1a9badebbcca110e82da7d3d51f841799d0 100644 (file)
@@ -56,6 +56,7 @@ static Byte InvS[256];
 #ifdef MY_CPU_X86_OR_AMD64
   #define USE_HW_AES
 #elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
+ #if (__ARM_ARCH >= 7)
   #if defined(__clang__)
     #if (__clang_major__ >= 8) // fix that check
       #define USE_HW_AES
@@ -69,6 +70,7 @@ static Byte InvS[256];
       #define USE_HW_AES
     #endif
   #endif
+ #endif
 #endif
 
 #ifdef USE_HW_AES
index cfa6413f4b83470fb96ee171ef4ead66e851474b..a9d3218747ed01603606f594d0f6b5d363c795b5 100644 (file)
@@ -556,6 +556,7 @@ VAES_COMPAT_STUB (AesCtr_Code_HW)
 
 #elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
 
+ #if (__ARM_ARCH >= 7)
   #if defined(__clang__)
     #if (__clang_major__ >= 8) // fix that check
       #define USE_HW_AES
@@ -569,6 +570,7 @@ VAES_COMPAT_STUB (AesCtr_Code_HW)
       #define USE_HW_AES
     #endif
   #endif
+ #endif
 
 #ifdef USE_HW_AES
 
index 018cf6f4b4b7f258a05a68975c34f83cd35a4c67..650e4392d245241c6a98d43b439dc7583a4e3e5d 100644 (file)
@@ -33,6 +33,7 @@ This code is based on public domain code from Wei Dai's Crypto++ library. */
     #endif
   #endif
 #elif defined(MY_CPU_ARM_OR_ARM64)
+ #if (__ARM_ARCH >= 7)
   #ifdef _MSC_VER
     #if _MSC_VER >= 1910
       #define Z7_COMPILER_SHA256_SUPPORTED
@@ -46,6 +47,7 @@ This code is based on public domain code from Wei Dai's Crypto++ library. */
       #define Z7_COMPILER_SHA256_SUPPORTED
     #endif
   #endif
+ #endif
 #endif
 
 void Z7_FASTCALL Sha256_UpdateBlocks(UInt32 state[8], const Byte *data, size_t numBlocks);
index e4465e3e7d73b207772ee9c4997d2e1ebd7c8381..314b0c2a683c20dca024f0dec9ba0eb2622e109b 100644 (file)
@@ -204,6 +204,7 @@ void Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_
 
 #elif defined(MY_CPU_ARM_OR_ARM64)
 
+ #if (__ARM_ARCH >= 7)
   #if defined(__clang__)
     #if (__clang_major__ >= 8) // fix that check
       #define USE_HW_SHA
@@ -217,6 +218,7 @@ void Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_
       #define USE_HW_SHA
     #endif
   #endif
+ #endif
 
 #ifdef USE_HW_SHA
 
index 6abc38812b356d6ed022ad23fdada2aff9c98615..45807f3a840f24b4624d3f112bd717b5e71434bd 100644 (file)
@@ -155,6 +155,7 @@ Z7_COM7F_IMF2(UInt32, CAesCtrCoder::Filter(Byte *data, UInt32 size))
 #ifdef MY_CPU_X86_OR_AMD64
   #define USE_HW_AES
 #elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
+ #if (__ARM_ARCH >= 7)
   #if defined(__clang__)
     #if (__clang_major__ >= 8) // fix that check
       #define USE_HW_AES
@@ -168,6 +169,7 @@ Z7_COM7F_IMF2(UInt32, CAesCtrCoder::Filter(Byte *data, UInt32 size))
       #define USE_HW_AES
     #endif
   #endif
+ #endif
 #endif
 
 #ifdef USE_HW_AES