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()