[llvm-branch-commits] [compiler-rt] e0044a6 - [compiler-rt][builtins] Define AT_HWCAP2 for AArch64

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 9 20:39:06 PST 2023


Author: Xi Ruoyao
Date: 2023-03-09T06:53:51-08:00
New Revision: e0044a6993d4c68310f7ce9e2edaaf73fdb4b056

URL: https://github.com/llvm/llvm-project/commit/e0044a6993d4c68310f7ce9e2edaaf73fdb4b056
DIFF: https://github.com/llvm/llvm-project/commit/e0044a6993d4c68310f7ce9e2edaaf73fdb4b056.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

(cherry picked from commit 23fcca822a3a3b9a14b6a1ad432814e2634cdb63)

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 c5d7ae31afce2..f5ad530c7e886 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-branch-commits mailing list