[compiler-rt] [compiler-rt] Fixed Android 8.1 `getauxval(AT_PAGESZ)` crashes if called from `.preinit_array`. (#113427) (PR #116121)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 05:09:12 PST 2024
================
@@ -1219,17 +1213,11 @@ uptr GetPageSize() {
int rv = internal_sysctl(mib, 2, &pz, &pzl, nullptr, 0);
CHECK_EQ(rv, 0);
return (uptr)pz;
+# elif SANITIZER_ANDROID
+ // Using `getpagesize` because calling `getauxval` or `sysconf` from the
+ // `.preinit_array` can cause crashes on some older API levels.
+ return getpagesize();
----------------
funsafe-ptr wrote:
Oh ok, I only tested this on Android 8.1 using Termux, though.
https://github.com/llvm/llvm-project/pull/116121
More information about the llvm-commits
mailing list