From c9e68e0d9c4eaf92df743bc2144166ccdc3efdf0 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 19 Jan 2017 03:58:44 +0100 Subject: [PATCH] Use -mthumb when building for arm --- build-package.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-package.sh b/build-package.sh index 0a05431b..f0f11903 100755 --- a/build-package.sh +++ b/build-package.sh @@ -462,10 +462,10 @@ termux_step_setup_toolchain() { # and no longer remove DT_RUNPATH in termux-elf-cleaner. if [ "$TERMUX_ARCH" = "arm" ]; then - CFLAGS+=" -march=armv7-a -mfpu=neon -mfloat-abi=softfp" - # "first flag instructs the linker to pick libgcc.a, libgcov.a, and - # crt*.o, which are tailored for armv7-a" - # - https://developer.android.com/ndk/guides/standalone_toolchain.html + # https://developer.android.com/ndk/guides/standalone_toolchain.html#abi_compatibility: + # "We recommend using the -mthumb compiler flag to force the generation of 16-bit Thumb-2 instructions". + # With r13 of the ndk ruby 2.4.0 segfaults when built on arm with clang without -mthumb. + CFLAGS+=" -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb" LDFLAGS+=" -march=armv7-a -Wl,--fix-cortex-a8" elif [ "$TERMUX_ARCH" = "i686" ]; then # From $NDK/docs/CPU-ARCH-ABIS.html: -- 2.11.0