From 1b3610b81728229bd11587eba6893c728add18da Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Tue, 28 Jul 2026 16:35:20 +0100 Subject: [PATCH] Use 16K section alignment for Android builds --- source_common/compiler_helper.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source_common/compiler_helper.cmake b/source_common/compiler_helper.cmake index 054231d..ecc29af 100644 --- a/source_common/compiler_helper.cmake +++ b/source_common/compiler_helper.cmake @@ -76,4 +76,11 @@ macro(lgl_set_build_options BUILD_TARGET_NAME) CONFIG_LOG=$ CONFIG_OPTIMIZE_DISPATCH=$) + # Force 16KB section alignment for compatibility with modern Android devices + # See https://developer.android.com/guide/practices/page-sizes + target_link_options( + ${BUILD_TARGET_NAME} PRIVATE + $<$:-Wl,-z,max-page-size=16384> + $<$:-Wl,-z,common-page-size=16384>) + endmacro()