From 430eef3bc1313885ec77610880b49784244bddcb Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 20 Aug 2017 11:36:38 +0200 Subject: [PATCH] Use -Oz instead of -Os for clang --- build-package.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-package.sh b/build-package.sh index 6d9ada3f3..d00515f6a 100755 --- a/build-package.sh +++ b/build-package.sh @@ -571,7 +571,12 @@ termux_step_setup_toolchain() { if [ -n "$TERMUX_DEBUG" ]; then CFLAGS+=" -g3 -O1 -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" else - CFLAGS+=" -Os" + if [ "$TERMUX_PKG_CLANG" = "no" ]; then + CFLAGS+=" -Os" + else + # -Oz seems good for clang, see https://github.com/android-ndk/ndk/issues/133 + CFLAGS+=" -Oz" + fi fi export CXXFLAGS="$CFLAGS"