aboutsummaryrefslogtreecommitdiffstats
path: root/main/python3/arm-alignment.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-04-29 08:07:54 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2020-04-29 08:11:41 +0000
commitafca9c479889abe4fd85c50b799ae410c11e9cf8 (patch)
tree8edbf375e08e8c8b2367ca75dca2ce8ad78cde9e /main/python3/arm-alignment.patch
parent8a8ed4afc121014d2907abd53033c8de7a974ce7 (diff)
main/python3: fix alignment on 32bit arm
Diffstat (limited to 'main/python3/arm-alignment.patch')
-rw-r--r--main/python3/arm-alignment.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/main/python3/arm-alignment.patch b/main/python3/arm-alignment.patch
new file mode 100644
index 00000000000..a7a4b394d9d
--- /dev/null
+++ b/main/python3/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