From 19533bc90a95ce8567738180fc22c9ef976cc97e Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 6 May 2024 21:50:17 +0300 Subject: [PATCH] Use safe identical code folding on Android. --- CMake/TdSetUpCompiler.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMake/TdSetUpCompiler.cmake b/CMake/TdSetUpCompiler.cmake index 81cee4d21..ff5991cfb 100644 --- a/CMake/TdSetUpCompiler.cmake +++ b/CMake/TdSetUpCompiler.cmake @@ -62,6 +62,8 @@ function(td_set_up_compiler) set(TD_LINKER_FLAGS "-Wl,-z,ignore") elseif (EMSCRIPTEN) set(TD_LINKER_FLAGS "-Wl,--gc-sections") + elseif (ANDROID) + set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL -Wl,--icf=safe") else() set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL") endif()