From: Fredrik Fornwall Date: Sat, 16 Sep 2017 23:24:18 +0000 (+0200) Subject: ruby: Build with -Os instead of -Oz (see #1520) X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/commitdiff_plain/003833c2e5e39221c900b4383739cdfd780ddd3e ruby: Build with -Os instead of -Oz (see #1520) When building ruby with clang and -Oz it segmentation faults on 32-bit arm, so use -Os there instead. --- diff --git a/build-package.sh b/build-package.sh index 7487f4cd..0d7b6eb6 100755 --- a/build-package.sh +++ b/build-package.sh @@ -571,7 +571,9 @@ termux_step_setup_toolchain() { if [ -n "$TERMUX_DEBUG" ]; then CFLAGS+=" -g3 -O1 -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" else - if [ "$TERMUX_PKG_CLANG" = "no" ]; then + if [ "$TERMUX_PKG_CLANG" = "no" ] || [ "$TERMUX_PKG_NAME" = "ruby" -a "$TERMUX_ARCH" = arm ]; then + # The exception for "ruby" and arm exception is to avoid -Oz for ruby, which causes + # segmentation fault on 32-bit arm with NDK r15c and ruby 2.4.2 (#1520). CFLAGS+=" -Os" else # -Oz seems good for clang, see https://github.com/android-ndk/ndk/issues/133