@@ -542,6 +542,9 @@ def __init__(self, name: str, ints: tuple[int, ...]):
542
542
def __repr__ (self ) -> str :
543
543
return f"<{ self .name } ({ '.' .join (str (v ) for v in self .ints )} )>"
544
544
545
+ ANDROID_ABI_EXTRA_LINK_OPTIONS = {
546
+ "arm64-v8a" : "-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384" ,
547
+ }
545
548
546
549
class Releaser :
547
550
def __init__ (self , release_info : dict , commit : str , revision : str , root : Path , dist_path : Path , section_printer : SectionPrinter , executer : Executer , cmake_generator : str , deps_path : Path , overwrite : bool , github : bool , fast : bool ):
@@ -1013,6 +1016,7 @@ def create_android_archives(self, android_api: int, android_home: Path, android_
1013
1016
android_devel_file_tree = ArchiveFileTree ()
1014
1017
1015
1018
for android_abi in android_abis :
1019
+ extra_link_options = ANDROID_ABI_EXTRA_LINK_OPTIONS .get (android_abi , "" )
1016
1020
with self .section_printer .group (f"Building for Android { android_api } { android_abi } " ):
1017
1021
build_dir = self .root / "build-android" / f"{ android_abi } -build"
1018
1022
install_dir = self .root / "install-android" / f"{ android_abi } -install"
@@ -1026,6 +1030,8 @@ def create_android_archives(self, android_api: int, android_home: Path, android_
1026
1030
# NDK 21e does not support -ffile-prefix-map
1027
1031
# f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
1028
1032
# f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
1033
+ f"-DCMAKE_EXE_LINKER_FLAGS={ extra_link_options } " ,
1034
+ f"-DCMAKE_SHARED_LINKER_FLAGS={ extra_link_options } " ,
1029
1035
f"-DCMAKE_TOOLCHAIN_FILE={ cmake_toolchain_file } " ,
1030
1036
f"-DCMAKE_PREFIX_PATH={ str (android_deps_path )} " ,
1031
1037
f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH" ,
0 commit comments