Skip to content

Commit 02714ab

Browse files
committed
Patch jscexecutor linking libs to fix the uncaught exceptions
1 parent 4507721 commit 02714ab

File tree

1 file changed

+12
-0
lines changed
  • ReactAndroid/src/main/java/com/facebook/react/jscexecutor

1 file changed

+12
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,21 @@ add_library(jscexecutor SHARED ${jscexecutor_SRC})
1313

1414
target_include_directories(jscexecutor PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
1515

16+
# explicitly link libgcc.a to prevent undefined `_Unwind_Resume` symbol and crash from throwing c++ exceptions even someone tries to catch the exceptions.
17+
# according to https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#unwinding,
18+
# we should put the unwinder between static libs and shared libs.
19+
#
20+
# 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)
21+
if(ANDROID_NDK_REVISION VERSION_LESS "23.0.0")
22+
set(LIB_UNWIND gcc)
23+
else()
24+
set(LIB_UNWIND)
25+
endif()
26+
1627
target_link_libraries(jscexecutor
1728
jsireact
1829
jscruntime
30+
${LIB_UNWIND}
1931
fb
2032
fbjni
2133
folly_runtime

0 commit comments

Comments
 (0)