Skip to content

Instantly share code, notes, and snippets.

@sgur
Last active February 24, 2022 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgur/a361686f5bdf4af660ddc872fc6a0021 to your computer and use it in GitHub Desktop.
Save sgur/a361686f5bdf4af660ddc872fc6a0021 to your computer and use it in GitHub Desktop.
Patch to python 3.6.15
diff -u Include/objimpl.h patch/Include/objimpl.h
--- Include/objimpl.h 2021-12-24 11:39:58.030881300 +0900
+++ patch/Include/objimpl.h 2021-12-24 11:40:27.780881300 +0900
@@ -255,7 +255,7 @@
union _gc_head *gc_prev;
Py_ssize_t gc_refs;
} gc;
- double dummy; /* force worst-case alignment */
+ long double dummy; /* force worst-case alignment */
} PyGC_Head;
extern PyGC_Head *_PyGC_generation0;
diff -u Objects/obmalloc.c patch/Objects/obmalloc.c
--- Objects/obmalloc.c 2021-12-24 11:42:18.790881300 +0900
+++ patch/Objects/obmalloc.c 2021-12-24 11:42:28.270881300 +0900
@@ -650,8 +650,8 @@
*
* You shouldn't change this unless you know what you are doing.
*/
-#define ALIGNMENT 8 /* must be 2^N */
-#define ALIGNMENT_SHIFT 3
+#define ALIGNMENT 16 /* must be 2^N */
+#define ALIGNMENT_SHIFT 4
/* Return the number of bytes in size class I, as a uint. */
#define INDEX2SIZE(I) (((uint)(I) + 1) << ALIGNMENT_SHIFT)

asdf-python で python 3.6.15 をビルドするためのパッチ

https://github.com/danhper/asdf-python#install-with---patch

Python 3.6.x 系は asdf-python でインストール時にエラーが出た場合のパッチ

(bash)

export ASDF_PYTHON_PATCH_URL=https://gist.githubusercontent.com/sgur/a361686f5bdf4af660ddc872fc6a0021/raw/0bebf9b5dd637ac26d1660daa4bb7ed691b4da98/3.6.15.patch

(fish)

set -gx ASDF_PYTHON_PATCH_URL https://gist.githubusercontent.com/sgur/a361686f5bdf4af660ddc872fc6a0021/raw/0bebf9b5dd637ac26d1660daa4bb7ed691b4da98/3.6.15.patch
asdf install python 3.6.15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment