From 8217ebe0b7d4851336d146361bdfb7db134dafa4 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 27e32e622..30e0e6201 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 8be8ff69d..68ec7d216 100644 --- a/3rdparty/lzma/C/AesOpt.c +++ b/3rdparty/lzma/C/AesOpt.c @@ -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 diff --git a/3rdparty/lzma/C/Sha256.c b/3rdparty/lzma/C/Sha256.c index 8b3983ea7..372217f98 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 _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); diff --git a/3rdparty/lzma/C/Sha256Opt.c b/3rdparty/lzma/C/Sha256Opt.c index decc1382c..66d778d63 100644 --- a/3rdparty/lzma/C/Sha256Opt.c +++ b/3rdparty/lzma/C/Sha256Opt.c @@ -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 diff --git a/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp b/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp index 5cb7f4635..7909226cc 100644 --- a/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp +++ b/3rdparty/lzma/CPP/7zip/Crypto/MyAes.cpp @@ -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 -- 2.30.2