summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorKlaus Kurzmann <mok@fluxnetz.de>2011-10-12 09:03:21 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-14 13:18:19 +0100
commit88f81c7ffed38c0baab19f6e2ddf3eba7d409fa2 (patch)
tree3327926e61ee54a5e31a2bbdb05efa92c393270c /meta/recipes-core
parentf617af4ea33371ff2ef3bd6535da961350e641fb (diff)
downloadpoky-88f81c7ffed38c0baab19f6e2ddf3eba7d409fa2.tar.gz
eglibc-2.14: add patch to fix libdl crash
* Without this patch programs using alsa-lib crash (alsamixer for example). * This patch is taken verbatim from ArchLinux. (From OE-Core rev: 2d2ac8bbbbb98080ad339113c3f27f9573374be2) Signed-off-by: Klaus Kurzmann <mok@fluxnetz.de> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.14/glibc-2.14-libdl-crash.patch131
-rw-r--r--meta/recipes-core/eglibc/eglibc_2.14.bb5
2 files changed, 134 insertions, 2 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.14/glibc-2.14-libdl-crash.patch b/meta/recipes-core/eglibc/eglibc-2.14/glibc-2.14-libdl-crash.patch
new file mode 100644
index 0000000000..e1f135c424
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.14/glibc-2.14-libdl-crash.patch
@@ -0,0 +1,131 @@
1Without this patch programs using alsa-lib crash (alsamixer for example).
2Removed Copyright reverts
3
4Upstream-Status: Pending
5
6http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=675155e9
7http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html
8
9many distributions are using this already
10http://chakra-project.org/ccr/packages/glibc/glibc/PKGBUILD
11http://mailman.archlinux.org/pipermail/arch-commits/2011-June/137142.html
12http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/glibc/current/SOURCES/glibc-2.14-libdl-crash.patch?view=markup&pathrev=691343
13http://repos.archlinuxppc.org/wsvn/filedetails.php?repname=packages&path=%2Fglibc%2Ftrunk%2Fglibc-2.14-libdl-crash.patch
14
15diff --git a/elf/dl-close.c b/elf/dl-close.c
16index 73b2a2f..9bd91e3 100644
17--- a/elf/dl-close.c
18+++ b/elf/dl-close.c
19@@ -119,17 +119,8 @@ _dl_close_worker (struct link_map *map)
20 if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
21 || dl_close_state != not_pending)
22 {
23- if (map->l_direct_opencount == 0)
24- {
25- if (map->l_type == lt_loaded)
26- dl_close_state = rerun;
27- else if (map->l_type == lt_library)
28- {
29- struct link_map **oldp = map->l_initfini;
30- map->l_initfini = map->l_orig_initfini;
31- _dl_scope_free (oldp);
32- }
33- }
34+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
35+ dl_close_state = rerun;
36
37 /* There are still references to this object. Do nothing more. */
38 if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
39diff --git a/elf/dl-deps.c b/elf/dl-deps.c
40index 9e30594..3890d00 100644
41--- a/elf/dl-deps.c
42+++ b/elf/dl-deps.c
43@@ -478,6 +478,7 @@ _dl_map_object_deps (struct link_map *map,
44 nneeded * sizeof needed[0]);
45 atomic_write_barrier ();
46 l->l_initfini = l_initfini;
47+ l->l_free_initfini = 1;
48 }
49
50 /* If we have no auxiliary objects just go on to the next map. */
51@@ -681,6 +682,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
52 l_initfini[nlist] = NULL;
53 atomic_write_barrier ();
54 map->l_initfini = l_initfini;
55+ map->l_free_initfini = 1;
56 if (l_reldeps != NULL)
57 {
58 atomic_write_barrier ();
59@@ -689,5 +691,5 @@ Filters not supported with LD_TRACE_PRELINKING"));
60 _dl_scope_free (old_l_reldeps);
61 }
62 if (old_l_initfini != NULL)
63- map->l_orig_initfini = old_l_initfini;
64+ _dl_scope_free (old_l_initfini);
65 }
66diff --git a/elf/dl-libc.c b/elf/dl-libc.c
67index 7be9483..a13fce3 100644
68--- a/elf/dl-libc.c
69+++ b/elf/dl-libc.c
70@@ -265,13 +265,13 @@ libc_freeres_fn (free_mem)
71
72 for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
73 {
74- /* Remove all additional names added to the objects. */
75 for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
76 {
77 struct libname_list *lnp = l->l_libname->next;
78
79 l->l_libname->next = NULL;
80
81+ /* Remove all additional names added to the objects. */
82 while (lnp != NULL)
83 {
84 struct libname_list *old = lnp;
85@@ -279,6 +279,10 @@ libc_freeres_fn (free_mem)
86 if (! old->dont_free)
87 free (old);
88 }
89+
90+ /* Free the initfini dependency list. */
91+ if (l->l_free_initfini)
92+ free (l->l_initfini);
93 }
94
95 if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
96diff --git a/elf/rtld.c b/elf/rtld.c
97index 4a9109e..617e30e 100644
98--- a/elf/rtld.c
99+++ b/elf/rtld.c
100@@ -2251,6 +2251,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
101 lnp->dont_free = 1;
102 lnp = lnp->next;
103 }
104+ l->l_free_initfini = 0;
105
106 if (l != &GL(dl_rtld_map))
107 _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
108diff --git a/include/link.h b/include/link.h
109index e877104..051b99a 100644
110--- a/include/link.h
111+++ b/include/link.h
112@@ -192,6 +192,9 @@ struct link_map
113 during LD_TRACE_PRELINKING=1
114 contains any DT_SYMBOLIC
115 libraries. */
116+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
117+ freed, ie. not allocated with
118+ the dummy malloc in ld.so. */
119
120 /* Collected information about own RPATH directories. */
121 struct r_search_path_struct l_rpath_dirs;
122@@ -240,9 +243,6 @@ struct link_map
123
124 /* List of object in order of the init and fini calls. */
125 struct link_map **l_initfini;
126- /* The init and fini list generated at startup, saved when the
127- object is also loaded dynamically. */
128- struct link_map **l_orig_initfini;
129
130 /* List of the dependencies introduced through symbol binding. */
131 struct link_map_reldeps
diff --git a/meta/recipes-core/eglibc/eglibc_2.14.bb b/meta/recipes-core/eglibc/eglibc_2.14.bb
index b2821db283..571d39d26e 100644
--- a/meta/recipes-core/eglibc/eglibc_2.14.bb
+++ b/meta/recipes-core/eglibc/eglibc_2.14.bb
@@ -3,7 +3,7 @@ require eglibc.inc
3SRCREV = "15225" 3SRCREV = "15225"
4 4
5DEPENDS += "gperf-native" 5DEPENDS += "gperf-native"
6PR = "r0" 6PR = "r1"
7PR_append = "+svnr${SRCPV}" 7PR_append = "+svnr${SRCPV}"
8 8
9EGLIBC_BRANCH="eglibc-2_14" 9EGLIBC_BRANCH="eglibc-2_14"
@@ -19,7 +19,8 @@ SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http
19 file://ppc-sqrt.patch \ 19 file://ppc-sqrt.patch \
20 file://multilib_readlib.patch \ 20 file://multilib_readlib.patch \
21 file://eglibc-rpc-export-again.patch \ 21 file://eglibc-rpc-export-again.patch \
22 " 22 file://glibc-2.14-libdl-crash.patch \
23 "
23LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \ 24LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \
24 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \ 25 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
25 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ 26 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \