[AArch64] Use __getauxval instead of getauxval in LSE detection code in libgcc
This version of the fix uses __getauxval instead of getauxval. The whole thing is guarded simply on __gnu_linux__. __getauxval was introduced in 2.16 but the aarch64 port was added in 2.17 so in practice I expect all aarch64 glibcs to support __getauxval. Bootstrapped and tested on aarch64-none-linux-gnu. Also tested on aarch64-none-elf. 2020-05-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/aarch64/lse-init.c (init_have_lse_atomics): Use __getauxval instead of getauxval. (AT_HWCAP): Define. (HWCAP_ATOMICS): Define. Guard detection on __gnu_linux__.
This commit is contained in:
parent
4e849a74a8
commit
1266778548
|
@ -1,3 +1,11 @@
|
||||||
|
2020-05-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||||
|
|
||||||
|
* config/aarch64/lse-init.c (init_have_lse_atomics): Use __getauxval
|
||||||
|
instead of getauxval.
|
||||||
|
(AT_HWCAP): Define.
|
||||||
|
(HWCAP_ATOMICS): Define.
|
||||||
|
Guard detection on __gnu_linux__.
|
||||||
|
|
||||||
2020-05-05 Michael Meissner <meissner@linux.ibm.com>
|
2020-05-05 Michael Meissner <meissner@linux.ibm.com>
|
||||||
|
|
||||||
* config.host: Delete changes meant for a private branch.
|
* config.host: Delete changes meant for a private branch.
|
||||||
|
|
|
@ -29,19 +29,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
_Bool __aarch64_have_lse_atomics
|
_Bool __aarch64_have_lse_atomics
|
||||||
__attribute__((visibility("hidden"), nocommon));
|
__attribute__((visibility("hidden"), nocommon));
|
||||||
|
|
||||||
/* Disable initialization of __aarch64_have_lse_atomics during bootstrap. */
|
/* Gate availability of __getauxval on glibc. All AArch64-supporting glibc
|
||||||
#if !defined(inhibit_libc) && defined(HAVE_SYS_AUXV_H)
|
versions support it. */
|
||||||
# include <sys/auxv.h>
|
#ifdef __gnu_linux__
|
||||||
|
|
||||||
/* Disable initialization if the system headers are too old. */
|
# define AT_HWCAP 16
|
||||||
# if defined(AT_HWCAP) && defined(HWCAP_ATOMICS)
|
# define HWCAP_ATOMICS (1 << 8)
|
||||||
|
|
||||||
|
unsigned long int __getauxval (unsigned long int);
|
||||||
|
|
||||||
static void __attribute__((constructor))
|
static void __attribute__((constructor))
|
||||||
init_have_lse_atomics (void)
|
init_have_lse_atomics (void)
|
||||||
{
|
{
|
||||||
unsigned long hwcap = getauxval (AT_HWCAP);
|
unsigned long hwcap = __getauxval (AT_HWCAP);
|
||||||
__aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0;
|
__aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* HWCAP */
|
#endif /* __gnu_linux__ */
|
||||||
#endif /* inhibit_libc */
|
|
||||||
|
|
Loading…
Reference in New Issue