From b1e6b85764113bbc5d9727d8ee05b54b24f8ef41 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 28 May 2022 17:58:19 +0000 Subject: [PATCH] ndk-make.sh: only add fake libgcc.a if the real one is not found --- ndk-make.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ndk-make.sh b/ndk-make.sh index 3519260e8..a1fd541c9 100755 --- a/ndk-make.sh +++ b/ndk-make.sh @@ -93,7 +93,10 @@ fi # It is built against r22b NDK toolchains and still requires -lgcc instead of -lunwind used in newer r23 NDK. # See discussion at TMPLIB="$(mktemp -d)" -echo 'INPUT(-lunwind)' >"$TMPLIB/libgcc.a" +if test -z "$(find "$ANDROID_NDK_ROOT" -name libgcc.a -print -quit)"; then + # NDK is does not contain libgcc.a, add a linker script to fake it. + echo 'INPUT(-lunwind)' >"$TMPLIB/libgcc.a" +fi if test -z $1 || test $1 = armeabi-v7a; then echo "-- cross compiling to armv7-linux-androideabi (arm) --"