# DP: Allow hwcap's to be disabled with the existence of a file. This
# DP: makes it easier to do upgrades with optimized (hwcap) library
# DP: packages.
# DP: Author: Rewritten by Daniel Jacobowitz <dan@debian.org>
# DP: Upstream status: Debian-Specific
# DP: Status Details: This isn't going to be acceptable upstream, we
# DP: only need it because we support in-place upgrades.
# DP: Date: 2003-10-28, (Updated 2005-01-02 gotom, 2007-05-20 aurel32)
# DP: Allow hwcap's to be disabled with the existence of a file. This
# DP: makes it easier to do upgrades with optimized (hwcap) library
# DP: packages.
# DP: Author: Rewritten by Daniel Jacobowitz <dan@debian.org>
# DP: Upstream status: Debian-Specific
# DP: Status Details: This isn't going to be acceptable upstream, we
# DP: only need it because we support in-place upgrades.
# DP: Date: 2003-10-28, (Updated 2005-01-02 gotom, 2007-05-20 aurel32)
Gbp-Pq: Topic any
Gbp-Pq: Name local-ldso-disable-hwcap.diff
#include <_itoa.h>
#include <dl-hwcaps.h>
#include <dl-isa-level.h>
+#include <fcntl.h>
+#include <sysdep.h>
+#include <not-errno.h>
#ifndef _DL_PLATFORMS_COUNT
# define _DL_PLATFORMS_COUNT 0
#ifdef SHARED
uint32_t best_priority = 0;
#endif
+ int disable_hwcap = 0;
+#ifdef NEED_LD_SO_NOHWCAP
+ if (__access_noerrno ("/etc/ld.so.nohwcap", F_OK) == 0)
+ disable_hwcap = 1;
+#endif
while (left <= right)
{
if (GLRO (dl_osversion)
&& libnew->osversion > GLRO (dl_osversion))
continue;
+ if (disable_hwcap && libnew->hwcap != 0)
+ continue;
if (_DL_PLATFORMS_COUNT
&& (libnew->hwcap & _DL_HWCAP_PLATFORM) != 0
&& ((libnew->hwcap & _DL_HWCAP_PLATFORM)
#include <libintl.h>
#include <unistd.h>
#include <ldsodefs.h>
+#include <fcntl.h>
+#include <sysdep.h>
+#include <not-errno.h>
#include <dl-procinfo.h>
#include <dl-hwcaps.h>
/* For TLS enabled builds always add 'tls'. */
++cnt;
+#ifdef NEED_LD_SO_NOHWCAP
+ if (__access_noerrno ("/etc/ld.so.nohwcap", F_OK) == 0)
+ {
+ /* If hwcap is disabled, we only have the base directory to search. */
+ result = (struct r_strlenpair *) malloc (sizeof (*result));
+ if (result == NULL)
+ _dl_signal_error (ENOMEM, NULL, NULL,
+ N_("cannot create capability list"));
+
+ result[0].str = (char *) result; /* Does not really matter. */
+ result[0].len = 0;
+
+ *sz = 1;
+ return result;
+ }
+#endif
+
/* Create temporary data structure to generate result table. */
struct r_strlenpair temp[cnt];
m = 0;
struct La_alpha_retval *, \
const char *);
+#define NEED_LD_SO_NOHWCAP
+
#include_next <ldsodefs.h>
#endif