Disable hardware acceleration support on armel
authorYOKOTA Hiroshi <yokota.hgml@gmail.com>
Tue, 14 Sep 2021 14:51:04 +0000 (23:51 +0900)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 22 Feb 2024 05:43:15 +0000 (05:43 +0000)
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 27e32e6229432fdc2018a9b5647f17e496aa5b8f..30e0e6201770a5fe7729693d74e55b97c3f277b7 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 8be8ff69d1e7ffbc48c48da8fd1705706357a7ef..68ec7d2163d8ac4b5be8375899749d0b761c4eae 100644 (file)
@@ -508,6 +508,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
@@ -521,6 +522,7 @@ VAES_COMPAT_STUB (AesCtr_Code_HW)
       #define USE_HW_AES
     #endif
   #endif
+ #endif
 
 #ifdef USE_HW_AES
 
index 8b3983ea7323d3395f7289529aed03f29e039cfa..372217f98eff4692a76f167db7f33a1f6fb56015 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 _SHA_SUPPORTED
@@ -46,6 +47,7 @@ This code is based on public domain code from Wei Dai's Crypto++ library. */
       #define _SHA_SUPPORTED
     #endif
   #endif
+ #endif
 #endif
 
 void MY_FAST_CALL Sha256_UpdateBlocks(UInt32 state[8], const Byte *data, size_t numBlocks);
index decc1382cd6ee9c7cb6e6ac27e3ee6e2cdb46b88..66d778d634d09c9d97559670fbdb407d3dfad330 100644 (file)
@@ -214,6 +214,7 @@ void MY_FAST_CALL 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
@@ -227,6 +228,7 @@ void MY_FAST_CALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size
       #define USE_HW_SHA
     #endif
   #endif
+ #endif
 
 #ifdef USE_HW_SHA
 
index 5cb7f46359b93bbdaa3e0479a7ea2d652ba1abee..7909226cc7da81b61fc5df05de2aa60f02017897 100644 (file)
@@ -86,6 +86,7 @@ STDMETHODIMP CAesCoder::SetInitVector(const 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
@@ -99,6 +100,7 @@ STDMETHODIMP CAesCoder::SetInitVector(const Byte *data, UInt32 size)
       #define USE_HW_AES
     #endif
   #endif
+ #endif
 #endif
 
 #endif