[oe-commits] Khem Raj : python3: Fix the compiler invocation and linker flags when cross compiling
git at git.openembedded.org
git at git.openembedded.org
Mon Aug 26 12:10:01 UTC 2013
Module: openembedded-core.git
Branch: master-next
Commit: 069d8c1243993caadd1adc514841371ad2dcc77f
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=069d8c1243993caadd1adc514841371ad2dcc77f
Author: Khem Raj <raj.khem at gmail.com>
Date: Thu Aug 1 01:06:26 2013 -0700
python3: Fix the compiler invocation and linker flags when cross compiling
The details are in patch header. This should fix the QA errors about
host contamination
Add virtual/libintl to dep list
There is use of libintl.h but we dont
express the dependency
Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
.../python/python3-native_3.3.2.bb | 1 +
.../python/python3/unixccompiler.patch | 33 ++++++++++++++++++++
meta/recipes-devtools/python/python3_3.3.2.bb | 3 +-
3 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-devtools/python/python3-native_3.3.2.bb b/meta/recipes-devtools/python/python3-native_3.3.2.bb
index da8dc87..d11ec51 100644
--- a/meta/recipes-devtools/python/python3-native_3.3.2.bb
+++ b/meta/recipes-devtools/python/python3-native_3.3.2.bb
@@ -21,6 +21,7 @@ file://06-ctypes-libffi-fix-configure.patch \
file://shutil-follow-symlink-fix.patch \
file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
file://sysroot-include-headers.patch \
+file://unixccompiler.patch \
${DISTRO_SRC_URI} \
"
SRC_URI[md5sum] = "7dffe775f3bea68a44f762a3490e5e28"
diff --git a/meta/recipes-devtools/python/python3/unixccompiler.patch b/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 0000000..b2229b4
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
+use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
+ok on native systems too since sysroot for native compilers is /
+
+Signed-off-by: Mei Lei <lei.mei at intel.com>
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+Index: Python-3.3.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700
++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700
+@@ -202,7 +202,7 @@
+ # ccompiler.py.
+
+ def library_dir_option(self, dir):
+- return "-L" + dir
++ return "-L=" + dir
+
+ def _is_gcc(self, compiler_name):
+ return "gcc" in compiler_name or "g++" in compiler_name
+@@ -221,7 +221,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
diff --git a/meta/recipes-devtools/python/python3_3.3.2.bb b/meta/recipes-devtools/python/python3_3.3.2.bb
index fe423d3..6ff32d8 100644
--- a/meta/recipes-devtools/python/python3_3.3.2.bb
+++ b/meta/recipes-devtools/python/python3_3.3.2.bb
@@ -1,6 +1,6 @@
require recipes-devtools/python/python.inc
-DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib"
+DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl"
PR = "${INC_PR}.0"
PYTHON_MAJMIN = "3.3"
PYTHON_BINABI= "${PYTHON_MAJMIN}m"
@@ -31,6 +31,7 @@ SRC_URI += "\
file://python-3.3-multilib.patch \
file://shutil-follow-symlink-fix.patch \
file://sysroot-include-headers.patch \
+ file://unixccompiler.patch \
"
SRC_URI[md5sum] = "7dffe775f3bea68a44f762a3490e5e28"
SRC_URI[sha256sum] = "f77202fe2bbc203205d7bd6e8452567fa1d9bc97f6957c9ef753d9a36cdcbe9a"
More information about the Openembedded-commits
mailing list