x-load git: bump SRCREV
[openembedded.git] / recipes / glibc / glibc-2.3.2 / ldso-disable-hwcap.patch
blob5538d206728a49629dda7753027ddfad761ec916
1 --- glibc-2.3.2/sysdeps/generic/dl-sysdep.c.orig 2003-10-28 12:22:33.000000000 -0500
2 +++ glibc-2.3.2/sysdeps/generic/dl-sysdep.c 2003-10-28 12:38:49.000000000 -0500
3 @@ -354,7 +354,11 @@ _dl_important_hwcaps (const char *platfo
4 #ifdef USE_TLS
5 /* For TLS enabled builds always add 'tls'. */
6 ++cnt;
7 -#else
8 +#endif
10 + if (__access ("/etc/ld.so.nohwcap", F_OK) == 0)
11 + cnt = 0;
13 if (cnt == 0)
15 /* If we have platform name and no important capability we only have
16 @@ -369,7 +373,6 @@ _dl_important_hwcaps (const char *platfo
17 *sz = 1;
18 return result;
20 -#endif
22 /* Create temporary data structure to generate result table. */
23 temp = (struct r_strlenpair *) alloca (cnt * sizeof (*temp));
24 @@ -411,9 +414,7 @@ _dl_important_hwcaps (const char *platfo
25 result = (struct r_strlenpair *) malloc (*sz * sizeof (*result) + total);
26 if (result == NULL)
28 -#ifndef USE_TLS
29 no_memory:
30 -#endif
31 INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL,
32 N_("cannot create capability list"));
34 --- glibc-2.3.2/sysdeps/generic/dl-cache.c.orig 2003-10-28 12:32:36.000000000 -0500
35 +++ glibc-2.3.2/sysdeps/generic/dl-cache.c 2003-10-28 12:38:57.000000000 -0500
36 @@ -246,6 +246,7 @@ _dl_load_cache_lookup (const char *name)
37 /* This file ends in static libraries where we don't have a hwcap. */
38 unsigned long int *hwcap;
39 uint64_t platform;
40 + int disable_hwcap = 0;
41 #ifndef SHARED
42 weak_extern (_dl_hwcap);
43 #endif
44 @@ -261,6 +262,9 @@ _dl_load_cache_lookup (const char *name)
45 if (platform != (uint64_t) -1)
46 platform = 1ULL << platform;
48 + if (__access ("/etc/ld.so.nohwcap", F_OK) == 0)
49 + disable_hwcap = 1;
51 #ifdef USE_TLS
52 # define TLS_BIT (1ULL << 63)
53 #else
54 @@ -272,6 +276,8 @@ _dl_load_cache_lookup (const char *name)
55 if (GL(dl_osversion) \
56 && cache_new->libs[middle].osversion > GL(dl_osversion)) \
57 continue; \
58 + if (disable_hwcap && lib->hwcap != 0) \
59 + continue; \
60 if (_DL_PLATFORMS_COUNT && platform != -1 \
61 && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
62 && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \