Skip to content

Commit

Permalink
Don't manually link libgcc in CMake.
Browse files Browse the repository at this point in the history
Doing this here causes libgcc to be linked ahead of the STL, which
breaks unwinding and therefore exception handling.

Test: ./run_tests.py
Bug: android/ndk#379
Change-Id: I63cbbdc125fdc3231a21f3354c1b1cfb129ac12b
  • Loading branch information
DanAlbert committed Aug 14, 2017
1 parent f7a80e3 commit 5eed718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/cmake/android.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ foreach(library ${ANDROID_STL_SHARED_LIBRARIES})
list(APPEND ANDROID_CXX_STANDARD_LIBRARIES
"${ANDROID_NDK}/sources/cxx-stl/${ANDROID_STL_PREFIX}/libs/${ANDROID_ABI}/lib${library}.so")
endforeach()
set(CMAKE_C_STANDARD_LIBRARIES_INIT "-lgcc -latomic -lm")
set(CMAKE_C_STANDARD_LIBRARIES_INIT "-latomic -lm")
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
if(ANDROID_CXX_STANDARD_LIBRARIES)
string(REPLACE ";" "\" \"" ANDROID_CXX_STANDARD_LIBRARIES "\"${ANDROID_CXX_STANDARD_LIBRARIES}\"")
Expand Down

0 comments on commit 5eed718

Please sign in to comment.