mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Make LD_HWCAP_MASK usable for static binaries
The LD_HWCAP_MASK environment variable was ignored in static binaries, which is inconsistent with the behaviour of dynamically linked binaries. This seems to have been because of the inability of ld_hwcap_mask being read early enough to influence anything but now that it is in tunables, the mask is usable in static binaries as well. This feature is important for aarch64, which relies on HWCAP_CPUID being masked out to disable multiarch. A sanity test on x86_64 shows that there are no failures. Likewise for aarch64. * elf/dl-hwcaps.h [HAVE_TUNABLES]: Always read hwcap_mask. * sysdeps/sparc/sparc32/dl-machine.h [HAVE_TUNABLES]: Likewise. * sysdeps/x86/cpu-features.c (init_cpu_features): Always set up hwcap and hwcap_mask.
This commit is contained in:
@ -37,7 +37,7 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
|
||||
return 1;
|
||||
else if (ehdr->e_machine == EM_SPARC32PLUS)
|
||||
{
|
||||
#ifdef SHARED
|
||||
#if HAVE_TUNABLES || defined SHARED
|
||||
uint64_t hwcap_mask = GET_HWCAP_MASK();
|
||||
return GLRO(dl_hwcap) & hwcap_mask & HWCAP_SPARC_V9;
|
||||
#else
|
||||
|
Reference in New Issue
Block a user