[2011.03-maintenance,3/3] python-2.6.6: Fix python-2.6.6 build failure on linux-3.x

Submitted by Steffen Sledz on March 27, 2012, 12:07 p.m.

Details

Message ID 71df8a759f91e821a2daee22f34eaa3a31708775.1332849864.git.sledz@dresearch-fe.de
State Accepted
Headers show

Commit Message

Steffen Sledz March 27, 2012, 12:07 p.m.
From: Ulf Samuelsson <ulf_samuelsson@telia.com>

python-2.6.6 build will crash when host is running linux kernel 3.x.

Fix backported from openembedded-core.
meta/recipes-devtools/python/python/07-linux3-regen-fix.patch

Signed-Off-By:	Ulf Samuelsson <ulf.samuelsson@telia.com>
---
 .../python/python-2.6.6/07-linux3-regen-fix.patch  |   18 ++++++++++++++++++
 recipes/python/python_2.6.6.bb                     |    3 ++-
 2 files changed, 20 insertions(+), 1 deletions(-)
 create mode 100644 recipes/python/python-2.6.6/07-linux3-regen-fix.patch

Patch hide | download patch | download mbox

diff --git a/recipes/python/python-2.6.6/07-linux3-regen-fix.patch b/recipes/python/python-2.6.6/07-linux3-regen-fix.patch
new file mode 100644
index 0000000..a059605
--- /dev/null
+++ b/recipes/python/python-2.6.6/07-linux3-regen-fix.patch
@@ -0,0 +1,18 @@ 
+Upstream-Status: Inappropriate [embedded specific]
+
+Without this patch it calls cross-compiled python if host is running linux-3.0
+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
+| ./regen: line 3: /OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/python-2.6.6-nk2.8/Python-2.6.6/python: cannot execute binary file
+
+diff -uNr Python-2.6.6.orig//Lib/plat-linux3/regen Python-2.6.6/Lib/plat-linux3/regen
+--- Python-2.6.6.orig//Lib/plat-linux3/regen 1970-01-01 01:00:00.000000000 +0100
++++ Python-2.6.6/Lib/plat-linux3/regen 2001-08-09 14:48:17.000000000 +0200
+@@ -0,0 +1,8 @@
++#! /bin/sh
++case `uname` in
++Linux*) ;;
++*) echo Probably not on a Linux system 1>&2
++ exit 1;;
++esac
++set -v
++h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
diff --git a/recipes/python/python_2.6.6.bb b/recipes/python/python_2.6.6.bb
index eacc5c2..5b47fec 100644
--- a/recipes/python/python_2.6.6.bb
+++ b/recipes/python/python_2.6.6.bb
@@ -3,7 +3,7 @@  DEPENDS = "python-native db gdbm openssl readline sqlite3 tcl zlib\
            ${@base_contains('DISTRO_FEATURES', 'tk', 'tk', '', d)}"
 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
 # set to .0 on every increase of INC_PR
-PR = "${INC_PR}.3"
+PR = "${INC_PR}.4"
 
 SRC_URI = "\
   http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
@@ -14,6 +14,7 @@  SRC_URI = "\
   file://04-default-is-optimized.patch \
   file://05-enable-ctypes-cross-build.patch \
   file://06-ctypes-libffi-fix-configure.patch \
+  file://07-linux3-regen-fix.patch \
   file://ipv6-cross.patch \
   file://python-module-rpath-fix.patch \
   file://sitecustomize.py \

Comments

Andreas Oberritter March 27, 2012, 12:44 p.m.
On 27.03.2012 14:07, Steffen Sledz wrote:
> From: Ulf Samuelsson <ulf_samuelsson@telia.com>
> 
> python-2.6.6 build will crash when host is running linux kernel 3.x.
> 
> Fix backported from openembedded-core.
> meta/recipes-devtools/python/python/07-linux3-regen-fix.patch

This patch has been superseded by a backport from upstream python,
causing linux2 to be used for all kernel versions. See commit
accb2b728ab10cae20be59253a56ac6410b8de10 in oe-core.

> Signed-Off-By:	Ulf Samuelsson <ulf.samuelsson@telia.com>
> ---
>  .../python/python-2.6.6/07-linux3-regen-fix.patch  |   18 ++++++++++++++++++
>  recipes/python/python_2.6.6.bb                     |    3 ++-
>  2 files changed, 20 insertions(+), 1 deletions(-)
>  create mode 100644 recipes/python/python-2.6.6/07-linux3-regen-fix.patch
> 
> diff --git a/recipes/python/python-2.6.6/07-linux3-regen-fix.patch b/recipes/python/python-2.6.6/07-linux3-regen-fix.patch
> new file mode 100644
> index 0000000..a059605
> --- /dev/null
> +++ b/recipes/python/python-2.6.6/07-linux3-regen-fix.patch
> @@ -0,0 +1,18 @@
> +Upstream-Status: Inappropriate [embedded specific]
> +
> +Without this patch it calls cross-compiled python if host is running linux-3.0
> +python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
> +| ./regen: line 3: /OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/python-2.6.6-nk2.8/Python-2.6.6/python: cannot execute binary file
> +
> +diff -uNr Python-2.6.6.orig//Lib/plat-linux3/regen Python-2.6.6/Lib/plat-linux3/regen
> +--- Python-2.6.6.orig//Lib/plat-linux3/regen 1970-01-01 01:00:00.000000000 +0100
> ++++ Python-2.6.6/Lib/plat-linux3/regen 2001-08-09 14:48:17.000000000 +0200
> +@@ -0,0 +1,8 @@
> ++#! /bin/sh
> ++case `uname` in
> ++Linux*) ;;
> ++*) echo Probably not on a Linux system 1>&2
> ++ exit 1;;
> ++esac
> ++set -v
> ++h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
> diff --git a/recipes/python/python_2.6.6.bb b/recipes/python/python_2.6.6.bb
> index eacc5c2..5b47fec 100644
> --- a/recipes/python/python_2.6.6.bb
> +++ b/recipes/python/python_2.6.6.bb
> @@ -3,7 +3,7 @@ DEPENDS = "python-native db gdbm openssl readline sqlite3 tcl zlib\
>             ${@base_contains('DISTRO_FEATURES', 'tk', 'tk', '', d)}"
>  DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
>  # set to .0 on every increase of INC_PR
> -PR = "${INC_PR}.3"
> +PR = "${INC_PR}.4"
>  
>  SRC_URI = "\
>    http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
> @@ -14,6 +14,7 @@ SRC_URI = "\
>    file://04-default-is-optimized.patch \
>    file://05-enable-ctypes-cross-build.patch \
>    file://06-ctypes-libffi-fix-configure.patch \
> +  file://07-linux3-regen-fix.patch \
>    file://ipv6-cross.patch \
>    file://python-module-rpath-fix.patch \
>    file://sitecustomize.py \
Steffen Sledz March 27, 2012, 12:51 p.m.
On 27.03.2012 14:44, Andreas Oberritter wrote:
> On 27.03.2012 14:07, Steffen Sledz wrote:
>> From: Ulf Samuelsson <ulf_samuelsson@telia.com>
>>
>> python-2.6.6 build will crash when host is running linux kernel 3.x.
>>
>> Fix backported from openembedded-core.
>> meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
> 
> This patch has been superseded by a backport from upstream python,
> causing linux2 to be used for all kernel versions. See commit
> accb2b728ab10cae20be59253a56ac6410b8de10 in oe-core.

Is this patch available in oe-classic master?

I'm just trying to keep the 2011.03-maintenance branch usable with a minimum of work. And the one from the pull request is good enough for me at the moment.

Steffen
Andreas Oberritter March 27, 2012, 12:59 p.m.
On 27.03.2012 14:51, Steffen Sledz wrote:
> On 27.03.2012 14:44, Andreas Oberritter wrote:
>> On 27.03.2012 14:07, Steffen Sledz wrote:
>>> From: Ulf Samuelsson <ulf_samuelsson@telia.com>
>>>
>>> python-2.6.6 build will crash when host is running linux kernel 3.x.
>>>
>>> Fix backported from openembedded-core.
>>> meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
>>
>> This patch has been superseded by a backport from upstream python,
>> causing linux2 to be used for all kernel versions. See commit
>> accb2b728ab10cae20be59253a56ac6410b8de10 in oe-core.
> 
> Is this patch available in oe-classic master?

I don't know.

> I'm just trying to keep the 2011.03-maintenance branch usable with a minimum of work. And the one from the pull request is good enough for me at the moment.

I don't want to block your pull request. I was just trying to make you
aware of problems that have already been fixed in oe-core. Building
python on 32-bit vs. 64-bit build systems and on 2.x vs. 3.x kernels
(running on the build system) produces different results, even with this
patch applied. Some of these problems have already been fixed in
oe-core, some are still pending (patches were sent to the oe-core
mailing list).

Regards,
Andreas
Steffen Sledz March 27, 2012, 1:06 p.m.
On 27.03.2012 14:59, Andreas Oberritter wrote:
> On 27.03.2012 14:51, Steffen Sledz wrote:
>> On 27.03.2012 14:44, Andreas Oberritter wrote:
>>> On 27.03.2012 14:07, Steffen Sledz wrote:
>>>> From: Ulf Samuelsson <ulf_samuelsson@telia.com>
>>>>
>>>> python-2.6.6 build will crash when host is running linux kernel 3.x.
>>>>
>>>> Fix backported from openembedded-core.
>>>> meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
>>>
>>> This patch has been superseded by a backport from upstream python,
>>> causing linux2 to be used for all kernel versions. See commit
>>> accb2b728ab10cae20be59253a56ac6410b8de10 in oe-core.
>>
>> Is this patch available in oe-classic master?
> 
> I don't know.
> 
>> I'm just trying to keep the 2011.03-maintenance branch usable with a minimum of work. And the one from the pull request is good enough for me at the moment.
> 
> I don't want to block your pull request. I was just trying to make you
> aware of problems that have already been fixed in oe-core. Building
> python on 32-bit vs. 64-bit build systems and on 2.x vs. 3.x kernels
> (running on the build system) produces different results, even with this
> patch applied. Some of these problems have already been fixed in
> oe-core, some are still pending (patches were sent to the oe-core
> mailing list).

Tom, would be nice, if you accept my pull request for the moment.

*If* i have some time later i can try to have a look at oe-core stuff. Or may be someone else.

Thx,
Steffen