Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 1 | From 2101fb718935c7cf1cc2ad201bdeb1e635b54b0a Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 11 May 2020 11:03:41 -0700 |
| 4 | Subject: [PATCH] Revert "[AArch64] Use __getauxval instead of getauxval in LSE |
| 5 | detection code in libgcc" |
| 6 | |
| 7 | This reverts commit 5a57016dd2758cc63a544f191f77635342397a72. |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | libgcc/config/aarch64/lse-init.c | 17 ++++++++--------- |
| 13 | 1 file changed, 8 insertions(+), 9 deletions(-) |
| 14 | |
| 15 | diff --git a/libgcc/config/aarch64/lse-init.c b/libgcc/config/aarch64/lse-init.c |
| 16 | index 00e9ab8cd1c..74acef25cce 100644 |
| 17 | --- a/libgcc/config/aarch64/lse-init.c |
| 18 | +++ b/libgcc/config/aarch64/lse-init.c |
| 19 | @@ -29,20 +29,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 20 | _Bool __aarch64_have_lse_atomics |
| 21 | __attribute__((visibility("hidden"), nocommon)); |
| 22 | |
| 23 | -/* Gate availability of __getauxval on glibc. All AArch64-supporting glibc |
| 24 | - versions support it. */ |
| 25 | -#ifdef __gnu_linux__ |
| 26 | +/* Disable initialization of __aarch64_have_lse_atomics during bootstrap. */ |
| 27 | +#if !defined(inhibit_libc) && defined(HAVE_SYS_AUXV_H) |
| 28 | +# include <sys/auxv.h> |
| 29 | |
| 30 | -# define AT_HWCAP 16 |
| 31 | -# define HWCAP_ATOMICS (1 << 8) |
| 32 | - |
| 33 | -unsigned long int __getauxval (unsigned long int); |
| 34 | +/* Disable initialization if the system headers are too old. */ |
| 35 | +# if defined(AT_HWCAP) && defined(HWCAP_ATOMICS) |
| 36 | |
| 37 | static void __attribute__((constructor)) |
| 38 | init_have_lse_atomics (void) |
| 39 | { |
| 40 | - unsigned long hwcap = __getauxval (AT_HWCAP); |
| 41 | + unsigned long hwcap = getauxval (AT_HWCAP); |
| 42 | __aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0; |
| 43 | } |
| 44 | |
| 45 | -#endif /* __gnu_linux__ */ |
| 46 | +# endif /* HWCAP */ |
| 47 | +#endif /* inhibit_libc */ |