From ac747fcde50e2707b85adbd1fc7b00fb9ffd98b3 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 18 Jul 2025 22:54:09 -0400 Subject: [PATCH] Add linker flag for compatibility with Android 15+ devices using 16KB memory pages --- stdlib/cmake/modules/AddSwiftStdlib.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake index 0b18957eadb31..5021409ba061e 100644 --- a/stdlib/cmake/modules/AddSwiftStdlib.cmake +++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake @@ -2504,6 +2504,8 @@ function(add_swift_target_library name) list(APPEND swiftlib_link_flags_all "-shared") # TODO: Instead of `lib${name}.so` find variable or target property which already have this value. list(APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name}.so") + # Ensure compatibility with Android 15+ devices using 16KB memory pages. + list(APPEND swiftlib_link_flags_all "-Wl,-z,max-page-size=16384") endif() if (SWIFTLIB_BACK_DEPLOYMENT_LIBRARY)