summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch')
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch467
1 files changed, 467 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 0000000000..52ab64c0d6
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -0,0 +1,467 @@
1---
2 cache.c | 11 +-
3 chroot_canon.c | 7 +
4 dl-cache.c | 235 ---------------------------------------------------------
5 dl-cache.h | 3
6 ldconfig.c | 27 ++++--
7 readlib.c | 7 +
8 xstrdup.c | 11 --
9 7 files changed, 45 insertions(+), 256 deletions(-)
10
11Index: ldconfig-native-2.12.1/cache.c
12===================================================================
13--- ldconfig-native-2.12.1.orig/cache.c
14+++ ldconfig-native-2.12.1/cache.c
15@@ -16,6 +16,9 @@
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. */
18
19+#define _LARGEFILE64_SOURCE
20+#define _GNU_SOURCE
21+
22 #include <errno.h>
23 #include <error.h>
24 #include <dirent.h>
25@@ -31,8 +34,10 @@
26 #include <sys/stat.h>
27 #include <sys/types.h>
28
29-#include <ldconfig.h>
30-#include <dl-cache.h>
31+#include "ldconfig.h"
32+#include "dl-cache.h"
33+# define N_(msgid) msgid
34+#define _(msg) msg
35
36 struct cache_entry
37 {
38Index: ldconfig-native-2.12.1/chroot_canon.c
39===================================================================
40--- ldconfig-native-2.12.1.orig/chroot_canon.c
41+++ ldconfig-native-2.12.1/chroot_canon.c
42@@ -17,6 +17,9 @@
43 along with this program; if not, write to the Free Software Foundation,
44 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
45
46+#define _LARGEFILE64_SOURCE
47+#define _GNU_SOURCE
48+
49 #include <stdlib.h>
50 #include <string.h>
51 #include <unistd.h>
52@@ -27,7 +30,9 @@
53 #include <stddef.h>
54 #include <stdint.h>
55
56-#include <ldconfig.h>
57+#include "ldconfig.h"
58+
59+#define __set_errno(Val) errno = (Val)
60
61 #ifndef PATH_MAX
62 #define PATH_MAX 1024
63Index: ldconfig-native-2.12.1/dl-cache.c
64===================================================================
65--- ldconfig-native-2.12.1.orig/dl-cache.c
66+++ ldconfig-native-2.12.1/dl-cache.c
67@@ -20,12 +20,12 @@
68
69 #include <assert.h>
70 #include <unistd.h>
71-#include <ldsodefs.h>
72+//#include "ldsodefs.h"
73 #include <sys/mman.h>
74 #include <dl-cache.h>
75 #include <dl-procinfo.h>
76
77-#include <stdio-common/_itoa.h>
78+//#include "_itoa.h"
79
80 #ifndef _DL_PLATFORMS_COUNT
81 # define _DL_PLATFORMS_COUNT 0
82@@ -39,103 +39,7 @@ static size_t cachesize;
83 /* 1 if cache_data + PTR points into the cache. */
84 #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
85
86-#define SEARCH_CACHE(cache) \
87-/* We use binary search since the table is sorted in the cache file. \
88- The first matching entry in the table is returned. \
89- It is important to use the same algorithm as used while generating \
90- the cache file. */ \
91-do \
92- { \
93- left = 0; \
94- right = cache->nlibs - 1; \
95- \
96- while (left <= right) \
97- { \
98- __typeof__ (cache->libs[0].key) key; \
99- \
100- middle = (left + right) / 2; \
101- \
102- key = cache->libs[middle].key; \
103- \
104- /* Make sure string table indices are not bogus before using \
105- them. */ \
106- if (! _dl_cache_verify_ptr (key)) \
107- { \
108- cmpres = 1; \
109- break; \
110- } \
111- \
112- /* Actually compare the entry with the key. */ \
113- cmpres = _dl_cache_libcmp (name, cache_data + key); \
114- if (__builtin_expect (cmpres == 0, 0)) \
115- { \
116- /* Found it. LEFT now marks the last entry for which we \
117- know the name is correct. */ \
118- left = middle; \
119- \
120- /* There might be entries with this name before the one we \
121- found. So we have to find the beginning. */ \
122- while (middle > 0) \
123- { \
124- __typeof__ (cache->libs[0].key) key; \
125- \
126- key = cache->libs[middle - 1].key; \
127- /* Make sure string table indices are not bogus before \
128- using them. */ \
129- if (! _dl_cache_verify_ptr (key) \
130- /* Actually compare the entry. */ \
131- || _dl_cache_libcmp (name, cache_data + key) != 0) \
132- break; \
133- --middle; \
134- } \
135- \
136- do \
137- { \
138- int flags; \
139- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \
140- \
141- /* Only perform the name test if necessary. */ \
142- if (middle > left \
143- /* We haven't seen this string so far. Test whether the \
144- index is ok and whether the name matches. Otherwise \
145- we are done. */ \
146- && (! _dl_cache_verify_ptr (lib->key) \
147- || (_dl_cache_libcmp (name, cache_data + lib->key) \
148- != 0))) \
149- break; \
150- \
151- flags = lib->flags; \
152- if (_dl_cache_check_flags (flags) \
153- && _dl_cache_verify_ptr (lib->value)) \
154- { \
155- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \
156- { \
157- HWCAP_CHECK; \
158- best = cache_data + lib->value; \
159- \
160- if (flags == GLRO(dl_correct_cache_id)) \
161- /* We've found an exact match for the shared \
162- object and no general `ELF' release. Stop \
163- searching. */ \
164- break; \
165- } \
166- } \
167- } \
168- while (++middle <= right); \
169- break; \
170- } \
171- \
172- if (cmpres < 0) \
173- left = middle + 1; \
174- else \
175- right = middle - 1; \
176- } \
177- } \
178-while (0)
179-
180-
181 int
182-internal_function
183 _dl_cache_libcmp (const char *p1, const char *p2)
184 {
185 while (*p1 != '\0')
186@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const
187 }
188 return *p1 - *p2;
189 }
190-
191-
192-/* Look up NAME in ld.so.cache and return the file name stored there,
193- or null if none is found. */
194-
195-const char *
196-internal_function
197-_dl_load_cache_lookup (const char *name)
198-{
199- int left, right, middle;
200- int cmpres;
201- const char *cache_data;
202- uint32_t cache_data_size;
203- const char *best;
204-
205- /* Print a message if the loading of libs is traced. */
206- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
207- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
208-
209- if (cache == NULL)
210- {
211- /* Read the contents of the file. */
212- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
213- PROT_READ);
214-
215- /* We can handle three different cache file formats here:
216- - the old libc5/glibc2.0/2.1 format
217- - the old format with the new format in it
218- - only the new format
219- The following checks if the cache contains any of these formats. */
220- if (file != MAP_FAILED && cachesize > sizeof *cache
221- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
222- {
223- size_t offset;
224- /* Looks ok. */
225- cache = file;
226-
227- /* Check for new version. */
228- offset = ALIGN_CACHE (sizeof (struct cache_file)
229- + cache->nlibs * sizeof (struct file_entry));
230-
231- cache_new = (struct cache_file_new *) ((void *) cache + offset);
232- if (cachesize < (offset + sizeof (struct cache_file_new))
233- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
234- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
235- cache_new = (void *) -1;
236- }
237- else if (file != MAP_FAILED && cachesize > sizeof *cache_new
238- && memcmp (file, CACHEMAGIC_VERSION_NEW,
239- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
240- {
241- cache_new = file;
242- cache = file;
243- }
244- else
245- {
246- if (file != MAP_FAILED)
247- __munmap (file, cachesize);
248- cache = (void *) -1;
249- }
250-
251- assert (cache != NULL);
252- }
253-
254- if (cache == (void *) -1)
255- /* Previously looked for the cache file and didn't find it. */
256- return NULL;
257-
258- best = NULL;
259-
260- if (cache_new != (void *) -1)
261- {
262- uint64_t platform;
263-
264- /* This is where the strings start. */
265- cache_data = (const char *) cache_new;
266-
267- /* Now we can compute how large the string table is. */
268- cache_data_size = (const char *) cache + cachesize - cache_data;
269-
270- platform = _dl_string_platform (GLRO(dl_platform));
271- if (platform != (uint64_t) -1)
272- platform = 1ULL << platform;
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-
278- /* Only accept hwcap if it's for the right platform. */
279-#define HWCAP_CHECK \
280- if (lib->hwcap & hwcap_exclude) \
281- continue; \
282- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \
283- continue; \
284- if (_DL_PLATFORMS_COUNT \
285- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
286- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \
287- continue
288- SEARCH_CACHE (cache_new);
289- }
290- else
291- {
292- /* This is where the strings start. */
293- cache_data = (const char *) &cache->libs[cache->nlibs];
294-
295- /* Now we can compute how large the string table is. */
296- cache_data_size = (const char *) cache + cachesize - cache_data;
297-
298-#undef HWCAP_CHECK
299-#define HWCAP_CHECK do {} while (0)
300- SEARCH_CACHE (cache);
301- }
302-
303- /* Print our result if wanted. */
304- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
305- && best != NULL)
306- _dl_debug_printf (" trying file=%s\n", best);
307-
308- return best;
309-}
310-
311-#ifndef MAP_COPY
312-/* If the system does not support MAP_COPY we cannot leave the file open
313- all the time since this would create problems when the file is replaced.
314- Therefore we provide this function to close the file and open it again
315- once needed. */
316-void
317-_dl_unload_cache (void)
318-{
319- if (cache != NULL && cache != (struct cache_file *) -1)
320- {
321- __munmap (cache, cachesize);
322- cache = NULL;
323- }
324-}
325-#endif
326Index: ldconfig-native-2.12.1/dl-cache.h
327===================================================================
328--- ldconfig-native-2.12.1.orig/dl-cache.h
329+++ ldconfig-native-2.12.1/dl-cache.h
330@@ -101,5 +101,4 @@ struct cache_file_new
331 (((addr) + __alignof__ (struct cache_file_new) -1) \
332 & (~(__alignof__ (struct cache_file_new) - 1)))
333
334-extern int _dl_cache_libcmp (const char *p1, const char *p2)
335- internal_function;
336+extern int _dl_cache_libcmp (const char *p1, const char *p2);
337Index: ldconfig-native-2.12.1/ldconfig.c
338===================================================================
339--- ldconfig-native-2.12.1.orig/ldconfig.c
340+++ ldconfig-native-2.12.1/ldconfig.c
341@@ -16,6 +16,9 @@
342 along with this program; if not, write to the Free Software Foundation,
343 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
344
345+#define _LARGEFILE64_SOURCE
346+#define _GNU_SOURCE
347+
348 #define PROCINFO_CLASS static
349 #include <alloca.h>
350 #include <argp.h>
351@@ -39,10 +42,20 @@
352 #include <glob.h>
353 #include <libgen.h>
354
355-#include <ldconfig.h>
356-#include <dl-cache.h>
357+#include "ldconfig.h"
358+#include "dl-cache.h"
359+
360+#include "dl-procinfo.h"
361+
362+#include "argp.h"
363+
364+
365+#define SYSCONFDIR "/etc"
366+#define LIBDIR "/usr/lib"
367+#define SLIBDIR "/lib"
368+# define N_(msgid) msgid
369+#define _(msg) msg
370
371-#include <dl-procinfo.h>
372
373 #ifdef _DL_FIRST_PLATFORM
374 # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
375@@ -55,7 +68,7 @@
376 #endif
377
378 /* Get libc version number. */
379-#include <version.h>
380+#include "version.h"
381
382 #define PACKAGE _libc_intl_domainname
383
384@@ -152,8 +165,8 @@ static const struct argp_option options[
385 { NULL, 0, NULL, 0, NULL, 0 }
386 };
387
388-#define PROCINFO_CLASS static
389-#include <dl-procinfo.c>
390+//#define PROCINFO_CLASS static
391+//#include <dl-procinfo.c>
392
393 /* Short description of program. */
394 static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
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
404 static void
405 print_version (FILE *stream, struct argp_state *state)
406 {
407- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
408+ fprintf (stream, "ldconfig (Hacked Poky Version)\n");
409 fprintf (stream, gettext ("\
410 Copyright (C) %s Free Software Foundation, Inc.\n\
411 This is free software; see the source for copying conditions. There is NO\n\
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
421===================================================================
422--- ldconfig-native-2.12.1.orig/readlib.c
423+++ ldconfig-native-2.12.1/readlib.c
424@@ -22,6 +22,9 @@
425 development version. Besides the simplification, it has also been
426 modified to read some other file formats. */
427
428+#define _LARGEFILE64_SOURCE
429+#define _GNU_SOURCE
430+
431 #include <a.out.h>
432 #include <elf.h>
433 #include <error.h>
434@@ -35,7 +38,9 @@
435 #include <sys/stat.h>
436 #include <gnu/lib-names.h>
437
438-#include <ldconfig.h>
439+#include "ldconfig.h"
440+
441+#define _(msg) msg
442
443 #define Elf32_CLASS ELFCLASS32
444 #define Elf64_CLASS ELFCLASS64
445Index: ldconfig-native-2.12.1/xstrdup.c
446===================================================================
447--- ldconfig-native-2.12.1.orig/xstrdup.c
448+++ ldconfig-native-2.12.1/xstrdup.c
449@@ -16,15 +16,10 @@
450 along with this program; if not, write to the Free Software Foundation,
451 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
452
453-#ifdef HAVE_CONFIG_H
454-# include <config.h>
455-#endif
456+#define _GNU_SOURCE
457+
458+#include <string.h>
459
460-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
461-# include <string.h>
462-#else
463-# include <strings.h>
464-#endif
465 void *xmalloc (size_t n) __THROW;
466 char *xstrdup (char *string) __THROW;
467