From: Dave Jones Date: Mon, 10 Jan 2022 10:55:59 +0000 (+0000) Subject: Use aligned access for _sha3 module on ARM. X-Git-Tag: archive/raspbian/3.9.9-3+rpi1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8b527b5d7002fb5418818e9722644cf87f02796d;p=python3.9.git Use aligned access for _sha3 module on ARM. Gbp-Pq: Name arm-alignment.diff --- diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index b6a7130..22f5bed 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -69,6 +69,12 @@ #define NO_MISALIGNED_ACCESSES #endif +/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM + * doesn't complain but un-aligned memory accesses are sub-optimal */ +#if defined(__arm__) || defined(__aarch64__) +#define NO_MISALIGNED_ACCESSES 1 +#endif + /* mangle names */ #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb #define Keccak_HashFinal _PySHA3_Keccak_HashFinal