summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.14.bb1
-rw-r--r--meta/recipes-devtools/python/python/fix-gc-alignment.patch43
-rw-r--r--meta/recipes-devtools/python/python_2.7.14.bb1
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 ca15a6a8d9..5373ce6690 100644
--- a/meta/recipes-devtools/python/python-native_2.7.14.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.14.bb
@@ -17,6 +17,7 @@ SRC_URI += "\
17 file://builddir.patch \ 17 file://builddir.patch \
18 file://parallel-makeinst-create-bindir.patch \ 18 file://parallel-makeinst-create-bindir.patch \
19 file://revert_use_of_sysconfigdata.patch \ 19 file://revert_use_of_sysconfigdata.patch \
20 file://fix-gc-alignment.patch \
20 " 21 "
21 22
22S = "${WORKDIR}/Python-${PV}" 23S = "${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 @@
1Upstream-Status: Submitted
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4Fix for over-aligned GC info
5Patch by Florian Weimer
6
7See: https://bugzilla.redhat.com/show_bug.cgi?id=1540316
8Upstream discussion: https://mail.python.org/pipermail/python-dev/2018-January/152000.html
9
10diff --git a/Include/objimpl.h b/Include/objimpl.h
11index 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 e814ff74f7..35b6324970 100644
--- a/meta/recipes-devtools/python/python_2.7.14.bb
+++ b/meta/recipes-devtools/python/python_2.7.14.bb
@@ -28,6 +28,7 @@ SRC_URI += "\
28 file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ 28 file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
29 file://pass-missing-libraries-to-Extension-for-mul.patch \ 29 file://pass-missing-libraries-to-Extension-for-mul.patch \
30 file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \ 30 file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \
31 file://fix-gc-alignment.patch \
31" 32"
32 33
33S = "${WORKDIR}/Python-${PV}" 34S = "${WORKDIR}/Python-${PV}"