summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2015-11-27 18:22:51 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-12 23:42:52 +0000
commita1fa8d9ac53625737aab29b4e5e1687fc01bdfc2 (patch)
treeea0ace10583d90e824412ce8660cecd247d819dd /meta/recipes-devtools/python
parentc9fdc1baaba49c63db8d4695f670889fe79b3946 (diff)
downloadpoky-a1fa8d9ac53625737aab29b4e5e1687fc01bdfc2.tar.gz
python: Fix cross compiling issue
If the target and host have the same type, the system may try to execute the instructions from the target version. This can lead to illegal instructions as well as the wrong copy of the code running. Add CROSSPYTHONPATH for PYTHON_FOR_BUILD and export the correct path to fix it. (From OE-Core rev: 1cda7afd4173100e4185ee8759f6b2770bc93b72) Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch31
-rw-r--r--meta/recipes-devtools/python/python_2.7.9.bb1
2 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 0000000000..5ba54806eb
--- /dev/null
+++ b/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,31 @@
1configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
2
3When building x86->x86 the system will try to execute .so and related items
4from the default PYTHONPATH. This will fail if the target CPU contains
5instructions that the host CPU does not have, add CROSSPYTHONPATH
6into PYTHONPATH so we can prepend the list to find correct libs.
7
8Upstream-Status: Inappropriate [OE-Core integration specific]
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 configure.ac | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/configure.ac b/configure.ac
17index 87a4f02..f20cc7b 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -33,7 +33,7 @@ if test "$cross_compiling" = yes; then
21 AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
22 fi
23 AC_MSG_RESULT($interp)
24- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
25+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
26 fi
27 elif test "$cross_compiling" = maybe; then
28 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
29--
302.5.0
31
diff --git a/meta/recipes-devtools/python/python_2.7.9.bb b/meta/recipes-devtools/python/python_2.7.9.bb
index bc20417674..f585a53d58 100644
--- a/meta/recipes-devtools/python/python_2.7.9.bb
+++ b/meta/recipes-devtools/python/python_2.7.9.bb
@@ -26,6 +26,7 @@ SRC_URI += "\
26 file://parallel-makeinst-create-bindir.patch \ 26 file://parallel-makeinst-create-bindir.patch \
27 file://use_sysroot_ncurses_instead_of_host.patch \ 27 file://use_sysroot_ncurses_instead_of_host.patch \
28 file://avoid_parallel_make_races_on_pgen.patch \ 28 file://avoid_parallel_make_races_on_pgen.patch \
29 file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
29" 30"
30 31
31S = "${WORKDIR}/Python-${PV}" 32S = "${WORKDIR}/Python-${PV}"