File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
compiler-rt/lib/builtins/aarch64 Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -7,24 +7,22 @@ _Bool __aarch64_has_sme_and_tpidr2_el0;
7
7
8
8
// We have multiple ways to check that the function has SME, depending on our
9
9
// target.
10
- // * For Linux we can use __getauxval().
10
+ // * For Linux/Glibc we can use getauxval().
11
+ // * For Android we can use getauxval().
11
12
// * For newlib we can use __aarch64_sme_accessible().
12
13
13
14
#if defined(__linux__ )
14
15
15
- #ifndef AT_HWCAP2
16
- #define AT_HWCAP2 26
16
+ #if defined(__ANDROID__ )
17
+ #include <sys/auxv.h>
18
+ #elif __has_include (< sys /auxv .h > )
19
+ #include <sys/auxv.h>
20
+ #else
21
+ #define getauxval (x ) 0
17
22
#endif
23
+ #include "../cpu_model/aarch64/hwcap.inc"
18
24
19
- #ifndef HWCAP2_SME
20
- #define HWCAP2_SME (1 << 23)
21
- #endif
22
-
23
- extern unsigned long int __getauxval (unsigned long int );
24
-
25
- static _Bool has_sme (void ) {
26
- return __getauxval (AT_HWCAP2 ) & HWCAP2_SME ;
27
- }
25
+ static _Bool has_sme (void ) { return getauxval (AT_HWCAP2 ) & HWCAP2_SME ; }
28
26
29
27
#else // defined(__linux__)
30
28
You can’t perform that action at this time.
0 commit comments