projects/guix·blob javascript-team · refs

21 lines · 718 B

1Ensure memory accesses in the sha3 module are aligned on ARM as it causes
2problems when running 32-bit code on a 64-bit kernel.
3
4Patch taken from upstream bug report:
5https://bugs.python.org/issue36515
6
7--- a/Modules/_sha3/sha3module.c
8+++ b/Modules/_sha3/sha3module.c
9@@ -64,6 +64,12 @@
10 #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
11 #endif
12
13+/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM
14+ * doesn't complain but un-aligned memory accesses are sub-optimal */
15+#if defined(__arm__) || defined(__aarch64__)
16+#define NO_MISALIGNED_ACCESSES
17+#endif
18+
19 /* mangle names */
20 #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb
21 #define Keccak_HashFinal _PySHA3_Keccak_HashFinal