]> code.ossystems Code Review - openembedded-core.git/commit
python: skip setup.py 'import check' when cross-compiling
authorTom Zanussi <tom.zanussi@intel.com>
Sat, 5 Nov 2011 01:25:03 +0000 (20:25 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 30 Jan 2012 16:27:13 +0000 (16:27 +0000)
commitd83e4ac25cca788d2b102c2072ccb367c0cab284
tree81bd1be5aa42857e843c7c74262f2b96d8fb9e17
parent69f45c6e9f28aae2ba84aea87a6ed096800ed685
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>
meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch [new file with mode: 0644]
meta/recipes-devtools/python/python_2.6.6.bb