summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/fix-gc-alignment.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python/fix-gc-alignment.patch')
-rw-r--r--meta/recipes-devtools/python/python/fix-gc-alignment.patch43
1 files changed, 43 insertions, 0 deletions
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