From 0d1dde5fefae591ce00c4d798497820cc9d82ddf Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 18 Jan 2017 04:03:55 +0100 Subject: [PATCH] Try gold linker by default on aarch64 --- build-package.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build-package.sh b/build-package.sh index 162095ea9..d67f72a2b 100755 --- a/build-package.sh +++ b/build-package.sh @@ -207,7 +207,7 @@ termux_step_setup_variables() { TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_API_LEVEL}" # Bump the below version if a change is made in toolchain setup to ensure # that everyone gets an updated toolchain: - TERMUX_STANDALONE_TOOLCHAIN+="-v7" + TERMUX_STANDALONE_TOOLCHAIN+="-v8" export TERMUX_TAR="tar" export TERMUX_TOUCH="touch" @@ -471,8 +471,7 @@ termux_step_setup_toolchain() { # From $NDK/docs/CPU-ARCH-ABIS.html: CFLAGS+=" -march=i686 -msse3 -mstackrealign -mfpmath=sse" elif [ "$TERMUX_ARCH" = "aarch64" ]; then - LDFLAGS+=" -Wl,-rpath-link,$TERMUX_PREFIX/lib" - LDFLAGS+=" -Wl,-rpath-link,$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib" + : elif [ "$TERMUX_ARCH" = "x86_64" ]; then : else @@ -534,6 +533,10 @@ termux_step_setup_toolchain() { # Fix to allow e.g. to be included: cp $_TERMUX_TOOLCHAIN_TMPDIR/include/c++/4.9.x/arm-linux-androideabi/armv7-a/bits/* \ $_TERMUX_TOOLCHAIN_TMPDIR/include/c++/4.9.x/bits + elif [ "$TERMUX_ARCH" = "aarch64" ]; then + # Use gold by default to work around https://github.com/android-ndk/ndk/issues/148 + cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld.gold \ + $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld fi cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot