Android: NDK28 and later 16KB page size support for user projects

This patch amends 6f3a9c7a6c54010f601870dd31066f3500f6acd0

This amends it by adding linker options to newer NDK's than version
27. NDK 28 and later versions apparently build system shared
libraries (.so), like the ones for Qt for Android, with 16KB page
sizes by default, but leave Qt user projects to be configured
separately by the Qt application author.

This patch mitigates the need for Qt application authors to add
separate link options into their applications CMakeList.txt.

Task-number: QTBUG-131514
Task-number: QTBUG-134093
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Idddeb2bb8c519db7a3ec87eb5e50b9e2030e2815
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Rami Potinkara 2025-08-19 08:24:32 +03:00
parent adbb821bc7
commit 48dcf5cec1
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ function(qt_internal_setup_public_platform_target)
# in order to satisfy linker dependencies. Both of these libraries are part of # in order to satisfy linker dependencies. Both of these libraries are part of
# the NDK. # the NDK.
if (ANDROID) if (ANDROID)
if(QT_FEATURE_android_16kb_pages AND (CMAKE_ANDROID_NDK_VERSION VERSION_LESS "28.0.0")) if(QT_FEATURE_android_16kb_pages)
target_link_options(Platform INTERFACE "-Wl,-z,max-page-size=16384") target_link_options(Platform INTERFACE "-Wl,-z,max-page-size=16384")
endif() endif()
target_link_libraries(Platform INTERFACE log) target_link_libraries(Platform INTERFACE log)

View File

@ -1544,8 +1544,8 @@ qt_configure_add_report_entry(
) )
qt_configure_add_report_entry( qt_configure_add_report_entry(
TYPE NOTE TYPE NOTE
MESSAGE "Building Qt for Android with 16KB page sizes." MESSAGE "Building Qt for Android and user projects with 16KB page sizes."
CONDITION QT_FEATURE_android_16kb_pages AND (CMAKE_ANDROID_NDK_VERSION VERSION_LESS "28.0.0") CONDITION QT_FEATURE_android_16kb_pages
) )
if(WASM) if(WASM)
qt_extra_definition("QT_EMCC_VERSION" "\"${EMCC_VERSION}\"" PUBLIC) qt_extra_definition("QT_EMCC_VERSION" "\"${EMCC_VERSION}\"" PUBLIC)