From ec940174bd2a787f7c2ccc18f6780ca5a8fabd28 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Thu, 14 Dec 2017 12:59:05 +0100 Subject: [PATCH] espeak: fix floating point exception on arm (#1925) * espeak: fix issue on arm (#1680) * ruby: move exception rule, build-package.sh -> build.sh --- build-package.sh | 10 ++-------- packages/espeak/build.sh | 6 ++++++ packages/ruby/build.sh | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/build-package.sh b/build-package.sh index a2588364..186facbf 100755 --- a/build-package.sh +++ b/build-package.sh @@ -574,14 +574,8 @@ termux_step_setup_toolchain() { if [ "$TERMUX_PKG_CLANG" = "no" ]; then CFLAGS+=" -Os" else - if [ "$TERMUX_PKG_NAME" = "ruby" -a "$TERMUX_ARCH" = arm ]; then - # This exception is to avoid a broken ruby on 32-bit arm - # with NDK r15c and ruby 2.4.2 - see #1520. - CFLAGS+=" -O1" - else - # -Oz seems good for clang, see https://github.com/android-ndk/ndk/issues/133 - CFLAGS+=" -Oz" - fi + # -Oz seems good for clang, see https://github.com/android-ndk/ndk/issues/133 + CFLAGS+=" -Oz" fi fi diff --git a/packages/espeak/build.sh b/packages/espeak/build.sh index f237db29..4e4fb53e 100644 --- a/packages/espeak/build.sh +++ b/packages/espeak/build.sh @@ -4,6 +4,7 @@ TERMUX_PKG_DESCRIPTION="Compact software speech synthesizer" # See https://github.com/espeak-ng/espeak-ng/issues/180 # about cross compilation of espeak-ng. TERMUX_PKG_VERSION=1.49.2 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=cf7ed86850b99bafe819548c73a6651a74300980dd15f319ff22e2bd72ea20b4 TERMUX_PKG_SRCURL=https://github.com/espeak-ng/espeak-ng/releases/download/${TERMUX_PKG_VERSION}/espeak-ng-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes @@ -26,6 +27,11 @@ termux_step_host_build() { make install } +termux_step_pre_configure() { + # Oz flag causes problems. See https://github.com/termux/termux-packages/issues/1680: + CFLAGS=${CFLAGS/Oz/O2} +} + termux_step_make() { # Prevent caching of host build: rm -Rf $TERMUX_PKG_HOSTBUILD_DIR diff --git a/packages/ruby/build.sh b/packages/ruby/build.sh index 4da90b72..190a7b74 100644 --- a/packages/ruby/build.sh +++ b/packages/ruby/build.sh @@ -18,6 +18,14 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" rb_cv_type_deprecated=x" # getresuid(2) does not work on ChromeOS - https://github.com/termux/termux-app/issues/147: # TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_getresuid=no" +termux_step_pre_configure() { + # This exception is to avoid a broken ruby on 32-bit arm + # with NDK r15c and ruby 2.4.2 - see #1520. + if [ "$TERMUX_ARCH" = arm ]; then + CFLAGS=${CFLAGS/Oz/O1} + fi +} + termux_step_make_install () { make install make uninstall # remove possible remains to get fresh timestamps -- 2.11.0