diff options
| -rw-r--r-- | meta/recipes-devtools/python/python-native_2.7.14.bb | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python/fix-gc-alignment.patch | 43 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python_2.7.14.bb | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-native_2.7.14.bb b/meta/recipes-devtools/python/python-native_2.7.14.bb index 7c491fa3e0..b822583c53 100644 --- a/meta/recipes-devtools/python/python-native_2.7.14.bb +++ b/meta/recipes-devtools/python/python-native_2.7.14.bb | |||
| @@ -16,6 +16,7 @@ SRC_URI += "\ | |||
| 16 | file://builddir.patch \ | 16 | file://builddir.patch \ |
| 17 | file://parallel-makeinst-create-bindir.patch \ | 17 | file://parallel-makeinst-create-bindir.patch \ |
| 18 | file://revert_use_of_sysconfigdata.patch \ | 18 | file://revert_use_of_sysconfigdata.patch \ |
| 19 | file://fix-gc-alignment.patch \ | ||
| 19 | " | 20 | " |
| 20 | 21 | ||
| 21 | S = "${WORKDIR}/Python-${PV}" | 22 | S = "${WORKDIR}/Python-${PV}" |
diff --git a/meta/recipes-devtools/python/python/fix-gc-alignment.patch b/meta/recipes-devtools/python/python/fix-gc-alignment.patch new file mode 100644 index 0000000000..b63cd08747 --- /dev/null +++ b/meta/recipes-devtools/python/python/fix-gc-alignment.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | Upstream-Status: Submitted | ||
| 2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
| 3 | |||
| 4 | Fix for over-aligned GC info | ||
| 5 | Patch by Florian Weimer | ||
| 6 | |||
| 7 | See: https://bugzilla.redhat.com/show_bug.cgi?id=1540316 | ||
| 8 | Upstream discussion: https://mail.python.org/pipermail/python-dev/2018-January/152000.html | ||
| 9 | |||
| 10 | diff --git a/Include/objimpl.h b/Include/objimpl.h | ||
| 11 | index 55e83eced6..aa906144dc 100644 | ||
| 12 | --- a/Include/objimpl.h | ||
| 13 | +++ b/Include/objimpl.h | ||
| 14 | @@ -248,6 +248,18 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); | ||
| 15 | /* for source compatibility with 2.2 */ | ||
| 16 | #define _PyObject_GC_Del PyObject_GC_Del | ||
| 17 | |||
| 18 | +/* Former over-aligned definition of PyGC_Head, used to compute the | ||
| 19 | + size of the padding for the new version below. */ | ||
| 20 | +union _gc_head; | ||
| 21 | +union _gc_head_old { | ||
| 22 | + struct { | ||
| 23 | + union _gc_head *gc_next; | ||
| 24 | + union _gc_head *gc_prev; | ||
| 25 | + Py_ssize_t gc_refs; | ||
| 26 | + } gc; | ||
| 27 | + long double dummy; | ||
| 28 | +}; | ||
| 29 | + | ||
| 30 | /* GC information is stored BEFORE the object structure. */ | ||
| 31 | typedef union _gc_head { | ||
| 32 | struct { | ||
| 33 | @@ -255,7 +267,8 @@ typedef union _gc_head { | ||
| 34 | union _gc_head *gc_prev; | ||
| 35 | Py_ssize_t gc_refs; | ||
| 36 | } gc; | ||
| 37 | - long double dummy; /* force worst-case alignment */ | ||
| 38 | + double dummy; /* force worst-case alignment */ | ||
| 39 | + char dummy_padding[sizeof(union _gc_head_old)]; | ||
| 40 | } PyGC_Head; | ||
| 41 | |||
| 42 | extern PyGC_Head *_PyGC_generation0; | ||
| 43 | \ No newline at end of file | ||
diff --git a/meta/recipes-devtools/python/python_2.7.14.bb b/meta/recipes-devtools/python/python_2.7.14.bb index 0a09926dfb..41a8609b15 100644 --- a/meta/recipes-devtools/python/python_2.7.14.bb +++ b/meta/recipes-devtools/python/python_2.7.14.bb | |||
| @@ -30,6 +30,7 @@ SRC_URI += "\ | |||
| 30 | file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ | 30 | file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ |
| 31 | file://pass-missing-libraries-to-Extension-for-mul.patch \ | 31 | file://pass-missing-libraries-to-Extension-for-mul.patch \ |
| 32 | file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \ | 32 | file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \ |
| 33 | file://fix-gc-alignment.patch \ | ||
| 33 | " | 34 | " |
| 34 | 35 | ||
| 35 | S = "${WORKDIR}/Python-${PV}" | 36 | S = "${WORKDIR}/Python-${PV}" |
