unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 065c1a7bb2e8165d6ecf7840d273a5b2bd10d906 718 bytes (raw)
name: packages/patches/python-3-arm-alignment.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 
Ensure memory accesses in the sha3 module are aligned on ARM as it causes
problems when running 32-bit code on a 64-bit kernel.

Patch taken from upstream bug report:
https://bugs.python.org/issue36515

--- 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

debug log:

solving 065c1a7bb2e8165d6ecf7840d273a5b2bd10d906 ...
found 065c1a7bb2e8165d6ecf7840d273a5b2bd10d906 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).