From: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [RFC][PATCH] python: ensure usage of host modules while cross compiling
Date: Mon, 25 Jan 2016 08:49:53 -0600 [thread overview]
Message-ID: <56A63611.8050505@linux.intel.com> (raw)
In-Reply-To: <2021B186DC632746BD5A3CE32F12BD280119A934F7@EU-MBX-02.mgc.mentorg.com>
Ping
This has been here for a while now, if it doesnt apply let me know and I
will rebase this, this fixes bug 8671.
On 11/02/2015 02:08 AM, Belal, Awais wrote:
> Ping!
>
> BR,
> Awais
>
> ________________________________________
> From: openembedded-core-bounces@lists.openembedded.org [openembedded-core-bounces@lists.openembedded.org] on behalf of Belal, Awais
> Sent: Friday, October 30, 2015 6:08 PM
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [RFC][PATCH] python: ensure usage of host modules while cross compiling
>
> The issue is generally seen on x86 type of machines passing
> -march=bdverX (X=3,4 etc) flags but in general this should
> cause a problem when freshly built target modules are tried
> for an import during the cross build process.
> Aiding the PYTHONPATH with CROSSPYTHONPATH which contains
> the native modules resolves the issue.
>
> Signed-off-by: Awais Belal <awais_belal@mentor.com>
> ---
> ...e-of-native-modules-while-cross-compiling.patch | 31 ++++++++++++++++++++++
> meta/recipes-devtools/python/python_2.7.9.bb | 1 +
> 2 files changed, 32 insertions(+)
> create mode 100644 meta/recipes-devtools/python/python/0001-ensure-usage-of-native-modules-while-cross-compiling.patch
>
> diff --git a/meta/recipes-devtools/python/python/0001-ensure-usage-of-native-modules-while-cross-compiling.patch b/meta/recipes-devtools/python/python/0001-ensure-usage-of-native-modules-while-cross-compiling.patch
> new file mode 100644
> index 0000000..1e87e89
> --- /dev/null
> +++ b/meta/recipes-devtools/python/python/0001-ensure-usage-of-native-modules-while-cross-compiling.patch
> @@ -0,0 +1,31 @@
> +From 4eb30173f2d254f19d5ef18fabed3bdb2e5c1182 Mon Sep 17 00:00:00 2001
> +From: Awais Belal <awais_belal@mentor.com>
> +Date: Fri, 30 Oct 2015 17:47:07 +0500
> +Subject: [PATCH] ensure usage of native modules while cross compiling
> +
> +The PYTHONPATH variable augments the default search path and
> +is prepended to it. We need to make sure that host modules
> +are used while cross compiling otherwise an illegal instruction
> +error is generated if the modules built for target are imported.
> +
> +Signed-off-by: Awais Belal <awais_belal@mentor.com>
> +---
> + configure.ac | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 87a4f02..fa9e0dd 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -33,7 +33,7 @@ if test "$cross_compiling" = yes; then
> + AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
> + fi
> + AC_MSG_RESULT($interp)
> +- 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
> ++ 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
> + fi
> + elif test "$cross_compiling" = maybe; then
> + AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-devtools/python/python_2.7.9.bb b/meta/recipes-devtools/python/python_2.7.9.bb
> index f7e2f27..9a43cf7 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 += "\
> file://parallel-makeinst-create-bindir.patch \
> file://use_sysroot_ncurses_instead_of_host.patch \
> file://avoid_parallel_make_races_on_pgen.patch \
> + file://0001-ensure-usage-of-native-modules-while-cross-compiling.patch \
> "
>
> S = "${WORKDIR}/Python-${PV}"
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
next prev parent reply other threads:[~2016-01-25 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 13:08 [RFC][PATCH] python: ensure usage of host modules while cross compiling Awais Belal
2015-11-02 8:08 ` Belal, Awais
2016-01-25 14:49 ` Alejandro Hernandez [this message]
2016-01-25 15:19 ` Richard Purdie
2016-01-25 16:10 ` Alejandro Hernandez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A63611.8050505@linux.intel.com \
--to=alejandro.hernandez@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox