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