Bug 1400128 - Link thumb library of libc++ when using MOZ_THUMB=1 and NDK r11c. r?froydnj draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 15 Sep 2017 13:40:43 +0900
changeset 665213 4cbcb32c7ebe221a94eb2f534d8ca5da7eba1324
parent 665088 8e818b5e9b6bef0fc1a5c527ecf30b0d56a02f14
child 731695 072b001b375a975634acabb84de4ece8c18346fd
push id79973
push userbmo:m_kato@ga2.so-net.ne.jp
push dateFri, 15 Sep 2017 04:58:18 +0000
reviewersfroydnj
bugs1400128, 1
milestone57.0a1
Bug 1400128 - Link thumb library of libc++ when using MOZ_THUMB=1 and NDK r11c. r?froydnj cpu_arch_dir isn't absolute path, we cannot always detect thumb library for c++ library. Our build tool still uses NDK r11c, so we should check thumb library correctly. MozReview-Commit-ID: 912ZDNeUcKc
build/autoconf/android.m4
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -58,44 +58,48 @@ if test "$OS_TARGET" = "Android"; then
     AC_SUBST(ANDROID_CPU_ARCH)
 fi
 ])
 
 AC_DEFUN([MOZ_ANDROID_STLPORT],
 [
 
 if test "$OS_TARGET" = "Android"; then
-    cpu_arch_dir="$ANDROID_CPU_ARCH"
-    # 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"
             ndk_libs_include="$ndk_base/libs/$ANDROID_CPU_ARCH"
-            ndk_libs="$ndk_base/libs/$cpu_arch_dir"
+            # 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 "$ndk_libs_include/thumb"; then
+                ndk_libs="$ndk_libs_include/thumb"
+            else
+                ndk_libs="$ndk_libs_include"
+            fi
             ndk_include="$ndk_base/include"
 
             if ! test -e "$ndk_libs/libgnustl_static.a"; then
                 AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
             fi
 
             STLPORT_LIBS="-L$ndk_libs -lgnustl_static"
             STLPORT_CPPFLAGS="-I$ndk_include -I$ndk_include/backward -I$ndk_libs_include/include"
             ;;
         libc++)
             # android-ndk-r8b and later
             ndk_base="$android_ndk/sources/cxx-stl"
             cxx_base="$ndk_base/llvm-libc++"
-            cxx_libs="$cxx_base/libs/$cpu_arch_dir"
+            cxx_libs="$cxx_base/libs/$ANDROID_CPU_ARCH"
+            # 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 "$cxx_libs/thumb"; then
+                cxx_libs="$cxx_libs/thumb"
+            fi
             cxx_include="$cxx_base/libcxx/include"
             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