Commit Graph

20 Commits

Author SHA1 Message Date
Tom Zanussi ccf6077d4e 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)

(From OE-Core rev: d83e4ac25cca788d2b102c2072ccb367c0cab284)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:38:14 +00:00
Saul Wold 41b5ca8582 python: fix sqlite RPATH issue
(From OE-Core rev: 9f9612d15acc6ee3b71f52bdb3f1ec4cb56b1a17)

(From OE-Core rev: 98acff46d777a5a0931a80a33e9c9d148a0f69a6)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:37:54 +00:00
Mark Hatle 3ac49c3a52 python: Fix cgi.py runtime issue
By default cgi.py attempts to use /usr/local/bin/python as its
interpreter.  However, on my Linux systems, including OE-Core,
python is installed into {bindir}.  Adjust this one file based on
the comment at the top of the upstream file.

This resolves an issue where a runtime dependency discovered during
RPM packaging breaks the rootfs construction.

(From OE-Core rev: 1da01664963b9c6a6df171dcd0fbb1406544035b)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22 05:07:00 +01:00
Dongxiao Xu 5fbac72eb8 multilib: Use BPN instead of PN for style like lib${PN}
When supporting multilib, ${PN} will be extended with MLPREFIX. However
if a package name contains ${PN} with styles like lib${PN}, such
extension will cause error. Use BPN in this case.

(From OE-Core rev: fbb734e5753655de30c82c0a036c9043820e02cb)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-03 18:07:25 +01:00
Nitin A Kamble 9d4f709a45 python: fix security vulnerability
This Fixes bug: [Yocto #1254]

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-1015

Issue #2254: Fix CGIHTTPServer information disclosure.  Relative paths are
  now collapsed within the url properly before looking in cgi_directories.

(From OE-Core rev: 43e7ec07065e58128819b0bb359358ce42628672)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-22 11:51:05 +01:00
Martin Jansa 1e261aee43 python: add patch to fix cross compilation on host with linux-3.0
(From OE-Core rev: 4b7e7b004dacb698ed637f35661a60d2402c00cd)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-21 10:59:19 +01:00
Martin Jansa 760139ceae python: save Makefile.sysroot in do_compile
* otherwise calling do_install twice results in Makefile.sysroot == Makefile.orig and distutils using wrong LIBDIR (from host)

(From OE-Core rev: e56064bad8a4e8626e7ff4096874fb7f36eb6880)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-21 10:59:19 +01:00
Richard Purdie 47fb894645 python: Fix libdir usage which broke python packaging
(From OE-Core rev: 0637d977d44555726c9aad704c97502b0fa549fa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-13 12:13:12 +01:00
Yu Ke 98d7597182 python: fix for libdir=/usr/lib64 case
python has several place hard code "lib" which breaks build
when libdir=/usr/lib64. SUSE has a patch to fix this issue.

So this patch add the SUSE patch to address this issue

(From OE-Core rev: c97ab268d6a7092a89c8b0051924a2acc2d86d9c)

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-12 15:00:47 +01:00
Richard Purdie 72a569d9e2 python: Ensure libpython.so ends up in the .dev package
(From OE-Core rev: bbd78814ed8beed951b7d68048957a9fe1ea4e28)

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01 23:27:26 +01:00
Mark Hatle d1557562a5 python: Switch to using the default -dbg package
Python was missing a lot of debug information.  Switch to use the default
-dbg package.  Also add some additional debug information to the -dbg package.

(From OE-Core rev: 63f4e1b469046753009d0cef498ef09c87c54912)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-23 12:07:36 +01:00
Martin Jansa 4da5ff75f7 python-2.6.6: py_package_preprocess should change Makefile only in PKGD not D
* PACKAGEFUNCS ?= "perform_packagecopy \
                ${PACKAGE_PREPROCESS_FUNCS} \
  our py_package_preprocess is called after perform_packagecopy which does copy D to PKGD
  so we change it to target version in D (image/) before populating sysroot (sysroot-destdir/)
  while keeping Makefile.sysroot version in PKGD which was created before calling
  py_package_preprocess, so both package for runtime and sysroot end wrong

* I haven't seen this problem on faster builder, I guess because do_package and do_populate_sysroot
  can run in paralell and I was lucky that do_populate_sysroot finished before py_package_preprocess
  was started, but if you build python step by step -c package first you should see it every time

* here is proof that with PKGD it works better:
  $ bitbake -c cleanall python
  $ bitbake -c install python
  $ grep LIBDIR= \
    ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile \
    ./package/usr/lib/python2.6/config/Makefile \
    ./sysroot-destdir/usr/lib/python2.6/config/Makefile \
    ./image/usr/lib/python2.6/config/Makefile \
    ./Python-2.6.6/Makefile \
    ~/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile
  grep: ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile: No such file or directory
  grep: ./package/usr/lib/python2.6/config/Makefile: No such file or directory
  grep: ./sysroot-destdir/usr/lib/python2.6/config/Makefile: No such file or directory
  ./image/usr/lib/python2.6/config/Makefile:LIBDIR=               /OE/shr-core/tmp/sysroots/om-gta02/usr/lib
  ./Python-2.6.6/Makefile:LIBDIR=         /usr/lib
  /OE/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile:LIBDIR=            /OE/shr-core/tmp/sysroots/om-gta02/usr/lib

  $ bitbake -c package python
  $ grep LIBDIR= \
    ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile \
    ./package/usr/lib/python2.6/config/Makefile \
    ./sysroot-destdir/usr/lib/python2.6/config/Makefile \
    ./image/usr/lib/python2.6/config/Makefile \
    ./Python-2.6.6/Makefile \
    ~/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile
  ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile:LIBDIR=             /usr/lib
  ./package/usr/lib/python2.6/config/Makefile:LIBDIR=             /usr/lib
  grep: ./sysroot-destdir/usr/lib/python2.6/config/Makefile: No such file or directory
  ./image/usr/lib/python2.6/config/Makefile:LIBDIR=               /OE/shr-core/tmp/sysroots/om-gta02/usr/lib
  ./Python-2.6.6/Makefile:LIBDIR=         /usr/lib
  /OE/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile:LIBDIR=            /OE/shr-core/tmp/sysroots/om-gta02/usr/lib

  $ bitbake -c package python
  $ grep LIBDIR= \
    ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile \
    ./package/usr/lib/python2.6/config/Makefile \
    ./sysroot-destdir/usr/lib/python2.6/config/Makefile \
    ./image/usr/lib/python2.6/config/Makefile \
    ./Python-2.6.6/Makefile \
    ~/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile
  ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile:LIBDIR=             /usr/lib
  ./package/usr/lib/python2.6/config/Makefile:LIBDIR=             /usr/lib
  ./sysroot-destdir/usr/lib/python2.6/config/Makefile:LIBDIR=             /OE/shr-core/tmp/sysroots/om-gta02/usr/lib
  ./image/usr/lib/python2.6/config/Makefile:LIBDIR=               /OE/shr-core/tmp/sysroots/om-gta02/usr/lib
  ./Python-2.6.6/Makefile:LIBDIR=         /usr/lib
  /OE/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile:LIBDIR=            /OE/shr-core/tmp/sysroots/om-gta02/usr/lib

* without this patch we have /usr/lib/ in image/sysroot-destdir and SYSROOT_LIBDIR in package/packages-split
  $ grep LIBDIR= \
    ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile \
    ./package/usr/lib/python2.6/config/Makefile \
    ./sysroot-destdir/usr/lib/python2.6/config/Makefile \
    ./image/usr/lib/python2.6/config/Makefile \
    ./Python-2.6.6/Makefile \
    ~/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile
  ./packages-split/python-distutils/usr/lib/python2.6/config/Makefile:LIBDIR=             /OE/shr-core/tmp/sysroots/om-gta02/usr/lib
  ./package/usr/lib/python2.6/config/Makefile:LIBDIR=             /OE/shr-core/tmp/sysroots/om-gta02/usr/lib
  ./sysroot-destdir/usr/lib/python2.6/config/Makefile:LIBDIR=             /usr/lib
  ./image/usr/lib/python2.6/config/Makefile:LIBDIR=               /usr/lib
  ./Python-2.6.6/Makefile:LIBDIR=         /usr/lib
  /OE/shr-core/tmp/sysroots/om-gta02/usr/lib/python2.6/config/Makefile:LIBDIR=            /usr/lib

(From OE-Core rev: 2ba5ce85dcc3c6812b10073bfc4ab600ca169df1)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-25 15:58:46 +01:00
Michael Lippautz b5adb300dd python: Unbreak Python third-party extensions
This patch fixes compilation/linking of python third-party extensions, i.e.
Extensions that ship with C code.

Problem:
Python uses distutils(-native) to compile third-party extensions. distutils
uses its own sysconfig module to get the options for compiling and linking.
Since third-party extensions have to be linked against this libpython it
important that -L points into staging. This is not the case because
distutils.sysconfig uses a special Makefile that is shipped with python
determine the paths. The Makefile is the same that would be used on the
target to build third-party extensions. It therefore points into /usr/lib
instead of staging.

Solution:
Stage a modified version of the Makefile where the paths (incdir, libdir) have
been replaced by ones that point into staging.

Side-problem:
The recipe actually should not stage files itself in do_compile, but rather
handle everything that needs to be staged in do_install. This is currently not
possible because python compiles itself using distutils-native. Distutils on
the other hand does only allow to add a path, but not to substitute it,
requiring a staged Makefile and libpython.so before the actual python
compilation is triggered.

The second step to solve this would be to either patch distutils, or split
python into python-initial and python. The -initial part could create the
Makefile and the library, while the main part focuses on the target.

For further references see:
 http://lists.linuxtogo.org/pipermail/openembedded-core/2011-May/001752.html

(From OE-Core rev: 413e7e5a5d6db45a6fbca5044246d6696d9d5711)

Signed-off-by: Michael Lippautz <michael.lippautz@gmail.com>
Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-04 15:06:34 +01:00
Darren Hart fc934af7c8 logging: update existing oe* logging users to the bb* interface
The new bash logging class provides bbnote, bbwarn, bbfatal, and bbdebug
replacements (as well as bbplain and bberror) for the oe* equivalents. Use the
new bb* API in preparation to delete the oe* logging API.

This patch was automatically generated by a sed script. The result has been
visually inspected and used to build core-image-sato for qemux86.

(From OE-Core rev: a1f09fce5caba389d0484b169f0cde85d64514fa)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-04 00:54:37 +01:00
Saul Wold 7bd1a635ec python: add missing cytpes modules
Contributed by Martin Jansa via OE

Fixes [YOCTO #1003]

(From OE-Core rev: 2870697f08c171f455dbba03dd529b8c4cf11937)

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-28 10:44:41 +01:00
Richard Purdie fc2cee5cc6 Rename poky-lsb override to linuxstdbase
(From OE-Core rev: 73a227a738da17229baac142ccd889c7929402ba)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:32 +01:00
Jingdong Lu e261c1760d python: Fix failures of LSB python-runtime tests.
Fix failues of LSB python-runtime tests.
test_largefile: add "ac_cv_sizeof_off_t=8" option explicitly into configure options in order to enable "LFS".
test_codecs, test_re, test_unicode: "--with-wctype-functions" will cause these tests failed, so remove it for LSB.
test_builtin, test_getargs: "sitecustomize.py" cause default encoding changed from "ascii" into "utf8" and it will cause these tests failed, so remove this file for LSB.

Signed-off-by: Jingdong Lu<jingdong.lu@windriver.com>
2011-01-20 21:37:02 +00:00
Saul Wold 3d08b9f2c6 SRC_URI Checksums Additionals
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2010-12-09 08:18:17 -08:00
Mei Lei 75f93fe26e python:Add license checksum to bb file
Add LICENSE file checksum to bb file

Signed-off-by: Mei Lei <lei.mei@intel.com>
2010-12-02 05:24:48 -08:00
Nitin A Kamble 793bb465b3 python, python-native upgrade from 2.6.5 to 2.6.6
Removed these patch:
    python-native-2.6.5/00-fix-bindir-libdir-for-cross.patch
    python/00-fix-bindir-libdir-for-cross.patch

The upstream code has changed, and it does not need the above 2 patches
(fixes) anymore.

Patches rebased to the newer code:
   python/01-use-proper-tools-for-cross-build.patch
   python/04-default-is-optimized.patch
   python/06-avoid_usr_lib_termcap_path_in_linking.patch
   python/99-ignore-optimization-flag.patch

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-11-14 21:08:26 -08:00