From ffe57097d1641ec678c78e90abe01427569f4269 Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Mon, 29 Jul 2019 16:45:26 +0300 Subject: [PATCH] build-package.sh: avoid linking with extra/unneeded libraries --- scripts/build/termux_step_setup_toolchain.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build/termux_step_setup_toolchain.sh b/scripts/build/termux_step_setup_toolchain.sh index 2bbf2fcf8..d716f7846 100644 --- a/scripts/build/termux_step_setup_toolchain.sh +++ b/scripts/build/termux_step_setup_toolchain.sh @@ -44,6 +44,9 @@ termux_step_setup_toolchain() { # Android 7 started to support DT_RUNPATH (but not DT_RPATH). LDFLAGS+=" -Wl,-rpath=$TERMUX_PREFIX/lib,--enable-new-dtags" + # Avoid linking extra (unneeded) libraries. + LDFLAGS+=" -Wl,--as-needed" + # Basic hardening. CFLAGS+=" -fstack-protector-strong" LDFLAGS+=" -Wl,-z,relro,-z,now"