From 2b40367cf3f7250d681a3e2d228e18d48cbc87f7 Mon Sep 17 00:00:00 2001 From: hong19860320 <9973393+hong19860320@users.noreply.github.com> Date: Mon, 14 Sep 2020 16:24:22 +0800 Subject: [PATCH] [Core] Fix the exceptions handling for android+armv8+gcc (#4285) --- lite/api/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index 5be30b1ea5..fb8784cb20 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -70,6 +70,10 @@ else() set(TARGET_COMIPILE_FLAGS "-fdata-sections") if (NOT (ARM_TARGET_LANG STREQUAL "clang")) #gcc set(TARGET_COMIPILE_FLAGS "${TARGET_COMIPILE_FLAGS} -flto") + # TODO (hong19860320): Disable lto temporarily since it causes fail to catch the exceptions in android when toolchain is gcc. + if (ARM_TARGET_OS STREQUAL "android" AND LITE_WITH_EXCEPTION) + set(TARGET_COMIPILE_FLAGS "") + endif() endif() set_target_properties(paddle_light_api_shared PROPERTIES COMPILE_FLAGS "${TARGET_COMIPILE_FLAGS}") add_dependencies(paddle_light_api_shared op_list_h kernel_list_h fbs_headers) -- GitLab