From 6486f6b637246e07fc04a163e78012342da4bd20 Mon Sep 17 00:00:00 2001 From: vkryl <6242627+vkryl@users.noreply.github.com> Date: Thu, 29 May 2025 23:15:49 +0300 Subject: Android: Enable 16 KB ELF alignment for `arm64-v8a` and `x86_64` platforms --- example/android/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'example') diff --git a/example/android/CMakeLists.txt b/example/android/CMakeLists.txt index 949a6e4b2..ee0e803a1 100644 --- a/example/android/CMakeLists.txt +++ b/example/android/CMakeLists.txt @@ -41,6 +41,11 @@ if (CMAKE_CROSSCOMPILING) endif() target_compile_definitions(tdjni PRIVATE PACKAGE_NAME="org/drinkless/tdlib") + if (${ANDROID_ABI} STREQUAL "arm64-v8a" OR ${ANDROID_ABI} STREQUAL "x86_64") + # Enable 16 KB ELF alignment. + target_link_options(tdjni PRIVATE "-Wl,-z,max-page-size=16384") + endif() + add_custom_command(TARGET tdjni POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename $ $.debug COMMAND ${CMAKE_STRIP} --strip-debug --strip-unneeded $.debug -o $) -- cgit v1.2.3