Skip to contentSkip to conversation

Unify ldd/ldconfig for all multilib eglibcs

PATCH Applied Lianhao Lu 2 participants 4 messages Aug 12, 2011 – Aug 15, 2011

lore
Share & tools
lore

Lianhao Lu

author
#0 lore raw

v2 cover Unify ldd/ldconfig for all multilib eglibcs

This is rebase of original patch for bug #1236 to the latest oe-core master.

The original pull request is at:
http://lists.linuxtogo.org/pipermail/openembedded-core/2011-August/007365.html

The following changes since commit a92d56058b21913570bb17ae416c3b00afce055e:
Kumar Gala (1):
gnome-doc-utils: respect python-dir setting EXTRA_OECONF

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib llu/bug1236-oecore
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=llu/bug1236-oecore

Lianhao Lu (2):
utils.bbclass/multilib.class: Added misc supporting functions.
eglibc: Modify ldd script according to multilib config.

 meta/classes/multilib.bbclass                      |    7 ++-
 meta/classes/utils.bbclass                         |   29 +++++++++++
 meta/conf/bitbake.conf                             |    1 +
 meta/conf/multilib.conf                            |    3 +
 .../eglibc/eglibc-2.13/multilib_readlib.patch      |   17 ++++++
 meta/recipes-core/eglibc/eglibc-ld.inc             |   54 ++++++++++++++++++++
 meta/recipes-core/eglibc/eglibc.inc                |    1 +
 meta/recipes-core/eglibc/eglibc_2.13.bb            |   13 ++++-
 8 files changed, 123 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch
 create mode 100644 meta/recipes-core/eglibc/eglibc-ld.inc
author
#1 lore raw

PATCH v2 1/2 utils.bbclass/multilib.class: Added misc supporting functions.

1. Added variable MULTILIB_VARIANTS to store all the instance variants for multilib extend.

2. Added function all_multilib_tune_values to collect the variable values for all multilib instance.

3. multilib bbclass handler will save the orignal value of all variables defined in MULTILIB_SAVE_VARNAME.

---
 meta/classes/multilib.bbclass |    7 ++++++-
 meta/classes/utils.bbclass    |   29 +++++++++++++++++++++++++++++
 meta/conf/bitbake.conf        |    1 +
 meta/conf/multilib.conf       |    3 +++
 4 files changed, 39 insertions(+), 1 deletions(-)
meta/classes/multilib.bbclass +6 -1
index 6e1669f..571b7be 100644
@@ -6,7 +6,12 @@ python multilib_virtclass_handler () {
     variant = e.data.getVar("BBEXTENDVARIANT", True)
     if cls != "multilib" or not variant:
         return
- 
+    save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
+    for name in save_var_name.split():
+        val=e.data.getVar(name, True)
+        if val:
+            e.data.setVar(name + "_MULTILIB_ORIGINAL", val)
+
     override = ":virtclass-multilib-" + variant
 
     e.data.setVar("MLPREFIX", variant + "-")
meta/classes/utils.bbclass +29 -0
index 8c3a9b8..c66c184 100644
@@ -341,3 +341,32 @@ def base_set_filespath(path, d):
 		for o in overrides.split(":"):
 			filespath.append(os.path.join(p, o))
 	return ":".join(filespath)
+
+def extend_variants(d, var, extend, delim=':'):
+	"""Return a string of all bb class extend variants for the given extend"""
+	variants = []
+	whole = d.getVar(var, True) or ""
+	for ext in whole.split():
+		eext = ext.split(delim)
+		if len(eext) > 1 and eext[0] == extend:
+			variants.append(eext[1])
+	return " ".join(variants)
+
+def all_multilib_tune_values(d, var, unique=True):
+	"""Return a string of all ${var} in all multilib tune configuration"""
+	values = []
+	value = d.getVar(var, True) or ""
+	if value != "":
+		values.append(value)
+	variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+	for item in variants.split():
+		localdata = bb.data.createCopy(d)
+		overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+		localdata.setVar("OVERRIDES", overrides)
+		bb.data.update_data(localdata)
+		value = localdata.getVar(var, True) or ""
+		if value != "":
+			values.append(value)
+	if unique:
+		values = set(values)
+	return " ".join(values)
meta/conf/bitbake.conf +1 -0
index 7bb68b8..b309516 100644
@@ -749,3 +749,4 @@ BB_HASHTASK_WHITELIST ?= "(.*-cross$|.*-native$|.*-cross-initial$|.*-cross-inter
 BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE"
 
 MLPREFIX ??= ""
+MULTILIB_VARIANTS ??= ""
meta/conf/multilib.conf +3 -0
index f2a2002..36793d2 100644
@@ -1,6 +1,9 @@
 
 baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or 'lib'}"
 
+MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
+MULTILIB_SAVE_VARNAME = "DEFAULTTUNE"
+
 MULTILIBS ??= "multilib:lib32"
 
 BBCLASSEXTEND_append_pn-acl = " ${MULTILIBS}"
Signature · 1 line
1.7.0.4
author
#2 lore raw

PATCH v2 2/2 eglibc: Modify ldd script according to multilib config.

Bug fixing [YOCTO #1236].

1. Collect all the values for RTLDLIST for the current multilib configuration to modify the ldd scripts.

2. Collect all the values for KNOWN_INTERPRETER_NAMES for the current multilib configuration. Set the correct ld.so names for ldconfig to deal with the multilib configuration.

---
 .../eglibc/eglibc-2.13/multilib_readlib.patch      |   17 ++++++
 meta/recipes-core/eglibc/eglibc-ld.inc             |   54 ++++++++++++++++++++
 meta/recipes-core/eglibc/eglibc.inc                |    1 +
 meta/recipes-core/eglibc/eglibc_2.13.bb            |   13 ++++-
 4 files changed, 84 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch
 create mode 100644 meta/recipes-core/eglibc/eglibc-ld.inc
meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch new file +17 -0
new file mode 100644
index 0000000..1542b1b
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of 
+variable EGLIBC_KNOWN_INTERPRETER_NAMES.
+
+Lianhao Lu, 08/01/2011
+
+--- libc/elf/readlib.c.orig	2011-08-12 17:05:51.864470837 +0800
++++ libc/elf/readlib.c	2011-08-12 17:06:39.346942074 +0800
+@@ -52,6 +52,7 @@
+ #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
+   SYSDEP_KNOWN_INTERPRETER_NAMES
+ #endif
++  OECORE_KNOWN_INTERPRETER_NAMES
+ };
+ 
+ static struct known_names known_libs[] =
meta/recipes-core/eglibc/eglibc-ld.inc new file +54 -0

54 lines not on this page · raw message

meta/recipes-core/eglibc/eglibc.inc +1 -0
index 9088d02..fe9f8ba 100644
@@ -1,4 +1,5 @@
 require eglibc-common.inc
+require eglibc-ld.inc
 
 STAGINGCC = "gcc-cross-intermediate"
 STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate"
meta/recipes-core/eglibc/eglibc_2.13.bb +12 -1
index 915eb32..f382448 100644
@@ -3,7 +3,7 @@ require eglibc.inc
 SRCREV = "14157"
 
 DEPENDS += "gperf-native"
-PR = "r12"
+PR = "r13"
 PR_append = "+svnr${SRCPV}"
 
 EGLIBC_BRANCH="eglibc-2_13"
@@ -18,6 +18,7 @@ SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http
            file://generate-supported.mk \
            file://glibc_bug_fix_12454.patch \
            file://ppc-sqrt.patch \
+           file://multilib_readlib.patch \
 	   "
 LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \
       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
@@ -83,6 +84,7 @@ do_move_ports() {
 
 do_patch_append() {
 	bb.build.exec_func('do_fix_ia_headers', d)
+	bb.build.exec_func('do_fix_readlib_c', d)
 }
 
 # We need to ensure that all of the i386 and x86_64 headers are identical
@@ -172,6 +174,10 @@ do_fix_ia_headers() {
 	cp ${S}/sysdeps/unix/sysv/linux/x86_64/sys/user.h ${S}/sysdeps/unix/sysv/linux/i386/sys/user.h
 }
 
+do_fix_readlib_c () {
+	sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
+}
+
 do_configure () {
 # override this function to avoid the autoconf/automake/aclocal/autoheader
 # calls for now
@@ -201,6 +207,11 @@ do_compile () {
 			rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
 		done
 	)
+	echo "Adjust ldd script"
+	[ -z "${RTLDLIST}" ] && return
+	sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)"\(.*\)"$#\1\2#'
+	sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)\(.*\)$#\1"${RTLDLIST} \2"#'
+
 }
 
 require eglibc-package.inc
Signature · 1 line
1.7.0.4
Applied
#3 lore raw
In reply to Lianhao Lu
Quoted 27 lines · Lianhao Lu

This is rebase of original patch for bug #1236 to the latest oe-core master.

The original pull request is at:
http://lists.linuxtogo.org/pipermail/openembedded-core/2011-August/007365.html

The following changes since commit a92d56058b21913570bb17ae416c3b00afce055e:
Kumar Gala (1):
gnome-doc-utils: respect python-dir setting EXTRA_OECONF

are available in the git repository at:

   git://git.yoctoproject.org/poky-contrib llu/bug1236-oecore
   http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=llu/bug1236-oecore

Lianhao Lu (2):
utils.bbclass/multilib.class: Added misc supporting functions.
eglibc: Modify ldd script according to multilib config.

  meta/classes/multilib.bbclass                      |    7 ++-
  meta/classes/utils.bbclass                         |   29 +++++++++++
  meta/conf/bitbake.conf                             |    1 +
  meta/conf/multilib.conf                            |    3 +
  .../eglibc/eglibc-2.13/multilib_readlib.patch      |   17 ++++++
  meta/recipes-core/eglibc/eglibc-ld.inc             |   54 ++++++++++++++++++++
  meta/recipes-core/eglibc/eglibc.inc                |    1 +
  meta/recipes-core/eglibc/eglibc_2.13.bb            |   13 ++++-
  8 files changed, 123 insertions(+), 2 deletions(-)
Quoted 9 lines

create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch create mode 100644 meta/recipes-core/eglibc/eglibc-ld.inc

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Merged into OE-Core

Thanks
Sau!