diff --git a/srcpkgs/llvm19/patches/compiler-rt-getauxval-aarch64.patch b/srcpkgs/llvm19/patches/compiler-rt-getauxval-aarch64.patch new file mode 100644 index 00000000000..027c72e1cfd --- /dev/null +++ b/srcpkgs/llvm19/patches/compiler-rt-getauxval-aarch64.patch @@ -0,0 +1,46 @@ +__getauxval is a private symbol in musl, use the public getauxval function + +From 3d36920a76e992c9a723ca4d3bccee8d0bef3251 Mon Sep 17 00:00:00 2001 +From: Daniel Kiss +Date: Mon, 12 Aug 2024 23:05:50 +0200 +Subject: [PATCH] [compiler-rt][AArch64][Android] Use getauxval on Android. + +__getauxval is a libgcc function that doesn't exist on Android. +--- + compiler-rt/lib/builtins/aarch64/sme-abi-init.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +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 +--- a/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; + + // We have multiple ways to check that the function has SME, depending on our + // target. +-// * For Linux we can use __getauxval(). ++// * For Linux/glibc we can use __getauxval(). ++// * For Android we can use getauxval(). + // * For newlib we can use __aarch64_sme_accessible(). + + #if defined(__linux__) +@@ -20,11 +21,15 @@ _Bool __aarch64_has_sme_and_tpidr2_el0; + #define HWCAP2_SME (1 << 23) + #endif + ++#ifdef __ANDROID__ ++extern unsigned long int getauxval(unsigned long int); ++#define GETAUXVAL(x) getauxval(x) ++#else + extern unsigned long int __getauxval (unsigned long int); ++#define GETAUXVAL(x) __getauxval(x) ++#endif + +-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__) + + diff --git a/srcpkgs/llvm19/template b/srcpkgs/llvm19/template index 4100e416b6d..9d5f80d2682 100644 --- a/srcpkgs/llvm19/template +++ b/srcpkgs/llvm19/template @@ -1,7 +1,7 @@ # Template file for 'llvm19' pkgname=llvm19 version=19.1.4 -revision=2 +revision=3 build_wrksrc=llvm build_style=cmake _llvm_prefix=lib/llvm/19