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;
77
88// We have multiple ways to check that the function has SME, depending on our
99// target.
10- // * For Linux we can use __getauxval().
10+ // * For Linux/Glibc we can use getauxval().
11+ // * For Android we can use getauxval().
1112// * For newlib we can use __aarch64_sme_accessible().
1213
1314#if defined(__linux__ )
1415
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
1722#endif
23+ #include "../cpu_model/aarch64/hwcap.inc"
1824
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 ; }
2826
2927#else // defined(__linux__)
3028
You can’t perform that action at this time.
0 commit comments