Support Google Play 16 KB Page Size Requirement (#13470)

- See: https://developer.android.com/guide/practices/page-sizes#update-packaging
- Also, make min API uniform at 21 (from 16 and 23 in a few places)

Manual backport of dc2c83c383

(cherry picked from commit 4b2aa3f102)
This commit is contained in:
Anonymous Maarten
2025-08-07 17:32:16 +02:00
parent 28e9533d34
commit e321995244
3 changed files with 8 additions and 0 deletions

View File

@@ -88,6 +88,10 @@ ifeq ($(NDK_DEBUG),1)
cmd-strip :=
endif
# https://developer.android.com/guide/practices/page-sizes
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
LOCAL_LDFLAGS += "-Wl,-z,common-page-size=16384"
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)

View File

@@ -1275,6 +1275,9 @@ if(ANDROID)
set(HAVE_SDL_MISC TRUE)
endif()
# https://developer.android.com/guide/practices/page-sizes
list(APPEND EXTRA_LDFLAGS_BUILD "-Wl,-z,max-page-size=16384" "-Wl,-z,common-page-size=16384")
# SDL_spinlock.c Needs to be compiled in ARM mode.
# There seems to be no better way currently to set the ARM mode.
# see: https://issuetracker.google.com/issues/62264618

View File

@@ -40,6 +40,7 @@ macro(add_sdl_test_executable TARGET)
list(APPEND SDLTEST_TARGETS ${TARGET})
if(ANDROID)
add_library(${TARGET} SHARED ${AST_UNPARSED_ARGUMENTS})
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384")
else()
add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS})
endif()