From 6db9b731abf351ac9047d79c6763eeee60686712 Mon Sep 17 00:00:00 2001 From: YOKOTA Hiroshi Date: Tue, 14 Sep 2021 23:51:04 +0900 Subject: [PATCH] Disable hardware acceleration support on armel 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 | 2 ++ 3rdparty/lzma/C/AesOpt.c | 2 ++ 3rdparty/lzma/C/Sha256.c | 2 ++ 3rdparty/lzma/C/Sha256Opt.c | 2 ++ 3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp | 2 ++ 5 files changed, 10 insertions(+) diff --git a/3rdparty/lzma/C/Aes.c b/3rdparty/lzma/C/Aes.c index bcaafab11..851cc1a9b 100644 --- a/3rdparty/lzma/C/Aes.c +++ b/3rdparty/lzma/C/Aes.c @@ -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 diff --git a/3rdparty/lzma/C/AesOpt.c b/3rdparty/lzma/C/AesOpt.c index cfa6413f4..a9d321874 100644 --- a/3rdparty/lzma/C/AesOpt.c +++ b/3rdparty/lzma/C/AesOpt.c @@ -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 diff --git a/3rdparty/lzma/C/Sha256.c b/3rdparty/lzma/C/Sha256.c index 018cf6f4b..650e4392d 100644 --- a/3rdparty/lzma/C/Sha256.c +++ b/3rdparty/lzma/C/Sha256.c @@ -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); diff --git a/3rdparty/lzma/C/Sha256Opt.c b/3rdparty/lzma/C/Sha256Opt.c index e4465e3e7..314b0c2a6 100644 --- a/3rdparty/lzma/C/Sha256Opt.c +++ b/3rdparty/lzma/C/Sha256Opt.c @@ -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 diff --git a/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp b/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp index 6abc38812..45807f3a8 100644 --- a/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp +++ b/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp @@ -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 -- 2.30.2