mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-01 18:32:58 +02:00
llvm19: fix getauxval patch
aba3671006
accidentally used the wrong patch.
This commit is contained in:
parent
aba3671006
commit
0bdf8b3a55
1 changed files with 25 additions and 19 deletions
|
@ -1,45 +1,51 @@
|
||||||
__getauxval is a private symbol in musl, use the public getauxval function
|
From cd634f57c10dedbe4f908889dece2c4460b702c9 Mon Sep 17 00:00:00 2001
|
||||||
|
|
||||||
From 3d36920a76e992c9a723ca4d3bccee8d0bef3251 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Daniel Kiss <daniel.kiss@arm.com>
|
From: Daniel Kiss <daniel.kiss@arm.com>
|
||||||
Date: Mon, 12 Aug 2024 23:05:50 +0200
|
Date: Fri, 30 Aug 2024 08:51:08 +0200
|
||||||
Subject: [PATCH] [compiler-rt][AArch64][Android] Use getauxval on Android.
|
Subject: [PATCH] [compiler-rt][AArch64][Android] Use getauxval on Android.
|
||||||
|
(#102979)
|
||||||
|
|
||||||
__getauxval is a libgcc function that doesn't exist on Android.
|
__getauxval is a libgcc function that doesn't exist on Android.
|
||||||
|
Also on Linux let's use getauxval as it is anyway used other places in compiler-rt.
|
||||||
---
|
---
|
||||||
compiler-rt/lib/builtins/aarch64/sme-abi-init.c | 13 +++++++++----
|
.../lib/builtins/aarch64/sme-abi-init.c | 22 +++++++++----------
|
||||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
1 file changed, 10 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
diff --git a/compiler-rt/lib/builtins/aarch64/sme-abi-init.c b/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
|
diff --git a/compiler-rt/lib/builtins/aarch64/sme-abi-init.c b/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
|
||||||
index b6ee12170d56d..8b6715bd2254c 100644
|
index b6ee12170d56d..d3cd8278a5d21 100644
|
||||||
--- a/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
|
--- a/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
|
||||||
+++ b/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
|
+++ b/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
|
||||||
@@ -7,7 +7,8 @@ _Bool __aarch64_has_sme_and_tpidr2_el0;
|
@@ -7,24 +7,22 @@ _Bool __aarch64_has_sme_and_tpidr2_el0;
|
||||||
|
|
||||||
// We have multiple ways to check that the function has SME, depending on our
|
// We have multiple ways to check that the function has SME, depending on our
|
||||||
// target.
|
// target.
|
||||||
-// * For Linux we can use __getauxval().
|
-// * For Linux we can use __getauxval().
|
||||||
+// * For Linux/glibc we can use __getauxval().
|
+// * For Linux/Glibc we can use getauxval().
|
||||||
+// * For Android we can use getauxval().
|
+// * For Android we can use getauxval().
|
||||||
// * For newlib we can use __aarch64_sme_accessible().
|
// * For newlib we can use __aarch64_sme_accessible().
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
@@ -20,11 +21,15 @@ _Bool __aarch64_has_sme_and_tpidr2_el0;
|
|
||||||
#define HWCAP2_SME (1 << 23)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#ifdef __ANDROID__
|
-#ifndef AT_HWCAP2
|
||||||
+extern unsigned long int getauxval(unsigned long int);
|
-#define AT_HWCAP2 26
|
||||||
+#define GETAUXVAL(x) getauxval(x)
|
+#if defined(__ANDROID__)
|
||||||
|
+#include <sys/auxv.h>
|
||||||
|
+#elif __has_include(<sys/auxv.h>)
|
||||||
|
+#include <sys/auxv.h>
|
||||||
+#else
|
+#else
|
||||||
extern unsigned long int __getauxval (unsigned long int);
|
+#define getauxval(x) 0
|
||||||
+#define GETAUXVAL(x) __getauxval(x)
|
#endif
|
||||||
+#endif
|
+#include "../cpu_model/aarch64/hwcap.inc"
|
||||||
|
|
||||||
|
-#ifndef HWCAP2_SME
|
||||||
|
-#define HWCAP2_SME (1 << 23)
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
-extern unsigned long int __getauxval (unsigned long int);
|
||||||
|
-
|
||||||
-static _Bool has_sme(void) {
|
-static _Bool has_sme(void) {
|
||||||
- return __getauxval(AT_HWCAP2) & HWCAP2_SME;
|
- return __getauxval(AT_HWCAP2) & HWCAP2_SME;
|
||||||
-}
|
-}
|
||||||
+static _Bool has_sme(void) { return GETAUXVAL(AT_HWCAP2) & HWCAP2_SME; }
|
+static _Bool has_sme(void) { return getauxval(AT_HWCAP2) & HWCAP2_SME; }
|
||||||
|
|
||||||
#else // defined(__linux__)
|
#else // defined(__linux__)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue