Skip to contentSkip to conversation

Fixes for python-native and runqemu with uclibc

PATCH Applied Khem Raj 2 participants 5 messages Nov 28, 2011 – Nov 29, 2011

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover Fixes for python-native and runqemu with uclibc

These patches fix a problem with python-native and other patches to get runqemu working with uclibc

The following changes since commit a14b41f4de3ea6c3f00ff7a1d0441483e40b28de:

default-distrovars: Define SDK_VERSION and DISTRO_VERSION (2011-11-27 17:32:00 -0800)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib kraj/misc
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/misc

Khem Raj (3):
default-distrovars: Define SDK_VERSION and DISTRO_VERSION toolchain-scripts.bbclass: Make it work when TCLIBC=uclibc
python-native: Fix gcc compiler detecting logic

 meta/classes/toolchain-scripts.bbclass             |    8 +++++-
 meta/conf/distro/include/default-distrovars.inc    |    3 +-
 .../python/python-native/unixccompiler.patch       |   22 ++++++++++----------
 .../recipes-devtools/python/python-native_2.7.2.bb |    2 +-
 4 files changed, 20 insertions(+), 15 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/3 default-distrovars: Define SDK_VERSION and DISTRO_VERSION

runqemu scripts check for them and when using just oe-core these are not defined anywhere

---
 meta/conf/distro/include/default-distrovars.inc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
meta/conf/distro/include/default-distrovars.inc +2 -1
index 79c6e14..6f5f1c0 100644
@@ -46,4 +46,5 @@ NO32LIBS ??= "1"
 
 # Default to emitting logfiles if a build fails.
 BBINCLUDELOGS ??= "yes"
-
+SDK_VERSION ??= "oe-core.0"
+DISTRO_VERSION ??= "oe-core.0"
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/3 toolchain-scripts.bbclass: Make it work when TCLIBC=uclibc

This class currently only works with eglibc. Since it adds dependencies explicitly on eglibc when using uclibc this creates problems. So we make sure that it checks for TCLIBC to determine system C library in use

---
 meta/classes/toolchain-scripts.bbclass |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
meta/classes/toolchain-scripts.bbclass +6 -2
index c936a27..5fb6cd3 100644
@@ -104,7 +104,7 @@ toolchain_create_sdk_env_script_for_installer () {
 #we get the cached site config in the runtime
 TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d, True)}"
 TOOLCHAIN_CONFIGSITE_SYSROOTCACHE := "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
-TOOLCHAIN_NEED_CONFIGSITE_CACHE = "eglibc ncurses"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE = "ncurses"
 
 #This function create a site config file
 toolchain_create_sdk_siteconfig () {
@@ -112,7 +112,9 @@ toolchain_create_sdk_siteconfig () {
 
 	rm -f $siteconfig
 	touch $siteconfig
-
+	if [ "${LIBC}" = "eglibc" ]; then
+		TOOLCHAIN_NEED_CONFIGSITE_CACHE = "${TOOLCHAIN_NEED_CONFIGSITE_CACHE} eglibc"
+	fi
 	for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do
 		cat $sitefile >> $siteconfig
 	done
@@ -140,5 +142,7 @@ python __anonymous () {
     deps = d.getVarFlag('do_configure', 'depends') or ""
     for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', True) or "").split():
         deps += " %s:do_populate_sysroot" % dep
+    if d.getVar('TCLIBC', True) is "uclibc":
+	deps += "uclibc:do_populate_sysroot"
     d.setVarFlag('do_configure', 'depends', deps)
 }
Signature · 1 line
1.7.5.4
author
#3 lore raw

PATCH 3/3 python-native: Fix gcc compiler detecting logic

In reply to Khem Raj

We have a patch unixccompiler.patch where we try to throw away everything except first element of CC string but this does not work if gcc is prepended with something e.g. CC="ccache gcc" then the logic fails and it ends up in some modules failing on you silently (_sqlite3) in my case.
The fix here is to drop basename so we keep the whole string as it is and then the detection function searches for gcc string in the whole CC. This works in both cases one the original intent of the patch and the second described above. One place where it will fail is if someone has non-gcc compiler installed in some subdir which has gcc in it e.g. /usr/gcc/fakecc but for OE this should never happen. Ideally the the detection logic should have tried to execute gcc and then parsed --version output or something.

---
 .../python/python-native/unixccompiler.patch       |   22 ++++++++++----------
 .../recipes-devtools/python/python-native_2.7.2.bb |    2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)
meta/recipes-devtools/python/python-native/unixccompiler.patch +11 -11
index 10a9baf..4502829 100644
@@ -1,20 +1,20 @@
-Upstream-Status: Inappropriate [embedded specific]
+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.
+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.
 
-#Signed-off-by: Mei Lei <[email protected]>
-
-diff --git Python-2.6.6/Lib/distutils/unixccompiler.py Python-2.6.6/Lib/distutils/unixccompiler.py
-index 6d0b84d..aaf49cb 100644
---- Python-2.6.6/Lib/distutils/unixccompiler.py
-+++ Python-2.6.6/Lib/distutils/unixccompiler.py
-@@ -282,7 +282,7 @@ class UnixCCompiler(CCompiler):
+Signed-off-by: Mei Lei <[email protected]>
+Signed-off-by: Khem Raj <[email protected]>
+Index: Python-2.7.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py	2011-11-24 13:51:10.539998722 -0800
++++ Python-2.7.2/Lib/distutils/unixccompiler.py	2011-11-24 15:54:36.872137766 -0800
+@@ -282,7 +282,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 = os.path.basename(sysconfig.get_config_var("CC").split()[0])
++        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
meta/recipes-devtools/python/python-native_2.7.2.bb +1 -1
index 6b90d5b..d036eca 100644
@@ -1,6 +1,6 @@
 require python.inc
 DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native"
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 SRC_URI += "file://04-default-is-optimized.patch \
            file://05-enable-ctypes-cross-build.patch \
Signature · 1 line
1.7.5.4
Applied
#4 lore raw
In reply to Khem Raj
Quoted 16 lines · Khem Raj

These patches fix a problem with python-native and other patches to get runqemu working with uclibc

The following changes since commit a14b41f4de3ea6c3f00ff7a1d0441483e40b28de:

   default-distrovars: Define SDK_VERSION and DISTRO_VERSION (2011-11-27 17:32:00 -0800)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib kraj/misc
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/misc

Khem Raj (3):
default-distrovars: Define SDK_VERSION and DISTRO_VERSION toolchain-scripts.bbclass: Make it work when TCLIBC=uclibc
python-native: Fix gcc compiler detecting logic

Quoted 6 lines
  meta/classes/toolchain-scripts.bbclass             |    8 +++++-
  meta/conf/distro/include/default-distrovars.inc    |    3 +-
  .../python/python-native/unixccompiler.patch       |   22 ++++++++++----------
  .../recipes-devtools/python/python-native_2.7.2.bb |    2 +-
  4 files changed, 20 insertions(+), 15 deletions(-)

Merged into OE-Core

Thanks
Sau!