Skip to content

Commit

Permalink
Patch jscexecutor linking libs to fix the uncaught exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Oct 19, 2022
1 parent 4507721 commit 02714ab
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@ add_library(jscexecutor SHARED ${jscexecutor_SRC})

target_include_directories(jscexecutor PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

# explicitly link libgcc.a to prevent undefined `_Unwind_Resume` symbol and crash from throwing c++ exceptions even someone tries to catch the exceptions.
# according to https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#unwinding,
# we should put the unwinder between static libs and shared libs.
#
# TODO: we don't need this patch anymore after upgrading to ndk r23 (AGP 7.3 default side-by-side ndk, or react-native 0.71)
if(ANDROID_NDK_REVISION VERSION_LESS "23.0.0")
set(LIB_UNWIND gcc)
else()
set(LIB_UNWIND)
endif()

target_link_libraries(jscexecutor
jsireact
jscruntime
${LIB_UNWIND}
fb
fbjni
folly_runtime
Expand Down

0 comments on commit 02714ab

Please sign in to comment.