summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-07-30 23:59:06 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-13 10:55:38 +0100
commit094c364e4e66a77f8c967062fc6892beff39c92a (patch)
treee890da959504ec417f1ff1cdf5ac4c7eb028fa56
parent33bf56871406e3019ea363b248f6ee8aafe635cf (diff)
downloadpoky-094c364e4e66a77f8c967062fc6892beff39c92a.tar.gz
python2: Fix build with gcc8
(From OE-Core rev: 910f68c9c8dc26e12d28ef29e956af63d100f121) (From OE-Core rev: 04c2d53ef48a09747d0577d9ec1ffa548d247615) (From OE-Core rev: 9a3772e9411864301ca2799b4d5827476a6b7fcf) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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}"