summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--meta/recipes-devtools/python/python_2.7.2.bb5
2 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
new file mode 100644
index 0000000000..6ccdb948b9
--- /dev/null
+++ b/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
@@ -0,0 +1,27 @@
1This patch skips over the 'import check' setup.py does when building
2extensions. This generally won't work when cross-compiling.
3
4Upstream-Status: Inappropriate [embedded-specific]
5
6Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
7
8Index: Python-2.7.2/setup.py
9===================================================================
10--- Python-2.7.2.orig/setup.py 2011-11-04 16:46:34.553796410 -0500
11+++ Python-2.7.2/setup.py 2011-11-04 16:59:49.692802313 -0500
12@@ -287,6 +287,15 @@
13 (ext.name, sys.exc_info()[1]))
14 self.failed.append(ext.name)
15 return
16+
17+ # If we're cross-compiling, we want to skip the import check
18+ # i.e. we shouldn't be dynamically loading target shared libs
19+ if os.environ.get('CROSS_COMPILE') is not None:
20+ self.announce(
21+ 'WARNING: skipping import check for cross-compiled "%s"' %
22+ ext.name)
23+ return
24+
25 # Workaround for Mac OS X: The Carbon-based modules cannot be
26 # reliably imported into a command-line Python
27 if 'Carbon' in ext.extra_link_args:
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 \