Upgrade android build (and infrastructure) to use ndk r15.

Bug: 6672
Change-Id: Ia6c6bae8a9adfd75172d7116487dfa63c3d69670
Reviewed-on: https://skia-review.googlesource.com/20904
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 96da677..fdd50b1 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -167,10 +167,10 @@
       "-mthumb",
     ]
   } else if (current_cpu == "mipsel") {
-    cflags += [
-      "-no-integrated-as",  # Clang <4.0 doesn't understand 'usw' mnemonic.
-      "-march=mips32r2",
-    ]
+    cflags += [ "-march=mips32r2" ]
+  } else if (current_cpu == "mips64el") {
+    asmflags += [ "-integrated-as" ]
+    cflags += [ "-integrated-as" ]
   } else if (current_cpu == "x86" && !is_win) {
     asmflags += [ "-m32" ]
     cflags += [
@@ -192,14 +192,12 @@
   }
 
   if (is_android) {
-    asmflags += [
-      "--target=$ndk_target",
-      "-B$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin",
-    ]
+    asmflags += [ "--target=$ndk_target" ]
     cflags += [
-      "--sysroot=$ndk/platforms/$ndk_platform",
+      "--sysroot=$ndk/sysroot",
+      "-isystem$ndk/sysroot/usr/include/$ndk_target",
+      "-D__ANDROID_API__=$ndk_api",
       "--target=$ndk_target",
-      "-B$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin",
     ]
     cflags_cc += [
       "-isystem$ndk/sources/android/support/include",
@@ -217,9 +215,8 @@
     ]
 
     if (current_cpu == "mips64el") {
-      # The r13 NDK omits /usr/lib from the MIPS64 sysroots, but Clang searches
-      # for /usr/lib64 as $PATH_TO_USR_LIB/../lib64.  If there's no /usr/lib,
-      # it can't find /usr/lib64.  We must point Clang at /usr/lib64 manually.
+      # The r15b NDK deployed on our bots fails to find /usr/lib64 in  the
+      # MIPS64 sysroots, so we must point Clang at /usr/lib64 manually.
       lib_dirs += [ "$ndk/platforms/$ndk_platform/usr/lib64" ]
       ldflags += [ "-B$ndk/platforms/$ndk_platform/usr/lib64" ]
     }
diff --git a/infra/bots/assets/android_ndk_darwin/VERSION b/infra/bots/assets/android_ndk_darwin/VERSION
index d8263ee..bf0d87a 100644
--- a/infra/bots/assets/android_ndk_darwin/VERSION
+++ b/infra/bots/assets/android_ndk_darwin/VERSION
@@ -1 +1 @@
-2
\ No newline at end of file
+4
\ No newline at end of file
diff --git a/infra/bots/assets/android_ndk_darwin/create.py b/infra/bots/assets/android_ndk_darwin/create.py
index cd427d3..1495e78 100755
--- a/infra/bots/assets/android_ndk_darwin/create.py
+++ b/infra/bots/assets/android_ndk_darwin/create.py
@@ -15,7 +15,7 @@
 import shutil
 import subprocess
 
-NDK_VER = "android-ndk-r14"
+NDK_VER = "android-ndk-r15b"
 NDK_URL = \
     "https://dl.google.com/android/repository/%s-darwin-x86_64.zip" % NDK_VER
 
diff --git a/infra/bots/assets/android_ndk_linux/VERSION b/infra/bots/assets/android_ndk_linux/VERSION
index c793025..9a03714 100644
--- a/infra/bots/assets/android_ndk_linux/VERSION
+++ b/infra/bots/assets/android_ndk_linux/VERSION
@@ -1 +1 @@
-7
\ No newline at end of file
+10
\ No newline at end of file
diff --git a/infra/bots/assets/android_ndk_linux/create.py b/infra/bots/assets/android_ndk_linux/create.py
index d785f48..79ab6d0 100755
--- a/infra/bots/assets/android_ndk_linux/create.py
+++ b/infra/bots/assets/android_ndk_linux/create.py
@@ -15,7 +15,7 @@
 import shutil
 import subprocess
 
-NDK_VER = "android-ndk-r14"
+NDK_VER = "android-ndk-r15b"
 NDK_URL = \
     "https://dl.google.com/android/repository/%s-linux-x86_64.zip" % NDK_VER
 
diff --git a/infra/bots/assets/android_ndk_windows/VERSION b/infra/bots/assets/android_ndk_windows/VERSION
index e440e5c..7813681 100644
--- a/infra/bots/assets/android_ndk_windows/VERSION
+++ b/infra/bots/assets/android_ndk_windows/VERSION
@@ -1 +1 @@
-3
\ No newline at end of file
+5
\ No newline at end of file
diff --git a/infra/bots/assets/android_ndk_windows/create.py b/infra/bots/assets/android_ndk_windows/create.py
index eb3cae5..063244b 100755
--- a/infra/bots/assets/android_ndk_windows/create.py
+++ b/infra/bots/assets/android_ndk_windows/create.py
@@ -15,7 +15,7 @@
 import shutil
 import subprocess
 
-NDK_VER = "android-ndk-r14"
+NDK_VER = "android-ndk-r15b"
 NDK_URL = \
     "https://dl.google.com/android/repository/%s-windows-x86_64.zip" % NDK_VER
 
diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json
index 80d9f52..056f8c8 100644
--- a/infra/bots/tasks.json
+++ b/infra/bots/tasks.json
@@ -2347,7 +2347,7 @@
         {
           "name": "skia/bots/android_ndk_darwin",
           "path": "android_ndk_darwin",
-          "version": "version:2"
+          "version": "version:4"
         }
       ],
       "dimensions": [
@@ -2530,7 +2530,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2600,7 +2600,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2670,7 +2670,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2700,7 +2700,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2730,7 +2730,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2760,7 +2760,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2790,7 +2790,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2820,7 +2820,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2850,7 +2850,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2880,7 +2880,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2910,7 +2910,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2940,7 +2940,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -2970,7 +2970,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -3000,7 +3000,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -3030,7 +3030,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -3060,7 +3060,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -3090,7 +3090,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -3751,7 +3751,7 @@
         {
           "name": "skia/bots/android_ndk_linux",
           "path": "android_ndk_linux",
-          "version": "version:7"
+          "version": "version:10"
         }
       ],
       "dimensions": [
@@ -3919,7 +3919,7 @@
         {
           "name": "skia/bots/android_ndk_windows",
           "path": "n",
-          "version": "version:3"
+          "version": "version:5"
         }
       ],
       "dimensions": [