From: Dave Jones Date: Sun, 1 Dec 2024 12:12:57 +0000 (+0200) Subject: Use aligned access for _sha3 module on ARM. X-Git-Tag: archive/raspbian/3.9.2-1+rpi1+deb11u2^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a71c531d3282e6de8db4dc732e3380d7cfd3c0ab;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 c826b42..392ae53 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -64,6 +64,12 @@ #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN #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