mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Support 16 KB page sizes on Android (#81596)
Android 15+ requires that native libraries be compiled with a linker flag to support 16 KB page sizes. See: https://developer.android.com/guide/practices/page-sizes#compile-r26-lower
This commit is contained in:
committed by
Finagolfin
parent
5cc6f245d0
commit
7f09af24cf
@@ -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)
|
||||
|
||||
@@ -164,7 +164,8 @@ class AndroidPlatform(Platform):
|
||||
android_toolchain_path = self.ndk_toolchain_path(args)
|
||||
|
||||
flags += '-sdk %s/sysroot ' % (android_toolchain_path)
|
||||
flags += '-tools-directory %s/bin' % (android_toolchain_path)
|
||||
flags += '-tools-directory %s/bin ' % (android_toolchain_path)
|
||||
flags += '-Xclang-linker -Wl,-z,max-page-size=16384'
|
||||
return flags
|
||||
|
||||
def cmake_options(self, args):
|
||||
|
||||
Reference in New Issue
Block a user