[Android] Build with -mthumb when targetting armv7-a

Rafaël Carré git at videolan.org
Wed May 2 19:08:49 CEST 2012


android | branch: master | Rafaël Carré <funman at videolan.org> | Wed May  2 12:57:38 2012 -0400| [9c345b0b5e811d0e70abc859ccd503b575571408] | committer: Rafaël Carré

Build with -mthumb when targetting armv7-a

TODO: --enable-thumb for ffmpeg

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=9c345b0b5e811d0e70abc859ccd503b575571408
---

 compile.sh   |    6 ++++++
 configure.sh |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/compile.sh b/compile.sh
index aa45101..6cd51df 100755
--- a/compile.sh
+++ b/compile.sh
@@ -85,6 +85,12 @@ cd contrib/android
 
 # TODO: mpeg2, dts, theora
 
+if test -z "${NO_NEON}" -o -n "${TEGRA2}"; then
+    # assumes armv7-a
+    echo "EXTRA_CFLAGS += -mthumb" >> config.mak
+    echo "NOTHUMB := -marm" >> config.mak
+fi
+
 make fetch
 make
 
diff --git a/configure.sh b/configure.sh
index 3f48c50..7bf8b3f 100755
--- a/configure.sh
+++ b/configure.sh
@@ -14,12 +14,12 @@ LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"
 
 if [ -z "$NO_NEON" ]; then
     CXX_TARGET="armeabi-v7a"
-    CFLAGS="$CFLAGS -mfpu=neon -mcpu=cortex-a8"
+    CFLAGS="$CFLAGS -mfpu=neon -mcpu=cortex-a8 -mthumb"
     LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
     EXTRA_PARAMS=" --enable-neon"
 elif [ -n "$TEGRA2" ]; then
     CXX_TARGET="armeabi-v7a"
-    CFLAGS="$CFLAGS -mfpu=vfpv3-d16 -mcpu=cortex-a9"
+    CFLAGS="$CFLAGS -mfpu=vfpv3-d16 -mcpu=cortex-a9 -mthumb"
     EXTRA_PARAMS=" --disable-neon"
 else
     CXX_TARGET="armeabi"



More information about the Android mailing list