summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-10.1/0038-Revert-AArch64-Use-__getauxval-instead-of-getauxval-.patch
blob: fc9228277a9bb71334bea8c8ac2fce2a5e840265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 2101fb718935c7cf1cc2ad201bdeb1e635b54b0a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 11 May 2020 11:03:41 -0700
Subject: [PATCH] Revert "[AArch64] Use __getauxval instead of getauxval in LSE
 detection code in libgcc"

This reverts commit 5a57016dd2758cc63a544f191f77635342397a72.

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 libgcc/config/aarch64/lse-init.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/libgcc/config/aarch64/lse-init.c b/libgcc/config/aarch64/lse-init.c
index 00e9ab8cd1c..74acef25cce 100644
--- a/libgcc/config/aarch64/lse-init.c
+++ b/libgcc/config/aarch64/lse-init.c
@@ -29,20 +29,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 _Bool __aarch64_have_lse_atomics
   __attribute__((visibility("hidden"), nocommon));
 
-/* Gate availability of __getauxval on glibc.  All AArch64-supporting glibc
-   versions support it.  */
-#ifdef __gnu_linux__
+/* Disable initialization of __aarch64_have_lse_atomics during bootstrap.  */
+#if !defined(inhibit_libc) && defined(HAVE_SYS_AUXV_H)
+# include <sys/auxv.h>
 
-# define AT_HWCAP	16
-# define HWCAP_ATOMICS	(1 << 8)
-
-unsigned long int __getauxval (unsigned long int);
+/* Disable initialization if the system headers are too old.  */
+# if defined(AT_HWCAP) && defined(HWCAP_ATOMICS)
 
 static void __attribute__((constructor))
 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;
 }
 
-#endif /* __gnu_linux__  */
+# endif /* HWCAP */
+#endif /* inhibit_libc */