summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python_2.7.2.bb
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@intel.com>2011-11-04 20:25:03 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-08 21:48:30 +0000
commit23d2eaf9d283cae47e52d1151f0d4ad53bbbe8a0 (patch)
tree9428dcd0703464278043db3a76ce27ebced8c90a /meta/recipes-devtools/python/python_2.7.2.bb
parenta021dae5b74158b422b0c5eafa7e526bb2f4b3de (diff)
downloadpoky-23d2eaf9d283cae47e52d1151f0d4ad53bbbe8a0.tar.gz
python: skip setup.py 'import check' when cross-compiling
build_extension() in setup.py, as part of the build process, does an 'import check' on the built extension. The import check in turn dlopen()'s the shared library associated with the extension, which isn't something that makes sense if that library was cross-compiled for a different architecture. This was noticed with an x86_64 target that was compiled with avx support, because it caused 'illegal instruction' exceptions: | /bin/sh: line 1: 14575 Illegal instruction ... -E ./setup.py -q build For other target architectures, it doesn't necessarily cause illegal instruction exceptions, but still fails. For example, on arm, the failure pathway causes this warning: *** WARNING: renaming "cmath" since importing it failed: .../cmath.so: wrong ELF class: ELFCLASS32 This patch to setup.py and the associated recipe changes allow the whole 'import check' logic to be skipped when cross-compiling. (From OE-Core rev: 25fae81538a92e15eab3fc169ebce44505f67839) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.2.bb')
-rw-r--r--meta/recipes-devtools/python/python_2.7.2.bb5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb
index bb088a4620..360e64e9a6 100644
--- a/meta/recipes-devtools/python/python_2.7.2.bb
+++ b/meta/recipes-devtools/python/python_2.7.2.bb
@@ -18,6 +18,7 @@ SRC_URI += "\
18 file://multilib.patch \ 18 file://multilib.patch \
19 file://cgi_py.patch \ 19 file://cgi_py.patch \
20 file://remove_sqlite_rpath.patch \ 20 file://remove_sqlite_rpath.patch \
21 file://setup_py_skip_cross_import_check.patch \
21" 22"
22 23
23S = "${WORKDIR}/Python-${PV}" 24S = "${WORKDIR}/Python-${PV}"
@@ -57,6 +58,8 @@ do_compile() {
57 # then call do_install twice we get Makefile.orig == Makefile.sysroot 58 # then call do_install twice we get Makefile.orig == Makefile.sysroot
58 install -m 0644 Makefile Makefile.sysroot 59 install -m 0644 Makefile Makefile.sysroot
59 60
61 export CROSS_COMPILE="${TARGET_PREFIX}"
62
60 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ 63 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
61 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ 64 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
62 STAGING_LIBDIR=${STAGING_LIBDIR} \ 65 STAGING_LIBDIR=${STAGING_LIBDIR} \
@@ -78,6 +81,8 @@ do_install() {
78 # make install needs the original Makefile, or otherwise the inclues would 81 # make install needs the original Makefile, or otherwise the inclues would
79 # go to ${D}${STAGING...}/... 82 # go to ${D}${STAGING...}/...
80 install -m 0644 Makefile.orig Makefile 83 install -m 0644 Makefile.orig Makefile
84
85 export CROSS_COMPILE="${TARGET_PREFIX}"
81 86
82 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ 87 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
83 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ 88 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \