[compiler-rt] 23fcca8 - [compiler-rt][builtins] Define AT_HWCAP2 for AArch64

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 07:28:41 PST 2023


Author: Xi Ruoyao
Date: 2023-03-08T16:26:57+01:00
New Revision: 23fcca822a3a3b9a14b6a1ad432814e2634cdb63

URL: https://github.com/llvm/llvm-project/commit/23fcca822a3a3b9a14b6a1ad432814e2634cdb63
DIFF: https://github.com/llvm/llvm-project/commit/23fcca822a3a3b9a14b6a1ad432814e2634cdb63.diff

LOG: [compiler-rt][builtins] Define AT_HWCAP2 for AArch64

Without the definition, build fails on AArch64 with

> error: 'AT_HWCAP2' undeclared (first use in this function);
> did you mean 'AT_HWCAP'?

with old Glibc versions.

Differential Revision: https://reviews.llvm.org/D145494

Added: 
    

Modified: 
    compiler-rt/lib/builtins/cpu_model.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/cpu_model.c b/compiler-rt/lib/builtins/cpu_model.c
index 4e3ce7af9926..01bab46aebac 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -924,6 +924,9 @@ int CONSTRUCTOR_ATTRIBUTE __cpu_indicator_init(void) {
 #define HWCAP_SB (1 << 29)
 #endif
 
+#ifndef AT_HWCAP2
+#define AT_HWCAP2 26
+#endif
 #ifndef HWCAP2_DCPODP
 #define HWCAP2_DCPODP (1 << 0)
 #endif


        


More information about the llvm-commits mailing list