summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-07-29 22:26:42 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-15 15:26:17 +0100
commitfb2dfe7ac8e70d2969ebe14995900217e54716f6 (patch)
treefb5d68f641ca6d06d40e59217ea4d3bd000256db /meta
parent375cf1561c0c9356a629495256423b44ddced9b6 (diff)
downloadpoky-fb2dfe7ac8e70d2969ebe14995900217e54716f6.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-ld.inc54
-rw-r--r--meta/recipes-core/eglibc/eglibc.inc1
-rw-r--r--meta/recipes-core/eglibc/eglibc_2.13.bb13
4 files changed, 84 insertions, 1 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch
new file mode 100644
index 0000000000..1542b1b519
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.13/multilib_readlib.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of
4variable EGLIBC_KNOWN_INTERPRETER_NAMES.
5
6Lianhao Lu, 08/01/2011
7
8--- libc/elf/readlib.c.orig 2011-08-12 17:05:51.864470837 +0800
9+++ libc/elf/readlib.c 2011-08-12 17:06:39.346942074 +0800
10@@ -52,6 +52,7 @@
11 #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
12 SYSDEP_KNOWN_INTERPRETER_NAMES
13 #endif
14+ OECORE_KNOWN_INTERPRETER_NAMES
15 };
16
17 static struct known_names known_libs[] =
diff --git a/meta/recipes-core/eglibc/eglibc-ld.inc b/meta/recipes-core/eglibc/eglibc-ld.inc
new file mode 100644
index 0000000000..b3eb46e160
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-ld.inc
@@ -0,0 +1,54 @@
1def ld_append_if_tune_exists(d, infos, dict):
2 tune = d.getVar("DEFAULTTUNE", True) or ""
3 libdir = d.getVar("base_libdir", True) or ""
4 if dict.has_key(tune):
5 infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
6 infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
7
8def eglibc_dl_info(d):
9 ld_info_all = {
10 "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
11 "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
12 "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
13 "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
14 "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
15 "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
16 "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
17 "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
18 "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
19 "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
20 "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
21 "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
22 "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
23 "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
24 "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
25 "core2": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
26 "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
27 "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
28 "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
29 "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
30 }
31
32 infos = {'ldconfig':set(), 'lddrewrite':set()}
33 ld_append_if_tune_exists(d, infos, ld_info_all)
34
35 #DEFAULTTUNE_MULTILIB_ORIGINAL
36 original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
37 if original_tune:
38 localdata = bb.data.createCopy(d)
39 localdata.setVar("DEFAULTTUNE", original_tune)
40 ld_append_if_tune_exists(localdata, infos, ld_info_all)
41
42 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
43 for item in variants.split():
44 localdata = bb.data.createCopy(d)
45 overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
46 localdata.setVar("OVERRIDES", overrides)
47 bb.data.update_data(localdata)
48 ld_append_if_tune_exists(localdata, infos, ld_info_all)
49 infos['ldconfig'] = ','.join(infos['ldconfig'])
50 infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
51 return infos
52
53EGLIBC_KNOWN_INTERPRETER_NAMES = "${@eglibc_dl_info(d)['ldconfig']}"
54RTLDLIST = "${@eglibc_dl_info(d)['lddrewrite']}"
diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc
index 9088d02b36..fe9f8bab55 100644
--- a/meta/recipes-core/eglibc/eglibc.inc
+++ b/meta/recipes-core/eglibc/eglibc.inc
@@ -1,4 +1,5 @@
1require eglibc-common.inc 1require eglibc-common.inc
2require eglibc-ld.inc
2 3
3STAGINGCC = "gcc-cross-intermediate" 4STAGINGCC = "gcc-cross-intermediate"
4STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate" 5STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate"
diff --git a/meta/recipes-core/eglibc/eglibc_2.13.bb b/meta/recipes-core/eglibc/eglibc_2.13.bb
index 915eb32a8a..f3824485fa 100644
--- a/meta/recipes-core/eglibc/eglibc_2.13.bb
+++ b/meta/recipes-core/eglibc/eglibc_2.13.bb
@@ -3,7 +3,7 @@ require eglibc.inc
3SRCREV = "14157" 3SRCREV = "14157"
4 4
5DEPENDS += "gperf-native" 5DEPENDS += "gperf-native"
6PR = "r12" 6PR = "r13"
7PR_append = "+svnr${SRCPV}" 7PR_append = "+svnr${SRCPV}"
8 8
9EGLIBC_BRANCH="eglibc-2_13" 9EGLIBC_BRANCH="eglibc-2_13"
@@ -18,6 +18,7 @@ SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http
18 file://generate-supported.mk \ 18 file://generate-supported.mk \
19 file://glibc_bug_fix_12454.patch \ 19 file://glibc_bug_fix_12454.patch \
20 file://ppc-sqrt.patch \ 20 file://ppc-sqrt.patch \
21 file://multilib_readlib.patch \
21 " 22 "
22LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \ 23LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \
23 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \ 24 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
@@ -83,6 +84,7 @@ do_move_ports() {
83 84
84do_patch_append() { 85do_patch_append() {
85 bb.build.exec_func('do_fix_ia_headers', d) 86 bb.build.exec_func('do_fix_ia_headers', d)
87 bb.build.exec_func('do_fix_readlib_c', d)
86} 88}
87 89
88# We need to ensure that all of the i386 and x86_64 headers are identical 90# We need to ensure that all of the i386 and x86_64 headers are identical
@@ -172,6 +174,10 @@ do_fix_ia_headers() {
172 cp ${S}/sysdeps/unix/sysv/linux/x86_64/sys/user.h ${S}/sysdeps/unix/sysv/linux/i386/sys/user.h 174 cp ${S}/sysdeps/unix/sysv/linux/x86_64/sys/user.h ${S}/sysdeps/unix/sysv/linux/i386/sys/user.h
173} 175}
174 176
177do_fix_readlib_c () {
178 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
179}
180
175do_configure () { 181do_configure () {
176# override this function to avoid the autoconf/automake/aclocal/autoheader 182# override this function to avoid the autoconf/automake/aclocal/autoheader
177# calls for now 183# calls for now
@@ -201,6 +207,11 @@ do_compile () {
201 rpcgen -h $r -o $h || oewarn "unable to generate header for $r" 207 rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
202 done 208 done
203 ) 209 )
210 echo "Adjust ldd script"
211 [ -z "${RTLDLIST}" ] && return
212 sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)"\(.*\)"$#\1\2#'
213 sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)\(.*\)$#\1"${RTLDLIST} \2"#'
214
204} 215}
205 216
206require eglibc-package.inc 217require eglibc-package.inc