1 # DP: Allow hwcap's to be disabled with the existence of a file. This
2 # DP: makes it easier to do upgrades with optimized (hwcap) library
4 # DP: Author: Rewritten by Daniel Jacobowitz <dan@debian.org>
5 # DP: Upstream status: Debian-Specific
6 # DP: Status Details: This isn't going to be acceptable upstream, we
7 # DP: only need it because we support in-place upgrades.
8 # DP: Date: 2003-10-28, (Updated 2005-01-02 gotom, 2007-05-20 aurel32)
11 elf/dl-cache.c | 10 ++++++++++
12 elf/dl-hwcaps.c | 20 ++++++++++++++++++++
13 sysdeps/alpha/ldsodefs.h | 2 ++
14 3 files changed, 32 insertions(+)
24 +#include <not-errno.h>
26 #include <dl-procinfo.h>
27 #include <dl-hwcaps.h>
29 /* For TLS enabled builds always add 'tls'. */
32 +#ifdef NEED_LD_SO_NOHWCAP
33 + if (__access_noerrno ("/etc/ld.so.nohwcap", F_OK) == 0)
35 + /* If hwcap is disabled, we only have the base directory to search. */
36 + result = (struct r_strlenpair *) malloc (sizeof (*result));
38 + _dl_signal_error (ENOMEM, NULL, NULL,
39 + N_("cannot create capability list"));
41 + result[0].str = (char *) result; /* Does not really matter. */
49 /* Create temporary data structure to generate result table. */
50 struct r_strlenpair temp[cnt];
56 #include <dl-hwcaps.h>
57 #include <dl-isa-level.h>
60 +#include <not-errno.h>
62 #ifndef _DL_PLATFORMS_COUNT
63 # define _DL_PLATFORMS_COUNT 0
66 uint32_t best_priority = 0;
68 + int disable_hwcap = 0;
69 +#ifdef NEED_LD_SO_NOHWCAP
70 + if (__access_noerrno ("/etc/ld.so.nohwcap", F_OK) == 0)
78 if ((libnew->hwcap & hwcap_exclude) && !named_hwcap)
80 + if (disable_hwcap && libnew->hwcap != 0)
82 if (_DL_PLATFORMS_COUNT
83 && (libnew->hwcap & _DL_HWCAP_PLATFORM) != 0
84 && ((libnew->hwcap & _DL_HWCAP_PLATFORM)
85 --- a/sysdeps/alpha/ldsodefs.h
86 +++ b/sysdeps/alpha/ldsodefs.h
88 struct La_alpha_retval *, \
91 +#define NEED_LD_SO_NOHWCAP
93 #include_next <ldsodefs.h>