diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b9299dd54a0..68101d43d302 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2874,6 +2874,9 @@ if(TargetBin) else() add_executable(${TargetBin} ${NativeAppSource}) endif() + if(ANDROID AND ARM64) + target_link_options(${TargetBin} PRIVATE "-Wl,-z,max-page-size=16384") + endif() target_link_libraries(${TargetBin} ${LinkCommon} Common) endif() diff --git a/Common/MemoryUtil.cpp b/Common/MemoryUtil.cpp index 297290844ab1..be2a14ddbe08 100644 --- a/Common/MemoryUtil.cpp +++ b/Common/MemoryUtil.cpp @@ -352,7 +352,12 @@ int GetMemoryProtectPageSize() { if (sys_info.dwPageSize == 0) GetSystemInfo(&sys_info); return sys_info.dwPageSize; +#else + static int pageSize = 0; + if (!pageSize) { + pageSize = sysconf(_SC_PAGE_SIZE); + } + return pageSize; #endif - return MEM_PAGE_SIZE; } #endif // !PPSSPP_PLATFORM(SWITCH)