[compiler-rt] [compiler-rt] Fixed Android 8.1 `getauxval(AT_PAGESZ)` crashes if called from `.preinit_array`. (#113427) (PR #116121)
Florian Mayer via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 01:13:26 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();
----------------
fmayer wrote:
I don't think that actually works.. that calls through to `getauxval` via `page_size`: https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/platform/bionic/page.h;l=26?q=page_size%20f:bionic&sq=&ss=android%2Fplatform%2Fsuperproject%2Fmain
https://github.com/llvm/llvm-project/pull/116121
More information about the llvm-commits
mailing list