Openembedded Core Discussions
 help / color / mirror / Atom feed
* [RFC][PATCH] python: ensure usage of host modules while cross compiling
@ 2015-10-30 13:08 Awais Belal
  2015-11-02  8:08 ` Belal, Awais
  0 siblings, 1 reply; 5+ messages in thread
From: Awais Belal @ 2015-10-30 13:08 UTC (permalink / raw)
  To: openembedded-core

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC][PATCH] python: ensure usage of host modules while cross compiling
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Belal, Awais @ 2015-11-02  8:08 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC][PATCH] python: ensure usage of host modules while cross compiling
  2015-11-02  8:08 ` Belal, Awais
@ 2016-01-25 14:49   ` Alejandro Hernandez
  2016-01-25 15:19     ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Hernandez @ 2016-01-25 14:49 UTC (permalink / raw)
  To: openembedded-core

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][PATCH] python: ensure usage of host modules while cross compiling
  2016-01-25 14:49   ` Alejandro Hernandez
@ 2016-01-25 15:19     ` Richard Purdie
  2016-01-25 16:10       ` Alejandro Hernandez
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2016-01-25 15:19 UTC (permalink / raw)
  To: Alejandro Hernandez, openembedded-core, Belal, Awais

On Mon, 2016-01-25 at 08:49 -0600, Alejandro Hernandez wrote:
> 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.

Wasn't this fixed by:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a1fa8d9ac53625737aab29b4e5e1687fc01bdfc2

?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][PATCH] python: ensure usage of host modules while cross compiling
  2016-01-25 15:19     ` Richard Purdie
@ 2016-01-25 16:10       ` Alejandro Hernandez
  0 siblings, 0 replies; 5+ messages in thread
From: Alejandro Hernandez @ 2016-01-25 16:10 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core, Belal, Awais

On 01/25/2016 09:19 AM, Richard Purdie wrote:
> On Mon, 2016-01-25 at 08:49 -0600, Alejandro Hernandez wrote:
>> 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.
> Wasn't this fixed by:
>
> http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a1fa8d9ac53625737aab29b4e5e1687fc01bdfc2
>
> ?
My bad, I hadn't seen this patch, thanks!

> Cheers,
>
> Richard
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-25 16:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-01-25 15:19     ` Richard Purdie
2016-01-25 16:10       ` Alejandro Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox