summaryrefslogtreecommitdiff
path: root/repo/python/arm-alignment.patch
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-12-11 18:08:51 +0000
committerdavidovski <david@davidovski.xyz>2022-12-11 18:08:51 +0000
commit4c61af227b0fb3e028c877dc1c2e0b6513960762 (patch)
tree7c6bf0a36805ab40911d4af9f81d8a839fa4972b /repo/python/arm-alignment.patch
parent63add57ef96f10f464fc1bf7c821d2281b39edeb (diff)
Updated linux
Diffstat (limited to 'repo/python/arm-alignment.patch')
-rw-r--r--repo/python/arm-alignment.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/repo/python/arm-alignment.patch b/repo/python/arm-alignment.patch
new file mode 100644
index 0000000..a7a4b39
--- /dev/null
+++ b/repo/python/arm-alignment.patch
@@ -0,0 +1,17 @@
+Author: Dave Jones <dave.jones@canonical.com>
+Description: Use aligned access for _sha3 module on ARM.
+--- 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
++#endif
++
+ /* mangle names */
+ #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb
+ #define Keccak_HashFinal _PySHA3_Keccak_HashFinal