Bug 1281786 - make Fennec compile with NDK r12; r=glandium
authorNathan Froyd <froydnj@gmail.com>
Tue, 28 Jun 2016 22:00:47 -0400
changeset 302989 08f48f6431b98185d5027667c6bbb57896a48e50
parent 302988 8186a2778f9d184852ee0a7fa369b602fab03111
child 302990 13fa965182841312da4b8be269d17c573ee557a7
push id30379
push usercbook@mozilla.com
push dateWed, 29 Jun 2016 14:13:35 +0000
treeherdermozilla-central@b69a5bbb5e40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1281786
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1281786 - make Fennec compile with NDK r12; r=glandium NDK r12 shuffled a few things around and changed how we need to link to libc++.
build/autoconf/android.m4
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -90,17 +90,19 @@ if test "$OS_TARGET" = "Android"; then
 fi
 ])
 
 AC_DEFUN([MOZ_ANDROID_STLPORT],
 [
 
 if test "$OS_TARGET" = "Android"; then
     cpu_arch_dir="$ANDROID_CPU_ARCH"
-    if test "$MOZ_THUMB2" = 1; then
+    # NDK r12 removed the arm/thumb library split and just made everything
+    # thumb by default.  Attempt to compensate.
+    if test "$MOZ_THUMB2" = 1 -a -d "$cpu_arch_dir/thumb"; then
         cpu_arch_dir="$cpu_arch_dir/thumb"
     fi
 
     if test -z "$STLPORT_CPPFLAGS$STLPORT_LIBS"; then
         case "$android_cxx_stl" in
         libstdc++)
             # android-ndk-r8b and later
             ndk_base="$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version"
@@ -124,16 +126,22 @@ if test "$OS_TARGET" = "Android"; then
             cxxabi_base="$ndk_base/llvm-libc++abi"
             cxxabi_include="$cxxabi_base/libcxxabi/include"
 
             if ! test -e "$cxx_libs/libc++_static.a"; then
                 AC_MSG_ERROR([Couldn't find path to llvm-libc++ in the android ndk])
             fi
 
             STLPORT_LIBS="-L$cxx_libs -lc++_static"
+            # NDK r12 split the libc++ runtime libraries into pieces.
+            for lib in c++abi unwind android_support; do
+                if test -e "$cxx_libs/lib${lib}.a"; then
+                     STLPORT_LIBS="$STLPORT_LIBS -l${lib}"
+                fi
+            done
             # Add android/support/include/ for prototyping long double math
             # functions, locale-specific C library functions, multibyte support,
             # etc.
             STLPORT_CPPFLAGS="-I$android_ndk/sources/android/support/include -I$cxx_include -I$cxxabi_include"
             ;;
         mozstlport)
             # We don't need to set STLPORT_LIBS, because the build system will
             # take care of linking in our home-built stlport where it is needed.