summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2011-03-29 12:55:18 -0700
committerSaul Wold <sgw@linux.intel.com>2011-05-06 17:44:22 -0700
commit9361df5ec235435f71774f3f93812f52af6f0a2e (patch)
treed033c8c519c5b43184d19dc3b8c3cd8b4f082cf0 /meta
parent5ec8233e2f2892b7746564724fbac738ed19450d (diff)
downloadpoky-9361df5ec235435f71774f3f93812f52af6f0a2e.tar.gz
ldconfig-native-2.12.1: newer recipe with eglibc sources
This fixes [YOCTO #780] Handle the input/output data with different endian-ness correctly Also fix the definition of LD_SO for cross environment And remove the older 2.5 version of ldconfig-native recipe (From OE-Core rev: 694db055f3729662e0e0193a31f2098be599877f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch (renamed from meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch)94
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/README8
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch451
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch22
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2bin0 -> 21491 bytes
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch (renamed from meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch)125
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch34
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb27
-rw-r--r--meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2bin19454 -> 0 bytes
-rw-r--r--meta/recipes-core/glibc/ldconfig-native_2.5.bb24
10 files changed, 672 insertions, 113 deletions
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch
index 4f8d3a39ca..8069c8931d 100644
--- a/meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch
@@ -1,8 +1,8 @@
1Index: ldconfig-native-2.5/readelflib.c 1Index: ldconfig-native-2.12.1/readelflib.c
2=================================================================== 2===================================================================
3--- ldconfig-native-2.5.orig/readelflib.c 2009-05-19 09:40:17.000000000 +0100 3--- ldconfig-native-2.12.1.orig/readelflib.c
4+++ ldconfig-native-2.5/readelflib.c 2009-05-19 09:56:18.000000000 +0100 4+++ ldconfig-native-2.12.1/readelflib.c
5@@ -40,38 +40,190 @@ 5@@ -40,39 +40,212 @@ do \
6 6
7 /* Returns 0 if everything is ok, != 0 in case of error. */ 7 /* Returns 0 if everything is ok, != 0 in case of error. */
8 int 8 int
@@ -33,7 +33,8 @@ Index: ldconfig-native-2.5/readelflib.c
33 33
34- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) 34- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
35+ if (elf_header->e_type != ET_DYN) 35+ if (elf_header->e_type != ET_DYN)
36+ { 36 {
37- if (opt_verbose)
37+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, 38+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
38+ elf_header->e_type); 39+ elf_header->e_type);
39+ return 1; 40+ return 1;
@@ -53,8 +54,7 @@ Index: ldconfig-native-2.5/readelflib.c
53+ program_interpreter = NULL; 54+ program_interpreter = NULL;
54+ for (i = 0, segment = elf_pheader; 55+ for (i = 0, segment = elf_pheader;
55+ i < elf_header->e_phnum; i++, segment++) 56+ i < elf_header->e_phnum; i++, segment++)
56 { 57+ {
57- if (opt_verbose)
58+ check_ptr (segment); 58+ check_ptr (segment);
59+ 59+
60+ switch (segment->p_type) 60+ switch (segment->p_type)
@@ -93,25 +93,45 @@ Index: ldconfig-native-2.5/readelflib.c
93+ break; 93+ break;
94+ 94+
95+ case PT_NOTE: 95+ case PT_NOTE:
96+ if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4) 96+ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
97+ { 97+ {
98+ Elf32_Word *abi_note = (Elf32_Word *) (file_contents 98+ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
99+ + segment->p_offset); 99+ + segment->p_offset);
100+ if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1 100+ Elf32_Addr size = segment->p_filesz;
101+ && memcmp (abi_note + 3, "GNU", 4) == 0) 101+
102+ *osversion = (abi_note [4] << 24) | 102+ while (abi_note [0] != 4 || abi_note [1] != 16
103+ ((abi_note [5] & 0xff) << 16) | 103+ || abi_note [2] != 1
104+ ((abi_note [6] & 0xff) << 8) | 104+ || memcmp (abi_note + 3, "GNU", 4) != 0)
105+ (abi_note [7] & 0xff); 105+ {
106+#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
107+ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
108+ + ROUND (abi_note[0])
109+ + ROUND (abi_note[1]);
110+
111+ if (size - 32 < note_size || note_size == 0)
112+ {
113+ size = 0;
114+ break;
115+ }
116+ size -= note_size;
117+ abi_note = (void *) abi_note + note_size;
118+ }
119+
120+ if (size == 0)
121+ break;
122+
123+ *osversion = (abi_note [4] << 24) |
124+ ((abi_note [5] & 0xff) << 16) |
125+ ((abi_note [6] & 0xff) << 8) |
126+ (abi_note [7] & 0xff);
106+ } 127+ }
107+ break; 128+ break;
108+ 129+
109+ default: 130+ default:
110+ break; 131+ break;
111 } 132+ }
112- return 1;
113+ 133+
114 } 134+ }
115+ if (loadaddr == (Elf32_Addr) -1) 135+ if (loadaddr == (Elf32_Addr) -1)
116+ { 136+ {
117+ /* Very strange. */ 137+ /* Very strange. */
@@ -136,9 +156,10 @@ Index: ldconfig-native-2.5/readelflib.c
136+ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); 156+ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
137+ check_ptr (dynamic_strings); 157+ check_ptr (dynamic_strings);
138+ break; 158+ break;
139+ } 159 }
140+ } 160- return 1;
141+ 161 }
162
142+ if (dynamic_strings == NULL) 163+ if (dynamic_strings == NULL)
143+ return 1; 164+ return 1;
144+ 165+
@@ -205,10 +226,11 @@ Index: ldconfig-native-2.5/readelflib.c
205+ 226+
206+ elf_header = (Elf64_Ehdr *) file_contents; 227+ elf_header = (Elf64_Ehdr *) file_contents;
207+ *osversion = 0; 228+ *osversion = 0;
208 229+
209 if (elf_header->e_type != ET_DYN) 230 if (elf_header->e_type != ET_DYN)
210 { 231 {
211@@ -81,7 +233,7 @@ 232 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
233@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
212 } 234 }
213 235
214 /* Get information from elf program header. */ 236 /* Get information from elf program header. */
@@ -217,7 +239,7 @@ Index: ldconfig-native-2.5/readelflib.c
217 check_ptr (elf_pheader); 239 check_ptr (elf_pheader);
218 240
219 /* The library is an elf library, now search for soname and 241 /* The library is an elf library, now search for soname and
220@@ -100,7 +252,7 @@ 242@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
221 switch (segment->p_type) 243 switch (segment->p_type)
222 { 244 {
223 case PT_LOAD: 245 case PT_LOAD:
@@ -226,16 +248,28 @@ Index: ldconfig-native-2.5/readelflib.c
226 loadaddr = segment->p_vaddr - segment->p_offset; 248 loadaddr = segment->p_vaddr - segment->p_offset;
227 break; 249 break;
228 250
229@@ -129,7 +281,7 @@ 251@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
230 case PT_NOTE: 252 case PT_NOTE:
231 if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4) 253 if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
232 { 254 {
233- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents 255- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
234+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents 256+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
235 + segment->p_offset); 257 + segment->p_offset);
236 if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1 258- ElfW(Addr) size = segment->p_filesz;
237 && memcmp (abi_note + 3, "GNU", 4) == 0) 259+ Elf64_Addr size = segment->p_filesz;
238@@ -145,7 +297,7 @@ 260
261 while (abi_note [0] != 4 || abi_note [1] != 16
262 || abi_note [2] != 1
263 || memcmp (abi_note + 3, "GNU", 4) != 0)
264 {
265-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
266- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
267+#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
268+ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
269 + ROUND (abi_note[0])
270 + ROUND (abi_note[1]);
271
272@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
239 } 273 }
240 274
241 } 275 }
@@ -244,7 +278,7 @@ Index: ldconfig-native-2.5/readelflib.c
244 { 278 {
245 /* Very strange. */ 279 /* Very strange. */
246 loadaddr = 0; 280 loadaddr = 0;
247@@ -155,7 +307,7 @@ 281@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
248 if (dynamic_size == 0) 282 if (dynamic_size == 0)
249 return 1; 283 return 1;
250 284
@@ -253,7 +287,7 @@ Index: ldconfig-native-2.5/readelflib.c
253 check_ptr (dynamic_segment); 287 check_ptr (dynamic_segment);
254 288
255 /* Find the string table. */ 289 /* Find the string table. */
256@@ -218,3 +370,33 @@ 290@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
257 291
258 return 0; 292 return 0;
259 } 293 }
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README
new file mode 100644
index 0000000000..43fb983729
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README
@@ -0,0 +1,8 @@
1The files are pulled verbatim from glibc 2.5 and then patched to allow
2standalone compilation of ldconfig.
3
4Richard Purdie
5OpenedHand Ltd.
6
7Upgraded the ldconfig recipe to eglibc 2.12.1
8Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 0000000000..77ba03c1af
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch
@@ -0,0 +1,451 @@
1Do data input/output handling according to endien-ness of the library file.
2
32011/04/04
4Richard Purdie <richard.purdie@linuxfoundation.org>
5Nitin Kamble <nitin.a.kamble@intel.com>
6
7Index: ldconfig-native-2.12.1/readelflib.c
8===================================================================
9--- ldconfig-native-2.12.1.orig/readelflib.c
10+++ ldconfig-native-2.12.1/readelflib.c
11@@ -38,6 +38,28 @@ do \
12 } \
13 while (0);
14
15+int be;
16+static uint16_t read16(uint16_t x, int be)
17+{
18+ if (be)
19+ return be16toh(x);
20+ return le16toh(x);
21+}
22+
23+static uint32_t read32(uint32_t x, int be)
24+{
25+ if (be)
26+ return be32toh(x);
27+ return le32toh(x);
28+}
29+
30+static uint64_t read64(uint64_t x, int be)
31+{
32+ if (be)
33+ return be64toh(x);
34+ return le64toh(x);
35+}
36+
37 /* Returns 0 if everything is ok, != 0 in case of error. */
38 int
39 process_elf_file32 (const char *file_name, const char *lib, int *flag,
40@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
41 elf_header = (Elf32_Ehdr *) file_contents;
42 *osversion = 0;
43
44- if (elf_header->e_type != ET_DYN)
45+ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
46+
47+ if (read16(elf_header->e_type, be) != ET_DYN)
48 {
49 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
50- elf_header->e_type);
51+ read16(elf_header->e_type, be));
52 return 1;
53 }
54
55 /* Get information from elf program header. */
56- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
57+ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
58 check_ptr (elf_pheader);
59
60 /* The library is an elf library, now search for soname and
61@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
62 dynamic_size = 0;
63 program_interpreter = NULL;
64 for (i = 0, segment = elf_pheader;
65- i < elf_header->e_phnum; i++, segment++)
66+ i < read16(elf_header->e_phnum, be); i++, segment++)
67 {
68 check_ptr (segment);
69
70- switch (segment->p_type)
71+ switch (read32(segment->p_type, be))
72 {
73 case PT_LOAD:
74 if (loadaddr == (Elf32_Addr) -1)
75- loadaddr = segment->p_vaddr - segment->p_offset;
76+ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
77 break;
78
79 case PT_DYNAMIC:
80 if (dynamic_addr)
81 error (0, 0, _("more than one dynamic segment\n"));
82
83- dynamic_addr = segment->p_offset;
84- dynamic_size = segment->p_filesz;
85+ dynamic_addr = read32(segment->p_offset, be);
86+ dynamic_size = read32(segment->p_filesz, be);
87 break;
88
89 case PT_INTERP:
90- program_interpreter = (char *) (file_contents + segment->p_offset);
91+ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
92 check_ptr (program_interpreter);
93
94 /* Check if this is enough to classify the binary. */
95@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
96 break;
97
98 case PT_NOTE:
99- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
100+ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
101 {
102 Elf32_Word *abi_note = (Elf32_Word *) (file_contents
103- + segment->p_offset);
104- Elf32_Addr size = segment->p_filesz;
105+ + read32(segment->p_offset, be));
106+ Elf32_Addr size = read32(segment->p_filesz, be);
107
108- while (abi_note [0] != 4 || abi_note [1] != 16
109- || abi_note [2] != 1
110+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
111+ || read32(abi_note [2], be) != 1
112 || memcmp (abi_note + 3, "GNU", 4) != 0)
113 {
114-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
115- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
116- + ROUND (abi_note[0])
117- + ROUND (abi_note[1]);
118+#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
119+ Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
120+ + ROUND (read32(abi_note[0], be))
121+ + ROUND (read32(abi_note[1], be));
122
123 if (size - 32 < note_size || note_size == 0)
124 {
125@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
126 if (size == 0)
127 break;
128
129- *osversion = (abi_note [4] << 24) |
130- ((abi_note [5] & 0xff) << 16) |
131- ((abi_note [6] & 0xff) << 8) |
132- (abi_note [7] & 0xff);
133+ *osversion = (read32(abi_note [4], be) << 24) |
134+ ((read32(abi_note [5], be) & 0xff) << 16) |
135+ ((read32(abi_note [6], be) & 0xff) << 8) |
136+ (read32(abi_note [7], be) & 0xff);
137 }
138 break;
139
140@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
141
142 /* Find the string table. */
143 dynamic_strings = NULL;
144- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
145+ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
146 ++dyn_entry)
147 {
148 check_ptr (dyn_entry);
149- if (dyn_entry->d_tag == DT_STRTAB)
150+ if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
151 {
152- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
153+ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
154 check_ptr (dynamic_strings);
155 break;
156 }
157@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
158 return 1;
159
160 /* Now read the DT_NEEDED and DT_SONAME entries. */
161- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
162+ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
163 ++dyn_entry)
164 {
165- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
166+ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
167 {
168- char *name = dynamic_strings + dyn_entry->d_un.d_val;
169+ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
170 check_ptr (name);
171
172- if (dyn_entry->d_tag == DT_NEEDED)
173+ if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
174 {
175
176 if (*flag == FLAG_ELF)
177@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
178 }
179 }
180
181- else if (dyn_entry->d_tag == DT_SONAME)
182+ else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
183 *soname = xstrdup (name);
184
185 /* Do we have everything we need? */
186@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
187 elf_header = (Elf64_Ehdr *) file_contents;
188 *osversion = 0;
189
190- if (elf_header->e_type != ET_DYN)
191+ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
192+
193+ if (read16(elf_header->e_type, be) != ET_DYN)
194 {
195 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
196- elf_header->e_type);
197+ read16(elf_header->e_type, be));
198 return 1;
199 }
200
201 /* Get information from elf program header. */
202- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
203+ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
204 check_ptr (elf_pheader);
205
206 /* The library is an elf library, now search for soname and
207@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
208 dynamic_size = 0;
209 program_interpreter = NULL;
210 for (i = 0, segment = elf_pheader;
211- i < elf_header->e_phnum; i++, segment++)
212+ i < read16(elf_header->e_phnum, be); i++, segment++)
213 {
214 check_ptr (segment);
215
216- switch (segment->p_type)
217+ switch (read32(segment->p_type, be))
218 {
219 case PT_LOAD:
220 if (loadaddr == (Elf64_Addr) -1)
221- loadaddr = segment->p_vaddr - segment->p_offset;
222+ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
223 break;
224
225 case PT_DYNAMIC:
226 if (dynamic_addr)
227 error (0, 0, _("more than one dynamic segment\n"));
228
229- dynamic_addr = segment->p_offset;
230- dynamic_size = segment->p_filesz;
231+ dynamic_addr = read64(segment->p_offset, be);
232+ dynamic_size = read32(segment->p_filesz, be);
233 break;
234
235 case PT_INTERP:
236- program_interpreter = (char *) (file_contents + segment->p_offset);
237+ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
238 check_ptr (program_interpreter);
239
240 /* Check if this is enough to classify the binary. */
241@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
242 break;
243
244 case PT_NOTE:
245- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
246+ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
247 {
248 Elf64_Word *abi_note = (Elf64_Word *) (file_contents
249- + segment->p_offset);
250- Elf64_Addr size = segment->p_filesz;
251+ + read64(segment->p_offset, be));
252+ Elf64_Addr size = read32(segment->p_filesz, be);
253
254- while (abi_note [0] != 4 || abi_note [1] != 16
255- || abi_note [2] != 1
256+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
257+ || read32(abi_note [2], be) != 1
258 || memcmp (abi_note + 3, "GNU", 4) != 0)
259 {
260+#undef ROUND
261 #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
262 Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
263- + ROUND (abi_note[0])
264- + ROUND (abi_note[1]);
265+ + ROUND (read32(abi_note[0], be))
266+ + ROUND (read32(abi_note[1], be));
267
268 if (size - 32 < note_size || note_size == 0)
269 {
270@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
271 if (size == 0)
272 break;
273
274- *osversion = (abi_note [4] << 24) |
275- ((abi_note [5] & 0xff) << 16) |
276- ((abi_note [6] & 0xff) << 8) |
277- (abi_note [7] & 0xff);
278+ *osversion = (read32(abi_note [4], be) << 24) |
279+ ((read32(abi_note [5], be) & 0xff) << 16) |
280+ ((read32(abi_note [6], be) & 0xff) << 8) |
281+ (read32(abi_note [7], be) & 0xff);
282 }
283 break;
284
285@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
286
287 /* Find the string table. */
288 dynamic_strings = NULL;
289- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
290+ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
291 ++dyn_entry)
292 {
293 check_ptr (dyn_entry);
294- if (dyn_entry->d_tag == DT_STRTAB)
295+ if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
296 {
297- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
298+ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
299 check_ptr (dynamic_strings);
300 break;
301 }
302@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
303 return 1;
304
305 /* Now read the DT_NEEDED and DT_SONAME entries. */
306- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
307+ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
308 ++dyn_entry)
309 {
310- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
311+ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
312 {
313- char *name = dynamic_strings + dyn_entry->d_un.d_val;
314+ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
315 check_ptr (name);
316
317- if (dyn_entry->d_tag == DT_NEEDED)
318+ if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
319 {
320
321 if (*flag == FLAG_ELF)
322@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
323 }
324 }
325
326- else if (dyn_entry->d_tag == DT_SONAME)
327+ else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
328 *soname = xstrdup (name);
329
330 /* Do we have everything we need? */
331Index: ldconfig-native-2.12.1/readlib.c
332===================================================================
333--- ldconfig-native-2.12.1.orig/readlib.c
334+++ ldconfig-native-2.12.1/readlib.c
335@@ -169,7 +169,8 @@ process_file (const char *real_file_name
336 ret = 1;
337 }
338 /* Libraries have to be shared object files. */
339- else if (elf_header->e_type != ET_DYN)
340+ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
341+ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
342 ret = 1;
343 else if (process_elf_file (file_name, lib, flag, osversion, soname,
344 file_contents, statbuf.st_size))
345Index: ldconfig-native-2.12.1/cache.c
346===================================================================
347--- ldconfig-native-2.12.1.orig/cache.c
348+++ ldconfig-native-2.12.1/cache.c
349@@ -39,6 +39,29 @@
350 # define N_(msgid) msgid
351 #define _(msg) msg
352
353+extern int be;
354+
355+static uint16_t write16(uint16_t x, int be)
356+{
357+ if (be)
358+ return htobe16(x);
359+ return htole16(x);
360+}
361+
362+static uint32_t write32(uint32_t x, int be)
363+{
364+ if (be)
365+ return htobe32(x);
366+ return htole32(x);
367+}
368+
369+static uint64_t write64(uint64_t x, int be)
370+{
371+ if (be)
372+ return htobe64(x);
373+ return htole64(x);
374+}
375+
376 struct cache_entry
377 {
378 char *lib; /* Library name. */
379@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
380 /* Number of normal cache entries. */
381 int cache_entry_old_count = 0;
382
383- for (entry = entries; entry != NULL; entry = entry->next)
384+ if (be)
385+ printf("saving cache in big endian encoding\n");
386+ else
387+ printf("saving cache in little endian encoding\n");
388+
389+ for (entry = entries; entry != NULL; entry = entry->next)
390 {
391 /* Account the final NULs. */
392 total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
393@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
394 memset (file_entries, '\0', sizeof (struct cache_file));
395 memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
396
397- file_entries->nlibs = cache_entry_old_count;
398+ file_entries->nlibs = write32(cache_entry_old_count, be);
399 }
400
401 struct cache_file_new *file_entries_new = NULL;
402@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
403 memcpy (file_entries_new->version, CACHE_VERSION,
404 sizeof CACHE_VERSION - 1);
405
406- file_entries_new->nlibs = cache_entry_count;
407- file_entries_new->len_strings = total_strlen;
408+ file_entries_new->nlibs = write32(cache_entry_count, be);
409+ file_entries_new->len_strings = write32(total_strlen, be);
410 }
411
412 /* Pad for alignment of cache_file_new. */
413@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
414 /* First the library. */
415 if (opt_format != 2 && entry->hwcap == 0)
416 {
417- file_entries->libs[idx_old].flags = entry->flags;
418+ file_entries->libs[idx_old].flags = write32(entry->flags, be);
419 /* XXX: Actually we can optimize here and remove duplicates. */
420- file_entries->libs[idx_old].key = str_offset + pad;
421+ file_entries->libs[idx_old].key = write32(str_offset + pad, be);
422 }
423 if (opt_format != 0)
424 {
425@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
426 not doing so makes the code easier, the string table
427 always begins at the beginning of the the new cache
428 struct. */
429- file_entries_new->libs[idx_new].flags = entry->flags;
430- file_entries_new->libs[idx_new].osversion = entry->osversion;
431- file_entries_new->libs[idx_new].hwcap = entry->hwcap;
432- file_entries_new->libs[idx_new].key = str_offset;
433+ file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
434+ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
435+ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
436+ file_entries_new->libs[idx_new].key = write32(str_offset, be);
437 }
438
439 size_t len = strlen (entry->lib) + 1;
440@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
441 str_offset += len;
442 /* Then the path. */
443 if (opt_format != 2 && entry->hwcap == 0)
444- file_entries->libs[idx_old].value = str_offset + pad;
445+ file_entries->libs[idx_old].value = write32(str_offset + pad, be);
446 if (opt_format != 0)
447- file_entries_new->libs[idx_new].value = str_offset;
448+ file_entries_new->libs[idx_new].value = write32(str_offset, be);
449 len = strlen (entry->path) + 1;
450 str = mempcpy (str, entry->path, len);
451 str_offset += len;
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 0000000000..b148553055
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch
@@ -0,0 +1,22 @@
1The native version of ldconfig was using native definition of LD_SO (i.e.
2ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
3This was causing libc.so on the target marked as ELF lib rather than
4FLAG_ELF_LIBC6 in the ld.so.cache.
5
6Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
7
8Index: ldconfig-native-2.12.1/readlib.c
9===================================================================
10--- ldconfig-native-2.12.1.orig/readlib.c
11+++ ldconfig-native-2.12.1/readlib.c
12@@ -51,6 +51,10 @@ struct known_names
13 int flag;
14 };
15
16+/* don't use host's definition of LD_SO */
17+#undef LD_SO
18+#define LD_SO "ld.so.1"
19+
20 static struct known_names interpreters[] =
21 {
22 { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
new file mode 100644
index 0000000000..dc1e79888e
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
index d143a075f5..52ab64c0d6 100644
--- a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -8,11 +8,11 @@
8 xstrdup.c | 11 -- 8 xstrdup.c | 11 --
9 7 files changed, 45 insertions(+), 256 deletions(-) 9 7 files changed, 45 insertions(+), 256 deletions(-)
10 10
11Index: 1/cache.c 11Index: ldconfig-native-2.12.1/cache.c
12=================================================================== 12===================================================================
13--- 1.orig/cache.c 2007-11-23 17:05:44.000000000 +0000 13--- ldconfig-native-2.12.1.orig/cache.c
14+++ 1/cache.c 2007-11-23 17:05:56.000000000 +0000 14+++ ldconfig-native-2.12.1/cache.c
15@@ -15,6 +15,9 @@ 15@@ -16,6 +16,9 @@
16 along with this program; if not, write to the Free Software Foundation, 16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 18
@@ -22,7 +22,7 @@ Index: 1/cache.c
22 #include <errno.h> 22 #include <errno.h>
23 #include <error.h> 23 #include <error.h>
24 #include <dirent.h> 24 #include <dirent.h>
25@@ -29,8 +32,10 @@ 25@@ -31,8 +34,10 @@
26 #include <sys/stat.h> 26 #include <sys/stat.h>
27 #include <sys/types.h> 27 #include <sys/types.h>
28 28
@@ -35,20 +35,11 @@ Index: 1/cache.c
35 35
36 struct cache_entry 36 struct cache_entry
37 { 37 {
38@@ -230,8 +235,6 @@ init_cache (void) 38Index: ldconfig-native-2.12.1/chroot_canon.c
39 entries = NULL;
40 }
41
42-
43-
44 static
45 int compare (const struct cache_entry *e1, const struct cache_entry *e2)
46 {
47Index: 1/chroot_canon.c
48=================================================================== 39===================================================================
49--- 1.orig/chroot_canon.c 2007-11-23 17:05:44.000000000 +0000 40--- ldconfig-native-2.12.1.orig/chroot_canon.c
50+++ 1/chroot_canon.c 2007-11-23 17:05:56.000000000 +0000 41+++ ldconfig-native-2.12.1/chroot_canon.c
51@@ -16,6 +16,9 @@ 42@@ -17,6 +17,9 @@
52 along with this program; if not, write to the Free Software Foundation, 43 along with this program; if not, write to the Free Software Foundation,
53 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 44 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
54 45
@@ -58,7 +49,7 @@ Index: 1/chroot_canon.c
58 #include <stdlib.h> 49 #include <stdlib.h>
59 #include <string.h> 50 #include <string.h>
60 #include <unistd.h> 51 #include <unistd.h>
61@@ -26,7 +29,9 @@ 52@@ -27,7 +30,9 @@
62 #include <stddef.h> 53 #include <stddef.h>
63 #include <stdint.h> 54 #include <stdint.h>
64 55
@@ -69,11 +60,11 @@ Index: 1/chroot_canon.c
69 60
70 #ifndef PATH_MAX 61 #ifndef PATH_MAX
71 #define PATH_MAX 1024 62 #define PATH_MAX 1024
72Index: 1/dl-cache.c 63Index: ldconfig-native-2.12.1/dl-cache.c
73=================================================================== 64===================================================================
74--- 1.orig/dl-cache.c 2007-11-23 17:05:44.000000000 +0000 65--- ldconfig-native-2.12.1.orig/dl-cache.c
75+++ 1/dl-cache.c 2007-11-23 17:05:56.000000000 +0000 66+++ ldconfig-native-2.12.1/dl-cache.c
76@@ -19,12 +19,12 @@ 67@@ -20,12 +20,12 @@
77 68
78 #include <assert.h> 69 #include <assert.h>
79 #include <unistd.h> 70 #include <unistd.h>
@@ -88,7 +79,7 @@ Index: 1/dl-cache.c
88 79
89 #ifndef _DL_PLATFORMS_COUNT 80 #ifndef _DL_PLATFORMS_COUNT
90 # define _DL_PLATFORMS_COUNT 0 81 # define _DL_PLATFORMS_COUNT 0
91@@ -38,103 +38,7 @@ static size_t cachesize; 82@@ -39,103 +39,7 @@ static size_t cachesize;
92 /* 1 if cache_data + PTR points into the cache. */ 83 /* 1 if cache_data + PTR points into the cache. */
93 #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size) 84 #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
94 85
@@ -192,13 +183,15 @@ Index: 1/dl-cache.c
192 _dl_cache_libcmp (const char *p1, const char *p2) 183 _dl_cache_libcmp (const char *p1, const char *p2)
193 { 184 {
194 while (*p1 != '\0') 185 while (*p1 != '\0')
195@@ -173,139 +77,4 @@ _dl_cache_libcmp (const char *p1, const 186@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const
187 }
188 return *p1 - *p2;
196 } 189 }
197 190-
198 191-
199-/* Look up NAME in ld.so.cache and return the file name stored there, 192-/* Look up NAME in ld.so.cache and return the file name stored there,
200- or null if none is found. */ 193- or null if none is found. */
201 194-
202-const char * 195-const char *
203-internal_function 196-internal_function
204-_dl_load_cache_lookup (const char *name) 197-_dl_load_cache_lookup (const char *name)
@@ -210,7 +203,7 @@ Index: 1/dl-cache.c
210- const char *best; 203- const char *best;
211- 204-
212- /* Print a message if the loading of libs is traced. */ 205- /* Print a message if the loading of libs is traced. */
213- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)) 206- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
214- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE); 207- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
215- 208-
216- if (cache == NULL) 209- if (cache == NULL)
@@ -278,21 +271,19 @@ Index: 1/dl-cache.c
278- if (platform != (uint64_t) -1) 271- if (platform != (uint64_t) -1)
279- platform = 1ULL << platform; 272- platform = 1ULL << platform;
280- 273-
274-#define _DL_HWCAP_TLS_MASK (1LL << 63)
275- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
276- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
277-
281- /* Only accept hwcap if it's for the right platform. */ 278- /* Only accept hwcap if it's for the right platform. */
282-#ifdef USE_TLS
283-# define _DL_HWCAP_TLS_MASK (1LL << 63)
284-#else
285-# define _DL_HWCAP_TLS_MASK 0
286-#endif
287-#define HWCAP_CHECK \ 279-#define HWCAP_CHECK \
280- if (lib->hwcap & hwcap_exclude) \
281- continue; \
288- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \ 282- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \
289- continue; \ 283- continue; \
290- if (_DL_PLATFORMS_COUNT \ 284- if (_DL_PLATFORMS_COUNT \
291- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \ 285- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
292- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \ 286- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \
293- continue; \
294- if (lib->hwcap \
295- & ~(GLRO(dl_hwcap) | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK)) \
296- continue 287- continue
297- SEARCH_CACHE (cache_new); 288- SEARCH_CACHE (cache_new);
298- } 289- }
@@ -310,7 +301,7 @@ Index: 1/dl-cache.c
310- } 301- }
311- 302-
312- /* Print our result if wanted. */ 303- /* Print our result if wanted. */
313- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0) 304- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
314- && best != NULL) 305- && best != NULL)
315- _dl_debug_printf (" trying file=%s\n", best); 306- _dl_debug_printf (" trying file=%s\n", best);
316- 307-
@@ -332,10 +323,10 @@ Index: 1/dl-cache.c
332- } 323- }
333-} 324-}
334-#endif 325-#endif
335Index: 1/dl-cache.h 326Index: ldconfig-native-2.12.1/dl-cache.h
336=================================================================== 327===================================================================
337--- 1.orig/dl-cache.h 2007-11-23 17:05:44.000000000 +0000 328--- ldconfig-native-2.12.1.orig/dl-cache.h
338+++ 1/dl-cache.h 2007-11-23 17:05:56.000000000 +0000 329+++ ldconfig-native-2.12.1/dl-cache.h
339@@ -101,5 +101,4 @@ struct cache_file_new 330@@ -101,5 +101,4 @@ struct cache_file_new
340 (((addr) + __alignof__ (struct cache_file_new) -1) \ 331 (((addr) + __alignof__ (struct cache_file_new) -1) \
341 & (~(__alignof__ (struct cache_file_new) - 1))) 332 & (~(__alignof__ (struct cache_file_new) - 1)))
@@ -343,11 +334,11 @@ Index: 1/dl-cache.h
343-extern int _dl_cache_libcmp (const char *p1, const char *p2) 334-extern int _dl_cache_libcmp (const char *p1, const char *p2)
344- internal_function; 335- internal_function;
345+extern int _dl_cache_libcmp (const char *p1, const char *p2); 336+extern int _dl_cache_libcmp (const char *p1, const char *p2);
346Index: 1/ldconfig.c 337Index: ldconfig-native-2.12.1/ldconfig.c
347=================================================================== 338===================================================================
348--- 1.orig/ldconfig.c 2007-11-23 17:05:44.000000000 +0000 339--- ldconfig-native-2.12.1.orig/ldconfig.c
349+++ 1/ldconfig.c 2007-11-23 17:05:56.000000000 +0000 340+++ ldconfig-native-2.12.1/ldconfig.c
350@@ -15,6 +15,9 @@ 341@@ -16,6 +16,9 @@
351 along with this program; if not, write to the Free Software Foundation, 342 along with this program; if not, write to the Free Software Foundation,
352 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 343 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
353 344
@@ -357,7 +348,7 @@ Index: 1/ldconfig.c
357 #define PROCINFO_CLASS static 348 #define PROCINFO_CLASS static
358 #include <alloca.h> 349 #include <alloca.h>
359 #include <argp.h> 350 #include <argp.h>
360@@ -37,10 +40,20 @@ 351@@ -39,10 +42,20 @@
361 #include <glob.h> 352 #include <glob.h>
362 #include <libgen.h> 353 #include <libgen.h>
363 354
@@ -381,7 +372,7 @@ Index: 1/ldconfig.c
381 372
382 #ifdef _DL_FIRST_PLATFORM 373 #ifdef _DL_FIRST_PLATFORM
383 # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT) 374 # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
384@@ -53,7 +66,7 @@ 375@@ -55,7 +68,7 @@
385 #endif 376 #endif
386 377
387 /* Get libc version number. */ 378 /* Get libc version number. */
@@ -390,7 +381,7 @@ Index: 1/ldconfig.c
390 381
391 #define PACKAGE _libc_intl_domainname 382 #define PACKAGE _libc_intl_domainname
392 383
393@@ -143,8 +156,8 @@ static const struct argp_option options[ 384@@ -152,8 +165,8 @@ static const struct argp_option options[
394 { NULL, 0, NULL, 0, NULL, 0 } 385 { NULL, 0, NULL, 0, NULL, 0 }
395 }; 386 };
396 387
@@ -401,20 +392,36 @@ Index: 1/ldconfig.c
401 392
402 /* Short description of program. */ 393 /* Short description of program. */
403 static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings."); 394 static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
404@@ -281,7 +294,7 @@ parse_opt (int key, char *arg, struct ar 395@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
396 return 0;
397 }
398
399+#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
400 /* Print bug-reporting information in the help message. */
401 static char *
402 more_help (int key, const char *text, void *input)
403@@ -315,7 +329,7 @@ For bug reporting instructions, please s
405 static void 404 static void
406 print_version (FILE *stream, struct argp_state *state) 405 print_version (FILE *stream, struct argp_state *state)
407 { 406 {
408- fprintf (stream, "ldconfig (GNU %s) %s\n", PACKAGE, VERSION); 407- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
409+ fprintf (stream, "ldconfig (Hacked Poky Version)\n"); 408+ fprintf (stream, "ldconfig (Hacked Poky Version)\n");
410 fprintf (stream, gettext ("\ 409 fprintf (stream, gettext ("\
411 Copyright (C) %s Free Software Foundation, Inc.\n\ 410 Copyright (C) %s Free Software Foundation, Inc.\n\
412 This is free software; see the source for copying conditions. There is NO\n\ 411 This is free software; see the source for copying conditions. There is NO\n\
413Index: 1/readlib.c 412@@ -1233,6 +1247,7 @@ set_hwcap (void)
413 hwcap_mask = strtoul (mask, NULL, 0);
414 }
415
416+const char _libc_intl_domainname[] = "libc";
417
418 int
419 main (int argc, char **argv)
420Index: ldconfig-native-2.12.1/readlib.c
414=================================================================== 421===================================================================
415--- 1.orig/readlib.c 2007-11-23 17:05:44.000000000 +0000 422--- ldconfig-native-2.12.1.orig/readlib.c
416+++ 1/readlib.c 2007-11-23 17:05:56.000000000 +0000 423+++ ldconfig-native-2.12.1/readlib.c
417@@ -21,6 +21,9 @@ 424@@ -22,6 +22,9 @@
418 development version. Besides the simplification, it has also been 425 development version. Besides the simplification, it has also been
419 modified to read some other file formats. */ 426 modified to read some other file formats. */
420 427
@@ -424,7 +431,7 @@ Index: 1/readlib.c
424 #include <a.out.h> 431 #include <a.out.h>
425 #include <elf.h> 432 #include <elf.h>
426 #include <error.h> 433 #include <error.h>
427@@ -34,7 +37,9 @@ 434@@ -35,7 +38,9 @@
428 #include <sys/stat.h> 435 #include <sys/stat.h>
429 #include <gnu/lib-names.h> 436 #include <gnu/lib-names.h>
430 437
@@ -435,11 +442,11 @@ Index: 1/readlib.c
435 442
436 #define Elf32_CLASS ELFCLASS32 443 #define Elf32_CLASS ELFCLASS32
437 #define Elf64_CLASS ELFCLASS64 444 #define Elf64_CLASS ELFCLASS64
438Index: 1/xstrdup.c 445Index: ldconfig-native-2.12.1/xstrdup.c
439=================================================================== 446===================================================================
440--- 1.orig/xstrdup.c 2007-11-23 17:05:44.000000000 +0000 447--- ldconfig-native-2.12.1.orig/xstrdup.c
441+++ 1/xstrdup.c 2007-11-23 17:05:56.000000000 +0000 448+++ ldconfig-native-2.12.1/xstrdup.c
442@@ -15,15 +15,10 @@ 449@@ -16,15 +16,10 @@
443 along with this program; if not, write to the Free Software Foundation, 450 along with this program; if not, write to the Free Software Foundation,
444 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 451 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
445 452
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
new file mode 100644
index 0000000000..0312ca8833
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
@@ -0,0 +1,34 @@
1Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
2
3Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
4
5--- ldconfig-native-2.12.1.orig/ldconfig.c
6+++ ldconfig-native-2.12.1/ldconfig.c
7@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
8
9 const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
10 if (opt_chroot)
11- {
12- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
13- if (aux_cache_file == NULL)
14- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
15- _PATH_LDCONFIG_AUX_CACHE);
16- }
17+ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
18
19- if (! opt_ignore_aux_cache)
20+ if (! opt_ignore_aux_cache && aux_cache_file)
21 load_aux_cache (aux_cache_file);
22 else
23 init_aux_cache ();
24@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
25 if (opt_build_cache)
26 {
27 save_cache (cache_file);
28- save_aux_cache (aux_cache_file);
29+ if (aux_cache_file)
30+ save_aux_cache (aux_cache_file);
31 }
32
33 return 0;
34
diff --git a/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 0000000000..bacf9f8dc4
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb
@@ -0,0 +1,27 @@
1DESCRIPTION = "A standalone native ldconfig build"
2
3LICENSE = "GPLv2.1"
4
5LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
6
7SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
8 file://ldconfig.patch \
9 file://ldconfig_aux-cache_path_fix.patch \
10 file://32and64bit.patch \
11 file://endian-ness_handling.patch \
12 file://flag_fix.patch "
13
14PR = "r0"
15
16inherit native
17
18S = "${WORKDIR}/${PN}-${PV}"
19
20do_compile () {
21 $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig
22}
23
24do_install () {
25 install -d ${D}/${bindir}/
26 install ldconfig ${D}/${bindir}/
27}
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2 b/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2
deleted file mode 100644
index 693b35ced2..0000000000
--- a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2
+++ /dev/null
Binary files differ
diff --git a/meta/recipes-core/glibc/ldconfig-native_2.5.bb b/meta/recipes-core/glibc/ldconfig-native_2.5.bb
deleted file mode 100644
index 39c8ce35e5..0000000000
--- a/meta/recipes-core/glibc/ldconfig-native_2.5.bb
+++ /dev/null
@@ -1,24 +0,0 @@
1DESCRIPTION = "A standalone native ldconfig build"
2
3LICENSE = "GPLv2"
4
5LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=16;md5=8b3df71ec5b0feeeeab79025096aa92c"
6
7SRC_URI = "file://ldconfig-native-2.5.tar.bz2 \
8 file://ldconfig.patch;patch=1 \
9 file://32and64bit.patch;patch=1"
10
11PR = "r1"
12
13inherit native
14
15S = "${WORKDIR}/${PN}-${PV}"
16
17do_compile () {
18 $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig
19}
20
21do_install () {
22 install -d ${D}/${bindir}/
23 install ldconfig ${D}/${bindir}/
24}