Merge "Add empty `lib` folder."
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b754816..b5962a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,8 +34,22 @@
 [Unified Headers Migration Notes]: docs/UnifiedHeadersMigration.md
 [YASM in CMake]: https://android-dot-devsite.googleplex.com/ndk/guides/cmake.html#yasm-cmake
 
+r15c
+----
+
+ * Fixes for `_FILE_OFFSET_BITS=64` APIs. See
+   https://github.com/android-ndk/ndk/issues/459 and
+   https://github.com/android-ndk/ndk/issues/442.
+ * Fix termios.h APIs for old target APIs. See
+   https://github.com/android-ndk/ndk/issues/441.
+ * Added an inline for `ffs` to maintain compatibility with the deprecated
+   headers. See https://github.com/android-ndk/ndk/issues/439.
+ * Added legacy pthread API declarations for compatibility with old releases.
+   See https://github.com/android-ndk/ndk/issues/420 and
+   https://github.com/android-ndk/ndk/issues/423.
+
 r15b
-====
+----
 
  * Fix libsync header/library mismatch:
    https://issuetracker.google.com/62229958.
@@ -43,7 +57,7 @@
    other systems.
 
 APIs
-====
+----
 
  * Added native APIs for Android O. To learn more about these APIs, see the
    [Native APIs overview].
@@ -57,12 +71,12 @@
 [Shared Memory API]: https://developer.android.com/ndk/reference/sharedmem_8h.html
 
 NDK
-===
+---
 
  * `awk` is no longer in the NDK. We've replaced all uses of awk with Python.
 
 Clang
-=====
+-----
 
  * Clang has been updated to build 4053586. This is built from Clang 5.0 SVN at
    r300080.
@@ -70,7 +84,7 @@
    https://github.com/android-ndk/ndk/issues/9.
 
 libc++
-======
+------
 
  * We've begun slimming down and improving `libandroid_support` to fix libc++
    reliability issues. https://github.com/android-ndk/ndk/issues/300.
diff --git a/build/repo.prop b/build/repo.prop
index 0cdee67..b75f2cd 100644
--- a/build/repo.prop
+++ b/build/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/build/tools/make_standalone_toolchain.py b/build/tools/make_standalone_toolchain.py
index a32b188..b08712a 100755
--- a/build/tools/make_standalone_toolchain.py
+++ b/build/tools/make_standalone_toolchain.py
@@ -330,10 +330,12 @@
     return dst_libdir
 
 
-def copy_gnustl_libs(src_dir, dst_dir, triple, abi):
+def copy_gnustl_libs(src_dir, dst_dir, triple, abi, thumb=False):
     """Copy the gnustl libraries to the toolchain."""
     src_libdir = get_src_libdir(src_dir, abi)
     dst_libdir = get_dest_libdir(dst_dir, triple, abi)
+    if thumb:
+        dst_libdir = os.path.join(dst_libdir, 'thumb')
 
     logger().debug('Copying %s libs to %s', abi, dst_libdir)
 
@@ -350,10 +352,12 @@
                  os.path.join(dst_libdir, 'libstdc++.a'))
 
 
-def copy_stlport_libs(src_dir, dst_dir, triple, abi):
+def copy_stlport_libs(src_dir, dst_dir, triple, abi, thumb=False):
     """Copy the stlport libraries to the toolchain."""
     src_libdir = get_src_libdir(src_dir, abi)
     dst_libdir = get_dest_libdir(dst_dir, triple, abi)
+    if thumb:
+        dst_libdir = os.path.join(dst_libdir, 'thumb')
 
     if not os.path.exists(dst_libdir):
         os.makedirs(dst_libdir)
@@ -363,6 +367,36 @@
                  os.path.join(dst_libdir, 'libstdc++.a'))
 
 
+def copy_libcxx_libs(src_dir, dst_dir, include_libunwind):
+    shutil.copy2(os.path.join(src_dir, 'libc++_shared.so'), dst_dir)
+    shutil.copy2(os.path.join(src_dir, 'libc++_static.a'), dst_dir)
+    shutil.copy2(os.path.join(src_dir, 'libandroid_support.a'), dst_dir)
+    shutil.copy2(os.path.join(src_dir, 'libc++abi.a'), dst_dir)
+
+    if include_libunwind:
+        shutil.copy2(os.path.join(src_dir, 'libunwind.a'), dst_dir)
+
+    # libc++ is different from the other STLs. It has a libc++.(a|so) that is a
+    # linker script which automatically pulls in the necessary libraries. This
+    # way users don't have to do `-lc++abi -lunwind -landroid_support` on their
+    # own.
+    #
+    # As with the other STLs, we still copy this as libstdc++.a so the compiler
+    # will pick it up by default.
+    #
+    # Unlike the other STLs, also copy libc++.so (another linker script) over
+    # as libstdc++.so.  Since it's a linker script, the linker will still get
+    # the right DT_NEEDED from the SONAME of the actual linked object.
+    #
+    # TODO(danalbert): We should add linker scripts for the other STLs too
+    # since it lets the user avoid the current mess of having to always
+    # manually add `-lstlport_shared` (or whichever STL).
+    shutil.copy2(os.path.join(src_dir, 'libc++.a'),
+                 os.path.join(dst_dir, 'libstdc++.a'))
+    shutil.copy2(os.path.join(src_dir, 'libc++.so'),
+                 os.path.join(dst_dir, 'libstdc++.so'))
+
+
 def create_toolchain(install_path, arch, api, gcc_path, clang_path,
                      sysroot_path, stl, host_tag, unified_headers):
     """Create a standalone toolchain."""
@@ -425,6 +459,8 @@
             if arch == 'arm':
                 copy_gnustl_abi_headers(gnustl_dir, install_path, gcc_ver,
                                         triple, abi, thumb=True)
+                copy_gnustl_libs(gnustl_dir, install_path, triple, abi,
+                                 thumb=True)
     elif stl == 'libc++':
         libcxx_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/llvm-libc++')
         libcxxabi_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/llvm-libc++abi')
@@ -451,38 +487,11 @@
         for abi in get_abis(arch):
             src_libdir = get_src_libdir(libcxx_dir, abi)
             dest_libdir = get_dest_libdir(install_path, triple, abi)
-            shutil.copy2(os.path.join(src_libdir, 'libc++_shared.so'),
-                         dest_libdir)
-            shutil.copy2(os.path.join(src_libdir, 'libc++_static.a'),
-                         dest_libdir)
-            shutil.copy2(os.path.join(src_libdir, 'libandroid_support.a'),
-                         dest_libdir)
-            shutil.copy2(os.path.join(src_libdir, 'libc++abi.a'), dest_libdir)
-
+            include_libunwind = arch == 'arm'
+            copy_libcxx_libs(src_libdir, dest_libdir, include_libunwind)
             if arch == 'arm':
-                shutil.copy2(os.path.join(src_libdir, 'libunwind.a'),
-                             dest_libdir)
-
-            # libc++ is different from the other STLs. It has a libc++.(a|so)
-            # that is a linker script which automatically pulls in the
-            # necessary libraries. This way users don't have to do
-            # `-lc++abi -lunwind -landroid_support` on their own.
-            #
-            # As with the other STLs, we still copy this as libstdc++.a so the
-            # compiler will pick it up by default.
-            #
-            # Unlike the other STLs, also copy libc++.so (another linker
-            # script) over as libstdc++.so.  Since it's a linker script, the
-            # linker will still get the right DT_NEEDED from the SONAME of the
-            # actual linked object.
-            #
-            # TODO(danalbert): We should add linker scripts for the other STLs
-            # too since it lets the user avoid the current mess of having to
-            # always manually add `-lstlport_shared` (or whichever STL).
-            shutil.copy2(os.path.join(src_libdir, 'libc++.a'),
-                         os.path.join(dest_libdir, 'libstdc++.a'))
-            shutil.copy2(os.path.join(src_libdir, 'libc++.so'),
-                         os.path.join(dest_libdir, 'libstdc++.so'))
+                thumb_libdir = os.path.join(dest_libdir, 'thumb')
+                copy_libcxx_libs(src_libdir, thumb_libdir, include_libunwind)
     elif stl == 'stlport':
         stlport_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/stlport')
         gabixx_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/gabi++')
@@ -511,7 +520,8 @@
         for abi in get_abis(arch):
             copy_stlport_libs(stlport_dir, install_path, triple, abi)
             if arch == 'arm':
-                copy_stlport_libs(stlport_dir, install_path, triple, abi)
+                copy_stlport_libs(stlport_dir, install_path, triple, abi,
+                                  thumb=True)
     else:
         raise ValueError(stl)
 
diff --git a/platforms/android-12/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-12/arch-arm/usr/lib/crtbegin_dynamic.o
index f1b7445..0d9efb8 100644
--- a/platforms/android-12/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-12/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-12/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-12/arch-arm/usr/lib/crtbegin_static.o
index 7197560..2d34c7d 100644
--- a/platforms/android-12/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-12/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-12/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-12/arch-mips/usr/lib/crtbegin_dynamic.o
index 87b3344..6b34d01 100644
--- a/platforms/android-12/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-12/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-12/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-12/arch-mips/usr/lib/crtbegin_static.o
index 87b3344..6b34d01 100644
--- a/platforms/android-12/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-12/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-12/arch-mips/usr/lib/crtend_android.o b/platforms/android-12/arch-mips/usr/lib/crtend_android.o
index bfefdd6..b2f564e 100644
--- a/platforms/android-12/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-12/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-12/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-12/arch-mips/usr/libr6/crtbegin_dynamic.o
index cd98651..d3c444c 100644
--- a/platforms/android-12/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-12/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-12/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-12/arch-mips/usr/libr6/crtbegin_static.o
index cd98651..d3c444c 100644
--- a/platforms/android-12/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-12/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-12/arch-mips/usr/libr6/crtend_android.o b/platforms/android-12/arch-mips/usr/libr6/crtend_android.o
index 8ff427d..62a4881 100644
--- a/platforms/android-12/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-12/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-12/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-12/arch-x86/usr/lib/crtbegin_dynamic.o
index cafacca..756308b 100644
--- a/platforms/android-12/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-12/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-12/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-12/arch-x86/usr/lib/crtbegin_static.o
index cafacca..756308b 100644
--- a/platforms/android-12/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-12/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-13/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-13/arch-arm/usr/lib/crtbegin_dynamic.o
index a4fbd66..c99a697 100644
--- a/platforms/android-13/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-13/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-13/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-13/arch-arm/usr/lib/crtbegin_static.o
index fe6259a..0137a60 100644
--- a/platforms/android-13/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-13/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-13/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-13/arch-mips/usr/lib/crtbegin_dynamic.o
index d5b0d3b..a67de71 100644
--- a/platforms/android-13/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-13/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-13/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-13/arch-mips/usr/lib/crtbegin_static.o
index d5b0d3b..a67de71 100644
--- a/platforms/android-13/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-13/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-13/arch-mips/usr/lib/crtend_android.o b/platforms/android-13/arch-mips/usr/lib/crtend_android.o
index 38e60ca..62167ca 100644
--- a/platforms/android-13/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-13/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-13/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-13/arch-mips/usr/libr6/crtbegin_dynamic.o
index 518a83b..899996d 100644
--- a/platforms/android-13/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-13/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-13/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-13/arch-mips/usr/libr6/crtbegin_static.o
index 518a83b..899996d 100644
--- a/platforms/android-13/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-13/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-13/arch-mips/usr/libr6/crtend_android.o b/platforms/android-13/arch-mips/usr/libr6/crtend_android.o
index b3ddfb5..a15e432 100644
--- a/platforms/android-13/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-13/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-13/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-13/arch-x86/usr/lib/crtbegin_dynamic.o
index 9f4cb7d..08e98e9 100644
--- a/platforms/android-13/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-13/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-13/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-13/arch-x86/usr/lib/crtbegin_static.o
index 9f4cb7d..08e98e9 100644
--- a/platforms/android-13/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-13/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-14/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-14/arch-arm/usr/lib/crtbegin_dynamic.o
index d5b8125..8b51e6a 100644
--- a/platforms/android-14/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-14/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o
index 3d2e835..e9d2e00 100644
--- a/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-14/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-14/arch-mips/usr/lib/crtbegin_dynamic.o
index eca1163..a6a5f25 100644
--- a/platforms/android-14/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-14/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-14/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-14/arch-mips/usr/lib/crtbegin_static.o
index eca1163..a6a5f25 100644
--- a/platforms/android-14/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-14/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-14/arch-mips/usr/lib/crtend_android.o b/platforms/android-14/arch-mips/usr/lib/crtend_android.o
index a286b12..e99c247 100644
--- a/platforms/android-14/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-14/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-14/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-14/arch-mips/usr/libr6/crtbegin_dynamic.o
index ffad6a0..25d834c 100644
--- a/platforms/android-14/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-14/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-14/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-14/arch-mips/usr/libr6/crtbegin_static.o
index ffad6a0..25d834c 100644
--- a/platforms/android-14/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-14/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-14/arch-mips/usr/libr6/crtend_android.o b/platforms/android-14/arch-mips/usr/libr6/crtend_android.o
index 035ee10..e79b893 100644
--- a/platforms/android-14/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-14/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-14/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-14/arch-x86/usr/lib/crtbegin_dynamic.o
index 73430a3..8d07b02 100644
--- a/platforms/android-14/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-14/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-14/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-14/arch-x86/usr/lib/crtbegin_static.o
index 73430a3..8d07b02 100644
--- a/platforms/android-14/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-14/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-15/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-15/arch-arm/usr/lib/crtbegin_dynamic.o
index c5d8859..0f4c435 100644
--- a/platforms/android-15/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-15/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-15/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-15/arch-arm/usr/lib/crtbegin_static.o
index 580d98e..b777e83 100644
--- a/platforms/android-15/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-15/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-15/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-15/arch-mips/usr/lib/crtbegin_dynamic.o
index 04fa864..af3dda1 100644
--- a/platforms/android-15/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-15/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-15/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-15/arch-mips/usr/lib/crtbegin_static.o
index 04fa864..af3dda1 100644
--- a/platforms/android-15/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-15/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-15/arch-mips/usr/lib/crtend_android.o b/platforms/android-15/arch-mips/usr/lib/crtend_android.o
index 2b2c60b..e1b9954 100644
--- a/platforms/android-15/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-15/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-15/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-15/arch-mips/usr/libr6/crtbegin_dynamic.o
index 16f464d..559a17b 100644
--- a/platforms/android-15/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-15/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-15/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-15/arch-mips/usr/libr6/crtbegin_static.o
index 16f464d..559a17b 100644
--- a/platforms/android-15/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-15/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-15/arch-mips/usr/libr6/crtend_android.o b/platforms/android-15/arch-mips/usr/libr6/crtend_android.o
index 00763fd..3fe5434 100644
--- a/platforms/android-15/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-15/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-15/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-15/arch-x86/usr/lib/crtbegin_dynamic.o
index 75d3b5a..b61c098 100644
--- a/platforms/android-15/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-15/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-15/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-15/arch-x86/usr/lib/crtbegin_static.o
index 75d3b5a..b61c098 100644
--- a/platforms/android-15/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-15/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o
index 99dbd9f..106e9ce 100644
--- a/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-16/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-16/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-16/arch-arm/usr/lib/crtbegin_static.o
index 7a8c1fe..e50b34c 100644
--- a/platforms/android-16/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-16/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-16/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-16/arch-mips/usr/lib/crtbegin_dynamic.o
index d78e454..a6f2f71 100644
--- a/platforms/android-16/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-16/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-16/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-16/arch-mips/usr/lib/crtbegin_static.o
index d78e454..a6f2f71 100644
--- a/platforms/android-16/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-16/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-16/arch-mips/usr/lib/crtend_android.o b/platforms/android-16/arch-mips/usr/lib/crtend_android.o
index 56a1dce..0f6a764 100644
--- a/platforms/android-16/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-16/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-16/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-16/arch-mips/usr/libr6/crtbegin_dynamic.o
index fc03288..ddc53dd 100644
--- a/platforms/android-16/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-16/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-16/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-16/arch-mips/usr/libr6/crtbegin_static.o
index fc03288..ddc53dd 100644
--- a/platforms/android-16/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-16/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-16/arch-mips/usr/libr6/crtend_android.o b/platforms/android-16/arch-mips/usr/libr6/crtend_android.o
index 64dd003..70e1533 100644
--- a/platforms/android-16/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-16/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-16/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-16/arch-x86/usr/lib/crtbegin_dynamic.o
index d8520e0..996b767 100644
--- a/platforms/android-16/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-16/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-16/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-16/arch-x86/usr/lib/crtbegin_static.o
index d8520e0..996b767 100644
--- a/platforms/android-16/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-16/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-17/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-17/arch-arm/usr/lib/crtbegin_dynamic.o
index e797d06..39bcbe9 100644
--- a/platforms/android-17/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-17/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-17/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-17/arch-arm/usr/lib/crtbegin_static.o
index 6426410..2795e77 100644
--- a/platforms/android-17/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-17/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-17/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-17/arch-mips/usr/lib/crtbegin_dynamic.o
index 813e1ce..b19b400 100644
--- a/platforms/android-17/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-17/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-17/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-17/arch-mips/usr/lib/crtbegin_static.o
index 813e1ce..b19b400 100644
--- a/platforms/android-17/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-17/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-17/arch-mips/usr/lib/crtend_android.o b/platforms/android-17/arch-mips/usr/lib/crtend_android.o
index 5c80739..5da497d 100644
--- a/platforms/android-17/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-17/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-17/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-17/arch-mips/usr/libr6/crtbegin_dynamic.o
index e00303d..29e8001 100644
--- a/platforms/android-17/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-17/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-17/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-17/arch-mips/usr/libr6/crtbegin_static.o
index e00303d..29e8001 100644
--- a/platforms/android-17/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-17/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-17/arch-mips/usr/libr6/crtend_android.o b/platforms/android-17/arch-mips/usr/libr6/crtend_android.o
index 18792d0..bb36649 100644
--- a/platforms/android-17/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-17/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-17/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-17/arch-x86/usr/lib/crtbegin_dynamic.o
index e25f07b..f142d63 100644
--- a/platforms/android-17/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-17/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-17/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-17/arch-x86/usr/lib/crtbegin_static.o
index e25f07b..f142d63 100644
--- a/platforms/android-17/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-17/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-18/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-18/arch-arm/usr/lib/crtbegin_dynamic.o
index 632bd01..5460bb3 100644
--- a/platforms/android-18/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-18/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-18/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-18/arch-arm/usr/lib/crtbegin_static.o
index 47098f6..4f5b9fe 100644
--- a/platforms/android-18/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-18/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-18/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-18/arch-mips/usr/lib/crtbegin_dynamic.o
index 4969a44..799a761 100644
--- a/platforms/android-18/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-18/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-18/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-18/arch-mips/usr/lib/crtbegin_static.o
index 4969a44..799a761 100644
--- a/platforms/android-18/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-18/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-18/arch-mips/usr/lib/crtend_android.o b/platforms/android-18/arch-mips/usr/lib/crtend_android.o
index 634f448..e25bbc7 100644
--- a/platforms/android-18/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-18/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-18/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-18/arch-mips/usr/libr6/crtbegin_dynamic.o
index e1057eb..3460fc0 100644
--- a/platforms/android-18/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-18/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-18/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-18/arch-mips/usr/libr6/crtbegin_static.o
index e1057eb..3460fc0 100644
--- a/platforms/android-18/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-18/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-18/arch-mips/usr/libr6/crtend_android.o b/platforms/android-18/arch-mips/usr/libr6/crtend_android.o
index 832121a..e39aba8 100644
--- a/platforms/android-18/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-18/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-18/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-18/arch-x86/usr/lib/crtbegin_dynamic.o
index eea9467..87e6eee 100644
--- a/platforms/android-18/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-18/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-18/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-18/arch-x86/usr/lib/crtbegin_static.o
index eea9467..87e6eee 100644
--- a/platforms/android-18/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-18/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-19/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-19/arch-arm/usr/lib/crtbegin_dynamic.o
index cd2f008..2b3ecc1 100644
--- a/platforms/android-19/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-19/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-19/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-19/arch-arm/usr/lib/crtbegin_static.o
index 04a5def..ea94431 100644
--- a/platforms/android-19/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-19/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-19/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-19/arch-mips/usr/lib/crtbegin_dynamic.o
index 48fd7ae..49a23a6 100644
--- a/platforms/android-19/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-19/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-19/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-19/arch-mips/usr/lib/crtbegin_static.o
index 48fd7ae..49a23a6 100644
--- a/platforms/android-19/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-19/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-19/arch-mips/usr/lib/crtend_android.o b/platforms/android-19/arch-mips/usr/lib/crtend_android.o
index ceb783b..054f86a 100644
--- a/platforms/android-19/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-19/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-19/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-19/arch-mips/usr/libr6/crtbegin_dynamic.o
index c873b14..f6862e8 100644
--- a/platforms/android-19/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-19/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-19/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-19/arch-mips/usr/libr6/crtbegin_static.o
index c873b14..f6862e8 100644
--- a/platforms/android-19/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-19/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-19/arch-mips/usr/libr6/crtend_android.o b/platforms/android-19/arch-mips/usr/libr6/crtend_android.o
index 8c130fe..76f4174 100644
--- a/platforms/android-19/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-19/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-19/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-19/arch-x86/usr/lib/crtbegin_dynamic.o
index 6a16f98..4479b6b 100644
--- a/platforms/android-19/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-19/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-19/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-19/arch-x86/usr/lib/crtbegin_static.o
index 6a16f98..4479b6b 100644
--- a/platforms/android-19/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-19/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-21/arch-arm/usr/lib/crtbegin_dynamic.o
index db2a347..75fb4b3 100644
--- a/platforms/android-21/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-21/arch-arm/usr/lib/crtbegin_static.o
index db2a347..75fb4b3 100644
--- a/platforms/android-21/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-21/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-arm64/usr/lib/crtbegin_dynamic.o b/platforms/android-21/arch-arm64/usr/lib/crtbegin_dynamic.o
index 4a08002..7af5d10 100644
--- a/platforms/android-21/arch-arm64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-arm64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-arm64/usr/lib/crtbegin_static.o b/platforms/android-21/arch-arm64/usr/lib/crtbegin_static.o
index 4a08002..7af5d10 100644
--- a/platforms/android-21/arch-arm64/usr/lib/crtbegin_static.o
+++ b/platforms/android-21/arch-arm64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-21/arch-mips/usr/lib/crtbegin_dynamic.o
index 22a58cb..f1d0aad 100644
--- a/platforms/android-21/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-21/arch-mips/usr/lib/crtbegin_static.o
index 22a58cb..f1d0aad 100644
--- a/platforms/android-21/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-21/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-mips/usr/lib/crtend_android.o b/platforms/android-21/arch-mips/usr/lib/crtend_android.o
index e75a415..c107d0a 100644
--- a/platforms/android-21/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-21/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-21/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-21/arch-mips/usr/libr6/crtbegin_dynamic.o
index 46e8011..498013e 100644
--- a/platforms/android-21/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-21/arch-mips/usr/libr6/crtbegin_static.o
index 46e8011..498013e 100644
--- a/platforms/android-21/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-21/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-mips/usr/libr6/crtend_android.o b/platforms/android-21/arch-mips/usr/libr6/crtend_android.o
index 751cdb5..788967c 100644
--- a/platforms/android-21/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-21/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-21/arch-mips64/usr/lib64/crtbegin_dynamic.o b/platforms/android-21/arch-mips64/usr/lib64/crtbegin_dynamic.o
index c9c3bc2..e553b16 100644
--- a/platforms/android-21/arch-mips64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-mips64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-mips64/usr/lib64/crtbegin_static.o b/platforms/android-21/arch-mips64/usr/lib64/crtbegin_static.o
index c9c3bc2..e553b16 100644
--- a/platforms/android-21/arch-mips64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-21/arch-mips64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-mips64/usr/lib64/crtend_android.o b/platforms/android-21/arch-mips64/usr/lib64/crtend_android.o
index 8180889..c777381 100644
--- a/platforms/android-21/arch-mips64/usr/lib64/crtend_android.o
+++ b/platforms/android-21/arch-mips64/usr/lib64/crtend_android.o
Binary files differ
diff --git a/platforms/android-21/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-21/arch-x86/usr/lib/crtbegin_dynamic.o
index 95f027a..7a91917 100644
--- a/platforms/android-21/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-21/arch-x86/usr/lib/crtbegin_static.o
index 95f027a..7a91917 100644
--- a/platforms/android-21/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-21/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-x86_64/usr/lib/crtbegin_dynamic.o b/platforms/android-21/arch-x86_64/usr/lib/crtbegin_dynamic.o
index 95f027a..7a91917 100644
--- a/platforms/android-21/arch-x86_64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-x86_64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-x86_64/usr/lib/crtbegin_static.o b/platforms/android-21/arch-x86_64/usr/lib/crtbegin_static.o
index 95f027a..7a91917 100644
--- a/platforms/android-21/arch-x86_64/usr/lib/crtbegin_static.o
+++ b/platforms/android-21/arch-x86_64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_dynamic.o b/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_dynamic.o
index 86a0a0e..f19f4ed 100644
--- a/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_static.o b/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_static.o
index 86a0a0e..f19f4ed 100644
--- a/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-21/arch-x86_64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-22/arch-arm/usr/lib/crtbegin_dynamic.o
index 7cc2efe..e0de753 100644
--- a/platforms/android-22/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-22/arch-arm/usr/lib/crtbegin_static.o
index 7cc2efe..e0de753 100644
--- a/platforms/android-22/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-22/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-arm64/usr/lib/crtbegin_dynamic.o b/platforms/android-22/arch-arm64/usr/lib/crtbegin_dynamic.o
index f02544f..e774f6f 100644
--- a/platforms/android-22/arch-arm64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-arm64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-arm64/usr/lib/crtbegin_static.o b/platforms/android-22/arch-arm64/usr/lib/crtbegin_static.o
index f02544f..e774f6f 100644
--- a/platforms/android-22/arch-arm64/usr/lib/crtbegin_static.o
+++ b/platforms/android-22/arch-arm64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-22/arch-mips/usr/lib/crtbegin_dynamic.o
index 7b82816..caa733e 100644
--- a/platforms/android-22/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-22/arch-mips/usr/lib/crtbegin_static.o
index 7b82816..caa733e 100644
--- a/platforms/android-22/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-22/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-mips/usr/lib/crtend_android.o b/platforms/android-22/arch-mips/usr/lib/crtend_android.o
index 3799afb..b1e42f1 100644
--- a/platforms/android-22/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-22/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-22/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-22/arch-mips/usr/libr6/crtbegin_dynamic.o
index e3de372..20a4f02 100644
--- a/platforms/android-22/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-22/arch-mips/usr/libr6/crtbegin_static.o
index e3de372..20a4f02 100644
--- a/platforms/android-22/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-22/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-mips/usr/libr6/crtend_android.o b/platforms/android-22/arch-mips/usr/libr6/crtend_android.o
index 522fe44..116709f 100644
--- a/platforms/android-22/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-22/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-22/arch-mips64/usr/lib64/crtbegin_dynamic.o b/platforms/android-22/arch-mips64/usr/lib64/crtbegin_dynamic.o
index a339d48..7597d21 100644
--- a/platforms/android-22/arch-mips64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-mips64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-mips64/usr/lib64/crtbegin_static.o b/platforms/android-22/arch-mips64/usr/lib64/crtbegin_static.o
index a339d48..7597d21 100644
--- a/platforms/android-22/arch-mips64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-22/arch-mips64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-mips64/usr/lib64/crtend_android.o b/platforms/android-22/arch-mips64/usr/lib64/crtend_android.o
index 4f916c8..8e8918f 100644
--- a/platforms/android-22/arch-mips64/usr/lib64/crtend_android.o
+++ b/platforms/android-22/arch-mips64/usr/lib64/crtend_android.o
Binary files differ
diff --git a/platforms/android-22/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-22/arch-x86/usr/lib/crtbegin_dynamic.o
index 1aee8cc..794f210 100644
--- a/platforms/android-22/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-22/arch-x86/usr/lib/crtbegin_static.o
index 1aee8cc..794f210 100644
--- a/platforms/android-22/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-22/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-x86_64/usr/lib/crtbegin_dynamic.o b/platforms/android-22/arch-x86_64/usr/lib/crtbegin_dynamic.o
index 1aee8cc..794f210 100644
--- a/platforms/android-22/arch-x86_64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-x86_64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-x86_64/usr/lib/crtbegin_static.o b/platforms/android-22/arch-x86_64/usr/lib/crtbegin_static.o
index 1aee8cc..794f210 100644
--- a/platforms/android-22/arch-x86_64/usr/lib/crtbegin_static.o
+++ b/platforms/android-22/arch-x86_64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_dynamic.o b/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_dynamic.o
index a813d58..510fc28 100644
--- a/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_static.o b/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_static.o
index a813d58..510fc28 100644
--- a/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-22/arch-x86_64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-23/arch-arm/usr/lib/crtbegin_dynamic.o
index b0f85b2..5cb86ba 100644
--- a/platforms/android-23/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-23/arch-arm/usr/lib/crtbegin_static.o
index b0f85b2..5cb86ba 100644
--- a/platforms/android-23/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-23/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-arm64/usr/lib/crtbegin_dynamic.o b/platforms/android-23/arch-arm64/usr/lib/crtbegin_dynamic.o
index 2055449..5bc7920 100644
--- a/platforms/android-23/arch-arm64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-arm64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-arm64/usr/lib/crtbegin_static.o b/platforms/android-23/arch-arm64/usr/lib/crtbegin_static.o
index 2055449..5bc7920 100644
--- a/platforms/android-23/arch-arm64/usr/lib/crtbegin_static.o
+++ b/platforms/android-23/arch-arm64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-23/arch-mips/usr/lib/crtbegin_dynamic.o
index d886413..698aa85 100644
--- a/platforms/android-23/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-23/arch-mips/usr/lib/crtbegin_static.o
index d886413..698aa85 100644
--- a/platforms/android-23/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-23/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-mips/usr/lib/crtend_android.o b/platforms/android-23/arch-mips/usr/lib/crtend_android.o
index 4e9be6d..9abcc47 100644
--- a/platforms/android-23/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-23/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-23/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-23/arch-mips/usr/libr6/crtbegin_dynamic.o
index 990e5d2..10b7855 100644
--- a/platforms/android-23/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-23/arch-mips/usr/libr6/crtbegin_static.o
index 990e5d2..10b7855 100644
--- a/platforms/android-23/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-23/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-mips/usr/libr6/crtend_android.o b/platforms/android-23/arch-mips/usr/libr6/crtend_android.o
index 90546d7..b2aa98e 100644
--- a/platforms/android-23/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-23/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-23/arch-mips64/usr/lib64/crtbegin_dynamic.o b/platforms/android-23/arch-mips64/usr/lib64/crtbegin_dynamic.o
index 458e11e..cdd4b77 100644
--- a/platforms/android-23/arch-mips64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-mips64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-mips64/usr/lib64/crtbegin_static.o b/platforms/android-23/arch-mips64/usr/lib64/crtbegin_static.o
index 458e11e..cdd4b77 100644
--- a/platforms/android-23/arch-mips64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-23/arch-mips64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-mips64/usr/lib64/crtend_android.o b/platforms/android-23/arch-mips64/usr/lib64/crtend_android.o
index 37c6815..975427c 100644
--- a/platforms/android-23/arch-mips64/usr/lib64/crtend_android.o
+++ b/platforms/android-23/arch-mips64/usr/lib64/crtend_android.o
Binary files differ
diff --git a/platforms/android-23/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-23/arch-x86/usr/lib/crtbegin_dynamic.o
index cd00209..a489f23 100644
--- a/platforms/android-23/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-23/arch-x86/usr/lib/crtbegin_static.o
index cd00209..a489f23 100644
--- a/platforms/android-23/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-23/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-x86_64/usr/lib/crtbegin_dynamic.o b/platforms/android-23/arch-x86_64/usr/lib/crtbegin_dynamic.o
index cd00209..a489f23 100644
--- a/platforms/android-23/arch-x86_64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-x86_64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-x86_64/usr/lib/crtbegin_static.o b/platforms/android-23/arch-x86_64/usr/lib/crtbegin_static.o
index cd00209..a489f23 100644
--- a/platforms/android-23/arch-x86_64/usr/lib/crtbegin_static.o
+++ b/platforms/android-23/arch-x86_64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_dynamic.o b/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_dynamic.o
index 132804f..4c59d73 100644
--- a/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_static.o b/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_static.o
index 132804f..4c59d73 100644
--- a/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-23/arch-x86_64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-24/arch-arm/usr/lib/crtbegin_dynamic.o
index ba2da41..eab15fe 100644
--- a/platforms/android-24/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-24/arch-arm/usr/lib/crtbegin_static.o
index ba2da41..eab15fe 100644
--- a/platforms/android-24/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-24/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-arm64/usr/lib/crtbegin_dynamic.o b/platforms/android-24/arch-arm64/usr/lib/crtbegin_dynamic.o
index 6fbafa0..6418ec2 100644
--- a/platforms/android-24/arch-arm64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-arm64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-arm64/usr/lib/crtbegin_static.o b/platforms/android-24/arch-arm64/usr/lib/crtbegin_static.o
index 6fbafa0..6418ec2 100644
--- a/platforms/android-24/arch-arm64/usr/lib/crtbegin_static.o
+++ b/platforms/android-24/arch-arm64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-24/arch-mips/usr/lib/crtbegin_dynamic.o
index 6837771..3f44a80 100644
--- a/platforms/android-24/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-24/arch-mips/usr/lib/crtbegin_static.o
index 6837771..3f44a80 100644
--- a/platforms/android-24/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-24/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-mips/usr/lib/crtend_android.o b/platforms/android-24/arch-mips/usr/lib/crtend_android.o
index 9d724a3..02200ee 100644
--- a/platforms/android-24/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-24/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-24/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-24/arch-mips/usr/libr6/crtbegin_dynamic.o
index 7263295..ecf21ee 100644
--- a/platforms/android-24/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-24/arch-mips/usr/libr6/crtbegin_static.o
index 7263295..ecf21ee 100644
--- a/platforms/android-24/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-24/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-mips/usr/libr6/crtend_android.o b/platforms/android-24/arch-mips/usr/libr6/crtend_android.o
index 83087d1..6860bad 100644
--- a/platforms/android-24/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-24/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-24/arch-mips64/usr/lib64/crtbegin_dynamic.o b/platforms/android-24/arch-mips64/usr/lib64/crtbegin_dynamic.o
index 7157ab1..2d5afa9 100644
--- a/platforms/android-24/arch-mips64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-mips64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-mips64/usr/lib64/crtbegin_static.o b/platforms/android-24/arch-mips64/usr/lib64/crtbegin_static.o
index 7157ab1..2d5afa9 100644
--- a/platforms/android-24/arch-mips64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-24/arch-mips64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-mips64/usr/lib64/crtend_android.o b/platforms/android-24/arch-mips64/usr/lib64/crtend_android.o
index d9cf420..b3f2240 100644
--- a/platforms/android-24/arch-mips64/usr/lib64/crtend_android.o
+++ b/platforms/android-24/arch-mips64/usr/lib64/crtend_android.o
Binary files differ
diff --git a/platforms/android-24/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-24/arch-x86/usr/lib/crtbegin_dynamic.o
index d6489f6..5a68f1a 100644
--- a/platforms/android-24/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-24/arch-x86/usr/lib/crtbegin_static.o
index d6489f6..5a68f1a 100644
--- a/platforms/android-24/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-24/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-x86_64/usr/lib/crtbegin_dynamic.o b/platforms/android-24/arch-x86_64/usr/lib/crtbegin_dynamic.o
index d6489f6..5a68f1a 100644
--- a/platforms/android-24/arch-x86_64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-x86_64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-x86_64/usr/lib/crtbegin_static.o b/platforms/android-24/arch-x86_64/usr/lib/crtbegin_static.o
index d6489f6..5a68f1a 100644
--- a/platforms/android-24/arch-x86_64/usr/lib/crtbegin_static.o
+++ b/platforms/android-24/arch-x86_64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_dynamic.o b/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_dynamic.o
index 5f93a4e..a1ee1c2 100644
--- a/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_static.o b/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_static.o
index 5f93a4e..a1ee1c2 100644
--- a/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-24/arch-x86_64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-26/arch-arm/usr/lib/crtbegin_dynamic.o
index 6cdfff5..84a896f 100644
--- a/platforms/android-26/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-26/arch-arm/usr/lib/crtbegin_static.o
index 6cdfff5..84a896f 100644
--- a/platforms/android-26/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-26/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-arm64/usr/lib/crtbegin_dynamic.o b/platforms/android-26/arch-arm64/usr/lib/crtbegin_dynamic.o
index 1c35e5f..e92affa 100644
--- a/platforms/android-26/arch-arm64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-arm64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-arm64/usr/lib/crtbegin_static.o b/platforms/android-26/arch-arm64/usr/lib/crtbegin_static.o
index 1c35e5f..e92affa 100644
--- a/platforms/android-26/arch-arm64/usr/lib/crtbegin_static.o
+++ b/platforms/android-26/arch-arm64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-26/arch-mips/usr/lib/crtbegin_dynamic.o
index 2d5c4e8..da7279d 100644
--- a/platforms/android-26/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-26/arch-mips/usr/lib/crtbegin_static.o
index 2d5c4e8..da7279d 100644
--- a/platforms/android-26/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-26/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-mips/usr/lib/crtend_android.o b/platforms/android-26/arch-mips/usr/lib/crtend_android.o
index a2c26d1..1205a6f 100644
--- a/platforms/android-26/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-26/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-26/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-26/arch-mips/usr/libr6/crtbegin_dynamic.o
index 90fff6a..9d1a831 100644
--- a/platforms/android-26/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-26/arch-mips/usr/libr6/crtbegin_static.o
index 90fff6a..9d1a831 100644
--- a/platforms/android-26/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-26/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-mips/usr/libr6/crtend_android.o b/platforms/android-26/arch-mips/usr/libr6/crtend_android.o
index 614fd4f..7c0bc80 100644
--- a/platforms/android-26/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-26/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-26/arch-mips64/usr/lib64/crtbegin_dynamic.o b/platforms/android-26/arch-mips64/usr/lib64/crtbegin_dynamic.o
index 0a66de4..389b07d 100644
--- a/platforms/android-26/arch-mips64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-mips64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-mips64/usr/lib64/crtbegin_static.o b/platforms/android-26/arch-mips64/usr/lib64/crtbegin_static.o
index 0a66de4..389b07d 100644
--- a/platforms/android-26/arch-mips64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-26/arch-mips64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-mips64/usr/lib64/crtend_android.o b/platforms/android-26/arch-mips64/usr/lib64/crtend_android.o
index 577214f..da601f6 100644
--- a/platforms/android-26/arch-mips64/usr/lib64/crtend_android.o
+++ b/platforms/android-26/arch-mips64/usr/lib64/crtend_android.o
Binary files differ
diff --git a/platforms/android-26/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-26/arch-x86/usr/lib/crtbegin_dynamic.o
index 9a9c399..8682396 100644
--- a/platforms/android-26/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-26/arch-x86/usr/lib/crtbegin_static.o
index 9a9c399..8682396 100644
--- a/platforms/android-26/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-26/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-x86_64/usr/lib/crtbegin_dynamic.o b/platforms/android-26/arch-x86_64/usr/lib/crtbegin_dynamic.o
index 9a9c399..8682396 100644
--- a/platforms/android-26/arch-x86_64/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-x86_64/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-x86_64/usr/lib/crtbegin_static.o b/platforms/android-26/arch-x86_64/usr/lib/crtbegin_static.o
index 9a9c399..8682396 100644
--- a/platforms/android-26/arch-x86_64/usr/lib/crtbegin_static.o
+++ b/platforms/android-26/arch-x86_64/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_dynamic.o b/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_dynamic.o
index 907469b..92fd46c 100644
--- a/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_dynamic.o
+++ b/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_static.o b/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_static.o
index 907469b..92fd46c 100644
--- a/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_static.o
+++ b/platforms/android-26/arch-x86_64/usr/lib64/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o b/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o
index b1c35e9..254a955 100644
--- a/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-9/arch-arm/usr/lib/crtbegin_static.o b/platforms/android-9/arch-arm/usr/lib/crtbegin_static.o
index 4868fc1..2dec0ca 100644
--- a/platforms/android-9/arch-arm/usr/lib/crtbegin_static.o
+++ b/platforms/android-9/arch-arm/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-9/arch-mips/usr/lib/crtbegin_dynamic.o b/platforms/android-9/arch-mips/usr/lib/crtbegin_dynamic.o
index 998b812..ee17b6a 100644
--- a/platforms/android-9/arch-mips/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-9/arch-mips/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-9/arch-mips/usr/lib/crtbegin_static.o b/platforms/android-9/arch-mips/usr/lib/crtbegin_static.o
index 998b812..ee17b6a 100644
--- a/platforms/android-9/arch-mips/usr/lib/crtbegin_static.o
+++ b/platforms/android-9/arch-mips/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-9/arch-mips/usr/lib/crtend_android.o b/platforms/android-9/arch-mips/usr/lib/crtend_android.o
index 8ad8763..4315a99 100644
--- a/platforms/android-9/arch-mips/usr/lib/crtend_android.o
+++ b/platforms/android-9/arch-mips/usr/lib/crtend_android.o
Binary files differ
diff --git a/platforms/android-9/arch-mips/usr/libr6/crtbegin_dynamic.o b/platforms/android-9/arch-mips/usr/libr6/crtbegin_dynamic.o
index ea3ecad..0e48917 100644
--- a/platforms/android-9/arch-mips/usr/libr6/crtbegin_dynamic.o
+++ b/platforms/android-9/arch-mips/usr/libr6/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-9/arch-mips/usr/libr6/crtbegin_static.o b/platforms/android-9/arch-mips/usr/libr6/crtbegin_static.o
index ea3ecad..0e48917 100644
--- a/platforms/android-9/arch-mips/usr/libr6/crtbegin_static.o
+++ b/platforms/android-9/arch-mips/usr/libr6/crtbegin_static.o
Binary files differ
diff --git a/platforms/android-9/arch-mips/usr/libr6/crtend_android.o b/platforms/android-9/arch-mips/usr/libr6/crtend_android.o
index fa248d4..ba51028 100644
--- a/platforms/android-9/arch-mips/usr/libr6/crtend_android.o
+++ b/platforms/android-9/arch-mips/usr/libr6/crtend_android.o
Binary files differ
diff --git a/platforms/android-9/arch-x86/usr/lib/crtbegin_dynamic.o b/platforms/android-9/arch-x86/usr/lib/crtbegin_dynamic.o
index a9e5457..3a29674 100644
--- a/platforms/android-9/arch-x86/usr/lib/crtbegin_dynamic.o
+++ b/platforms/android-9/arch-x86/usr/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/platforms/android-9/arch-x86/usr/lib/crtbegin_static.o b/platforms/android-9/arch-x86/usr/lib/crtbegin_static.o
index a9e5457..3a29674 100644
--- a/platforms/android-9/arch-x86/usr/lib/crtbegin_static.o
+++ b/platforms/android-9/arch-x86/usr/lib/crtbegin_static.o
Binary files differ
diff --git a/platforms/repo.prop b/platforms/repo.prop
index 0cdee67..b75f2cd 100644
--- a/platforms/repo.prop
+++ b/platforms/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/android-arm/gdbserver/repo.prop b/prebuilt/android-arm/gdbserver/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/android-arm/gdbserver/repo.prop
+++ b/prebuilt/android-arm/gdbserver/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/android-arm64/gdbserver/repo.prop b/prebuilt/android-arm64/gdbserver/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/android-arm64/gdbserver/repo.prop
+++ b/prebuilt/android-arm64/gdbserver/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/android-mips/gdbserver/repo.prop b/prebuilt/android-mips/gdbserver/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/android-mips/gdbserver/repo.prop
+++ b/prebuilt/android-mips/gdbserver/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/android-mips64/gdbserver/repo.prop b/prebuilt/android-mips64/gdbserver/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/android-mips64/gdbserver/repo.prop
+++ b/prebuilt/android-mips64/gdbserver/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/android-x86/gdbserver/repo.prop b/prebuilt/android-x86/gdbserver/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/android-x86/gdbserver/repo.prop
+++ b/prebuilt/android-x86/gdbserver/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/android-x86_64/gdbserver/repo.prop b/prebuilt/android-x86_64/gdbserver/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/android-x86_64/gdbserver/repo.prop
+++ b/prebuilt/android-x86_64/gdbserver/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/prebuilt/linux-x86_64/bin/gdb-orig b/prebuilt/linux-x86_64/bin/gdb-orig
index 1099c31..881feb1 100755
--- a/prebuilt/linux-x86_64/bin/gdb-orig
+++ b/prebuilt/linux-x86_64/bin/gdb-orig
Binary files differ
diff --git a/prebuilt/linux-x86_64/bin/make b/prebuilt/linux-x86_64/bin/make
index 18d10cf..a77ccda 100755
--- a/prebuilt/linux-x86_64/bin/make
+++ b/prebuilt/linux-x86_64/bin/make
Binary files differ
diff --git a/prebuilt/linux-x86_64/bin/python b/prebuilt/linux-x86_64/bin/python
index 89289b2..9000443 100755
--- a/prebuilt/linux-x86_64/bin/python
+++ b/prebuilt/linux-x86_64/bin/python
Binary files differ
diff --git a/prebuilt/linux-x86_64/bin/python2 b/prebuilt/linux-x86_64/bin/python2
index 89289b2..9000443 100755
--- a/prebuilt/linux-x86_64/bin/python2
+++ b/prebuilt/linux-x86_64/bin/python2
Binary files differ
diff --git a/prebuilt/linux-x86_64/bin/python2.7 b/prebuilt/linux-x86_64/bin/python2.7
index 89289b2..9000443 100755
--- a/prebuilt/linux-x86_64/bin/python2.7
+++ b/prebuilt/linux-x86_64/bin/python2.7
Binary files differ
diff --git a/prebuilt/linux-x86_64/bin/yasm b/prebuilt/linux-x86_64/bin/yasm
index 4078181..24064eb 100755
--- a/prebuilt/linux-x86_64/bin/yasm
+++ b/prebuilt/linux-x86_64/bin/yasm
Binary files differ
diff --git a/prebuilt/linux-x86_64/lib/libpython2.7.a b/prebuilt/linux-x86_64/lib/libpython2.7.a
index ec4b068..8bf8426 100755
--- a/prebuilt/linux-x86_64/lib/libpython2.7.a
+++ b/prebuilt/linux-x86_64/lib/libpython2.7.a
Binary files differ
diff --git a/prebuilt/linux-x86_64/lib/python2.7/config/libpython2.7.a b/prebuilt/linux-x86_64/lib/python2.7/config/libpython2.7.a
index b792a90..4f3657d 100644
--- a/prebuilt/linux-x86_64/lib/python2.7/config/libpython2.7.a
+++ b/prebuilt/linux-x86_64/lib/python2.7/config/libpython2.7.a
Binary files differ
diff --git a/prebuilt/linux-x86_64/lib/python2.7/lib2to3/Grammar2.7.5.final.0.pickle b/prebuilt/linux-x86_64/lib/python2.7/lib2to3/Grammar2.7.5.final.0.pickle
index 99519fc..f1b3825 100644
--- a/prebuilt/linux-x86_64/lib/python2.7/lib2to3/Grammar2.7.5.final.0.pickle
+++ b/prebuilt/linux-x86_64/lib/python2.7/lib2to3/Grammar2.7.5.final.0.pickle
Binary files differ
diff --git a/prebuilt/linux-x86_64/repo.prop b/prebuilt/linux-x86_64/repo.prop
index 0cdee67..b75f2cd 100644
--- a/prebuilt/linux-x86_64/repo.prop
+++ b/prebuilt/linux-x86_64/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/python-packages/repo.prop b/python-packages/repo.prop
index 0cdee67..b75f2cd 100644
--- a/python-packages/repo.prop
+++ b/python-packages/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/shader-tools/linux-x86_64/glslc b/shader-tools/linux-x86_64/glslc
index 451c31d..76600ac 100755
--- a/shader-tools/linux-x86_64/glslc
+++ b/shader-tools/linux-x86_64/glslc
Binary files differ
diff --git a/shader-tools/linux-x86_64/repo.prop b/shader-tools/linux-x86_64/repo.prop
index 0cdee67..b75f2cd 100644
--- a/shader-tools/linux-x86_64/repo.prop
+++ b/shader-tools/linux-x86_64/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/shader-tools/linux-x86_64/spirv-as b/shader-tools/linux-x86_64/spirv-as
index 27a5fcb..0a33828 100755
--- a/shader-tools/linux-x86_64/spirv-as
+++ b/shader-tools/linux-x86_64/spirv-as
Binary files differ
diff --git a/shader-tools/linux-x86_64/spirv-cfg b/shader-tools/linux-x86_64/spirv-cfg
index 1f79187..cb049de 100755
--- a/shader-tools/linux-x86_64/spirv-cfg
+++ b/shader-tools/linux-x86_64/spirv-cfg
Binary files differ
diff --git a/shader-tools/linux-x86_64/spirv-dis b/shader-tools/linux-x86_64/spirv-dis
index ae7d188..ed13a49 100755
--- a/shader-tools/linux-x86_64/spirv-dis
+++ b/shader-tools/linux-x86_64/spirv-dis
Binary files differ
diff --git a/shader-tools/linux-x86_64/spirv-opt b/shader-tools/linux-x86_64/spirv-opt
index 625d5d7..811df77 100755
--- a/shader-tools/linux-x86_64/spirv-opt
+++ b/shader-tools/linux-x86_64/spirv-opt
Binary files differ
diff --git a/shader-tools/linux-x86_64/spirv-val b/shader-tools/linux-x86_64/spirv-val
index 7840522..6b2cffb 100755
--- a/shader-tools/linux-x86_64/spirv-val
+++ b/shader-tools/linux-x86_64/spirv-val
Binary files differ
diff --git a/simpleperf/README.md b/simpleperf/README.md
index 5700c8a..d6c9c7f 100644
--- a/simpleperf/README.md
+++ b/simpleperf/README.md
@@ -1,17 +1,114 @@
-# Simpleperf Introduction
-## What is simpleperf
-Simpleperf is a native profiling tool for Android. Its command-line interface
-supports broadly the same options as the linux-tools perf, but also supports
-various Android-specific improvements.
+# Simpleperf
 
-Simpleperf is part of the Android Open Source Project. The source code is at
-https://android.googlesource.com/platform/system/extras/+/master/simpleperf/.
-The latest document is at
-https://android.googlesource.com/platform/system/extras/+show/master/simpleperf/README.md.
-Bugs and feature requests can be submitted at
-http://github.com/android-ndk/ndk/issues.
+Simpleperf is a native profiling tool for Android. It can be used to profile
+both Android applications and native processes running on Android. It can
+profile both Java and C++ code on Android. It can be used on Android L
+and above.
 
-## How simpleperf works
+Simpleperf is part of the Android Open Source Project. The source code is [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/).
+The latest document is [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/README.md).
+Bugs and feature requests can be submitted at http://github.com/android-ndk/ndk/issues.
+
+
+## Table of Contents
+
+- [Simpleperf introduction](#simpleperf-introduction)
+    - [Why simpleperf](#why-simpleperf)
+    - [Tools in simpleperf](#tools-in-simpleperf)
+    - [Simpleperf's profiling principle](#simpleperfs-profiling-principle)
+    - [Main simpleperf commands](#main-simpleperf-commands)
+        - [Simpleperf list](#simpleperf-list)
+        - [Simpleperf stat](#simpleperf-stat)
+        - [Simpleperf record](#simpleperf-record)
+        - [Simpleperf report](#simpleperf-report)
+- [Android application profiling](#android-application-profiling)
+    - [Prepare an Android application](#prepare-an-android-application)
+    - [Record and report profiling data (using command-lines)](#record-and-report-profiling-data-using-commandlines)
+    - [Record and report profiling data (using python scripts)](#record-and-report-profiling-data-using-python-scripts)
+    - [Record and report call graph](#record-and-report-call-graph)
+    - [Visualize profiling data](#visualize-profiling-data)
+    - [Annotate source code](#annotate-source-code)
+- [Answers to common issues](#answers-to-common-issues)
+    - [The correct way to pull perf.data on host](#the-correct-way-to-pull-perfdata-on-host)
+
+
+## Simpleperf introduction
+
+### Why simpleperf
+
+Simpleperf works similar to linux-tools-perf, but it has some specific features for
+Android profiling:
+
+1. Aware of Android environment
+
+    a. It can profile embedded shared libraries in apk.
+
+    b. It reads symbols and debug information from .gnu_debugdata section.
+
+    c. It gives suggestions when errors occur.
+
+    d. When recording with -g option, unwind the stack before writting to file to
+    save storage space.
+
+    e. It supports adding additional information (like symbols) in perf.data, to
+    support recording on device and reporting on host.
+
+2. Using python scripts for profiling tasks
+
+3. Easy to release
+
+    a. Simpleperf executables on device are built as static binaries. They can be
+    pushed on any Android device and run.
+
+    b. Simpleperf executables on host are built as static binaries, and support
+    different hosts: mac, linux and windows.
+
+
+### Tools in simpleperf
+
+Simpleperf is periodically released with Android ndk, located at `simpleperf/`.
+The latest release can be found [here](https://android.googlesource.com/platform/prebuilts/simpleperf/).
+Simpleperf tools contain executables, shared libraries and python scripts.
+
+**Simpleperf executables running on Android device**
+Simpleperf executables running on Android device are located at `bin/android/`.
+Each architecture has one executable, like `bin/android/arm64/simpleperf`. It
+can record and report profiling data. It provides a command-line interface
+broadly the same as the linux-tools perf, and also supports some additional
+features for Android-specific profiling.
+
+**Simpleperf executables running on hosts**
+Simpleperf executables running on hosts are located at `bin/darwin`, `bin/linux`
+and `bin/windows`. Each host and architecture has one executable, like
+`bin/linux/x86_64/simpleperf`. It provides a command-line interface for
+reporting profiling data on hosts.
+
+**Simpleperf report shared libraries used on host**
+Simpleperf report shared libraries used on host are located at `bin/darwin`,
+`bin/linux` and `bin/windows`. Each host and architecture has one library, like
+`bin/linux/x86_64/libsimpleperf_report.so`. It is a library for parsing
+profiling data.
+
+**Python scripts**
+Python scripts are written to help different profiling tasks.
+
+`annotate.py` is used to annotate source files based on profiling data.
+
+`app_profiler.py` is used to profile Android applications.
+
+`binary_cache_builder.py` is used to pull libraries from Android devices.
+
+`pprof_proto_generator.py` is used to convert profiling data to format used by pprof.
+
+`report.py` is used to provide a GUI interface to report profiling result.
+
+`report_sample.py` is used to generate flamegraph.
+
+`simpleperf_report_lib.py` provides a python interface for parsing profiling data.
+
+
+### Simpleperf's profiling principle
+
 Modern CPUs have a hardware component called the performance monitoring unit
 (PMU). The PMU has several hardware counters, counting events like how many cpu
 cycles have happened, how many instructions have executed, or how many cache
@@ -45,24 +142,28 @@
 The report command reads a "perf.data" file and any shared libraries used by
 the profiled processes, and outputs a report showing where the time was spent.
 
-## Main simpleperf commands
-Simpleperf supports several subcommands, including list, stat, record, report.
+
+### Main simpleperf commands
+
+Simpleperf supports several subcommands, including list, stat, record and report.
 Each subcommand supports different options. This section only covers the most
 important subcommands and options. To see all subcommands and options,
 use --help.
 
     # List all subcommands.
-    $simpleperf --help
+    $ simpleperf --help
 
     # Print help message for record subcommand.
-    $simpleperf record --help
+    $ simpleperf record --help
 
-### simpleperf list
+
+#### Simpleperf list
+
 simpleperf list is used to list all events available on the device. Different
 devices may support different events because of differences in hardware and
 kernel.
 
-    $simpleperf list
+    $ simpleperf list
     List of hw-cache events:
       branch-loads
       ...
@@ -75,7 +176,9 @@
       task-clock
       ...
 
-### simpleperf stat
+
+#### Simpleperf stat
+
 simpleperf stat is used to get a raw event counter information of the profiled program
 or system-wide. By passing options, we can select which events to use, which
 processes/threads to monitor, how long to monitor and the print interval.
@@ -83,7 +186,7 @@
 
     # Stat using default events (cpu-cycles,instructions,...), and monitor
     # process 7394 for 10 seconds.
-    $simpleperf stat -p 7394 --duration 10
+    $ simpleperf stat -p 7394 --duration 10
     Performance counter statistics:
 
      1,320,496,145  cpu-cycles         # 0.131736 GHz                     (100%)
@@ -95,14 +198,14 @@
 
     Total test time: 10.023829 seconds.
 
-#### Select events
+**Select events**
 We can select which events to use via -e option. Below are examples:
 
     # Stat event cpu-cycles.
-    $simpleperf stat -e cpu-cycles -p 11904 --duration 10
+    $ simpleperf stat -e cpu-cycles -p 11904 --duration 10
 
     # Stat event cache-references and cache-misses.
-    $simpleperf stat -e cache-references,cache-misses -p 11904 --duration 10
+    $ simpleperf stat -e cache-references,cache-misses -p 11904 --duration 10
 
 When running the stat command, if the number of hardware events is larger than
 the number of hardware counters available in the PMU, the kernel shares hardware
@@ -111,7 +214,7 @@
 showing the percentage of the total time that each event was actually monitored.
 
     # Stat using event cache-references, cache-references:u,....
-    $simpleperf stat -p 7394 -e     cache-references,cache-references:u,cache-references:k,cache-misses,cache-misses:u,cache-misses:k,instructions --duration 1
+    $ simpleperf stat -p 7394 -e     cache-references,cache-references:u,cache-references:k,cache-misses,cache-misses:u,cache-misses:k,instructions --duration 1
     Performance counter statistics:
 
     4,331,018  cache-references     # 4.861 M/sec    (87%)
@@ -130,7 +233,7 @@
 --group option. Below is an example.
 
     # Stat using event cache-references, cache-references:u,....
-    $simpleperf stat -p 7394 --group cache-references,cache-misses --group cache-references:u,cache-misses:u --group cache-references:k,cache-misses:k -e instructions --duration 1
+    $ simpleperf stat -p 7394 --group cache-references,cache-misses --group cache-references:u,cache-misses:u --group cache-references:k,cache-misses:k -e instructions --duration 1
     Performance counter statistics:
 
     3,638,900  cache-references     # 4.786 M/sec          (74%)
@@ -143,59 +246,61 @@
 
     Total test time: 1.029843 seconds.
 
-#### Select target to monitor
+**Select target to monitor**
 We can select which processes or threads to monitor via -p option or -t option.
 Monitoring a process is the same as monitoring all threads in the process.
 Simpleperf can also fork a child process to run the new command and then monitor
 the child process. Below are examples.
 
     # Stat process 11904 and 11905.
-    $simpleperf stat -p 11904,11905 --duration 10
+    $ simpleperf stat -p 11904,11905 --duration 10
 
     # Stat thread 11904 and 11905.
-    $simpleperf stat -t 11904,11905 --duration 10
+    $ simpleperf stat -t 11904,11905 --duration 10
 
     # Start a child process running `ls`, and stat it.
-    $simpleperf stat ls
+    $ simpleperf stat ls
 
-#### Decide how long to monitor
+**Decide how long to monitor**
 When monitoring existing threads, we can use --duration option to decide how long
 to monitor. When monitoring a child process running a new command, simpleperf
 monitors until the child process ends. In this case, we can use Ctrl-C to stop monitoring
 at any time. Below are examples.
 
     # Stat process 11904 for 10 seconds.
-    $simpleperf stat -p 11904 --duration 10
+    $ simpleperf stat -p 11904 --duration 10
 
     # Stat until the child process running `ls` finishes.
-    $simpleperf stat ls
+    $ simpleperf stat ls
 
     # Stop monitoring using Ctrl-C.
-    $simpleperf stat -p 11904 --duration 10
+    $ simpleperf stat -p 11904 --duration 10
     ^C
 
-#### Decide the print interval
+**Decide the print interval**
 When monitoring perf counters, we can also use --interval option to decide the print
 interval. Below are examples.
 
     # Print stat for process 11904 every 300ms.
-    $simpleperf stat -p 11904 --duration 10 --interval 300
+    $ simpleperf stat -p 11904 --duration 10 --interval 300
 
     # Print system wide stat at interval of 300ms for 10 seconds (rooted device only).
     # system wide profiling needs root privilege
-    $su 0 simpleperf stat -a --duration 10 --interval 300
+    $ su 0 simpleperf stat -a --duration 10 --interval 300
 
-#### Display counters in systrace
+**Display counters in systrace**
 simpleperf can also work with systrace to dump counters in the collected trace.
 Below is an example to do a system wide stat
 
     # capture instructions (kernel only) and cache misses with interval of 300 milliseconds for 15 seconds
-    $su 0 simpleperf stat -e instructions:k,cache-misses -a --interval 300 --duration 15
+    $ su 0 simpleperf stat -e instructions:k,cache-misses -a --interval 300 --duration 15
     # on host launch systrace to collect trace for 10 seconds
-    (HOST)$external/chromium-trace/systrace.py --time=10 -o new.html sched gfx view
+    (HOST)$ external/chromium-trace/systrace.py --time=10 -o new.html sched gfx view
     # open the collected new.html in browser and perf counters will be shown up
 
-### simpleperf record
+
+#### Simpleperf record
+
 simpleperf record is used to dump records of the profiled program. By passing
 options, we can select which events to use, which processes/threads to monitor,
 what frequency to dump records, how long to monitor, and where to store records.
@@ -203,31 +308,31 @@
     # Record on process 7394 for 10 seconds, using default event (cpu-cycles),
     # using default sample frequency (4000 samples per second), writing records
     # to perf.data.
-    $simpleperf record -p 7394 --duration 10
+    $ simpleperf record -p 7394 --duration 10
     simpleperf I 07-11 21:44:11 17522 17522 cmd_record.cpp:316] Samples recorded: 21430. Samples lost: 0.
 
-#### Select events
+**Select events**
 In most cases, the cpu-cycles event is used to evaluate consumed cpu time.
 As a hardware event, it is both accurate and efficient. We can also use other
 events via -e option. Below is an example.
 
     # Record using event instructions.
-    $simpleperf record -e instructions -p 11904 --duration 10
+    $ simpleperf record -e instructions -p 11904 --duration 10
 
-#### Select target to monitor
+**Select target to monitor**
 The way to select target in record command is similar to that in stat command.
 Below are examples.
 
     # Record process 11904 and 11905.
-    $simpleperf record -p 11904,11905 --duration 10
+    $ simpleperf record -p 11904,11905 --duration 10
 
     # Record thread 11904 and 11905.
-    $simpleperf record -t 11904,11905 --duration 10
+    $ simpleperf record -t 11904,11905 --duration 10
 
     # Record a child process running `ls`.
-    $simpleperf record ls
+    $ simpleperf record ls
 
-#### Set the frequency to record
+**Set the frequency to record**
 We can set the frequency to dump records via the -f or -c options. For example,
 -f 4000 means dumping approximately 4000 records every second when the monitored
 thread runs. If a monitored thread runs 0.2s in one second (it can be preempted
@@ -236,33 +341,35 @@
 means dumping one record whenever 10000 events happen. Below are examples.
 
     # Record with sample frequency 1000: sample 1000 times every second running.
-    $simpleperf record -f 1000 -p 11904,11905 --duration 10
+    $ simpleperf record -f 1000 -p 11904,11905 --duration 10
 
     # Record with sample period 100000: sample 1 time every 100000 events.
-    $simpleperf record -c 100000 -t 11904,11905 --duration 10
+    $ simpleperf record -c 100000 -t 11904,11905 --duration 10
 
-#### Decide how long to monitor
+**Decide how long to monitor**
 The way to decide how long to monitor in record command is similar to that in
 stat command. Below are examples.
 
     # Record process 11904 for 10 seconds.
-    $simpleperf record -p 11904 --duration 10
+    $ simpleperf record -p 11904 --duration 10
 
     # Record until the child process running `ls` finishes.
-    $simpleperf record ls
+    $ simpleperf record ls
 
     # Stop monitoring using Ctrl-C.
-    $simpleperf record -p 11904 --duration 10
+    $ simpleperf record -p 11904 --duration 10
     ^C
 
-#### Set the path to store records
+**Set the path to store records**
 By default, simpleperf stores records in perf.data in current directory. We can
 use -o option to set the path to store records. Below is an example.
 
     # Write records to data/perf2.data.
-    $simpleperf record -p 11904 -o data/perf2.data --duration 10
+    $ simpleperf record -p 11904 -o data/perf2.data --duration 10
 
-### simpleperf report
+
+#### Simpleperf report
+
 simpleperf report is used to report based on perf.data generated by simpleperf
 record command. Report command groups records into different sample entries,
 sorts sample entries based on how many events each sample entry contains, and
@@ -280,7 +387,7 @@
     # Reports perf.data, using only records sampled in libsudo-game-jni.so,
     # grouping records using thread name(comm), process id(pid), thread id(tid),
     # function name(symbol), and showing sample count for each row.
-    $simpleperf report --dsos /data/app/com.example.sudogame-2/lib/arm64/libsudo-game-jni.so --sort comm,pid,tid,symbol -n
+    $ simpleperf report --dsos /data/app/com.example.sudogame-2/lib/arm64/libsudo-game-jni.so --sort comm,pid,tid,symbol -n
     Cmdline: /data/data/com.example.sudogame/simpleperf record -p 7394 --duration 10
     Arch: arm64
     Event: cpu-cycles (type 0, config 0)
@@ -293,13 +400,13 @@
     13.82%    4088    sudogame  7394  7394  randomBlock_r(Board&, int, int, int, int, int)
     6.24%     1756    sudogame  7394  7394  @plt
 
-#### Set the path to read records
+**Set the path to read records**
 By default, simpleperf reads perf.data in current directory. We can use -i
 option to select another file to read records.
 
-    $simpleperf report -i data/perf2.data
+    $ simpleperf report -i data/perf2.data
 
-#### Set the path to find executable binaries
+**Set the path to find executable binaries**
 If reporting function symbols, simpleperf needs to read executable binaries
 used by the monitored processes to get symbol table and debug information. By
 default, the paths are the executable binaries used by monitored processes while
@@ -307,236 +414,266 @@
 symbol table and debug information. So we can use --symfs to redirect the paths.
 Below is an example.
 
-    $simpleperf report
+    $ simpleperf report
     # In this case, when simpleperf wants to read executable binary /A/b,
     # it reads file in /A/b.
 
-    $simpleperf report --symfs /debug_dir
+    $ simpleperf report --symfs /debug_dir
     # In this case, when simpleperf wants to read executable binary /A/b,
     # it prefers file in /debug_dir/A/b to file in /A/b.
 
-#### Filter records
+**Filter records**
 When reporting, it happens that not all records are of interest. Simpleperf
 supports five filters to select records of interest. Below are examples.
 
     # Report records in threads having name sudogame.
-    $simpleperf report --comms sudogame
+    $ simpleperf report --comms sudogame
 
     # Report records in process 7394 or 7395
-    $simpleperf report --pids 7394,7395
+    $ simpleperf report --pids 7394,7395
 
     # Report records in thread 7394 or 7395.
-    $simpleperf report --tids 7394,7395
+    $ simpleperf report --tids 7394,7395
 
     # Report records in libsudo-game-jni.so.
-    $simpleperf report --dsos /data/app/com.example.sudogame-2/lib/arm64/libsudo-game-jni.so
+    $ simpleperf report --dsos /data/app/com.example.sudogame-2/lib/arm64/libsudo-game-jni.so
 
     # Report records in function checkValid or canFindSolution_r.
-    $simpleperf report --symbols "checkValid(Board const&, int, int);canFindSolution_r(Board&, int, int)"
+    $ simpleperf report --symbols "checkValid(Board const&, int, int);canFindSolution_r(Board&, int, int)"
 
-#### Decide how to group records into sample entries
+**Decide how to group records into sample entries**
 Simpleperf uses --sort option to decide how to group sample entries. Below are
 examples.
 
     # Group records based on their process id: records having the same process
     # id are in the same sample entry.
-    $simpleperf report --sort pid
+    $ simpleperf report --sort pid
 
     # Group records based on their thread id and thread comm: records having
     # the same thread id and thread name are in the same sample entry.
-    $simpleperf report --sort tid,comm
+    $ simpleperf report --sort tid,comm
 
     # Group records based on their binary and function: records in the same
     # binary and function are in the same sample entry.
-    $simpleperf report --sort dso,symbol
+    $ simpleperf report --sort dso,symbol
 
     # Default option: --sort comm,pid,tid,dso,symbol. Group records in the same
     # thread, and belong to the same function in the same binary.
-    $simpleperf report
+    $ simpleperf report
 
-## Features of simpleperf
-Simpleperf works similar to linux-tools-perf, but it has following improvements:
-1. Aware of Android environment. Simpleperf handles some Android specific
-situations when profiling. For example, it can profile embedded shared libraries
-in apk, read symbol table and debug information from .gnu_debugdata section. If
-possible, it gives suggestions when facing errors, like how to disable
-perf_harden to enable profiling.
-2. Support unwinding while recording. If we want to use -g option to record and
-report call-graph of a program, we need to dump user stack and register set in
-each record, and then unwind the stack to find the call chain. Simpleperf
-supports unwinding while recording, so it doesn’t need to store user stack in
-perf.data. So we can profile for a longer time with limited space on device.'
-3. Support scripts to make profiling on Android more convenient.
-4. Build in static binaries. Simpleperf is a static binary, so it doesn’t need
-supporting shared libraries to run. It means there is no limitation of Android
-version that simpleperf can run on, although some devices don’t support
-profiling.
 
-# Simpleperf tools in ndk
-Simpleperf tools in ndk contain three parts: simpleperf executable running on
-Android device, simpleperf executable running on host, and python scripts.
+## Android application profiling
 
-## Simpleperf on device
-Simpleperf running on device is located at bin/android directory. It contains
-static binaries running on Android on different architectures. They can be used
-to profile processes running device, and generate perf.data.
+This section shows how to profile an Android application.
+[Here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/README.md) are examples. And we use
+[SimpleperfExamplePureJava](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/SimpleperfExamplePureJava) project to show the profiling results.
 
-## Simpleperf on host
-Simpleperfs running on host are located at bin/darwin, bin/linux and
-bin/windows.They can be used to parse perf.data on host.
+Simpleperf only supports profiling native instructions in binaries in ELF
+format. If the Java code is executed by interpreter, or with jit cache, it
+can’t be profiled by simpleperf. As Android supports Ahead-of-time compilation,
+it can compile Java bytecode into native instructions with debug information.
+On devices with Android version <= M, we need root privilege to compile Java
+bytecode with debug information. However, on devices with Android version >= N,
+we don't need root privilege to do so.
 
-## Scripts
-Scripts are used to make it convenient to profile and parse profiling results.
-app_profiler.py is used to profile an android application. It prepares
-profiling environments, downloads simpleperf on device, generates and pulls
-perf.data on host. It is configured by app_profiler.config.
-binary_cache_builder.py is used to pull native binaries from device to host.
-It is used by app_profiler.py.
-annotate.py is used to annotate source files using perf.data. It is configured
-by annotate.config.
-report.py reports perf.data in a GUI window.
-simpleperf_report_lib.py is used to enumerate samples in perf.data. Internally
-it uses libsimpleperf_report.so to parse perf.data. It can be used to translate
-samples in perf.data to other forms. One example using simpleperf_report_lib.py
-is report_sample.py.
+Profiling an Android application involves three steps:
+1. Prepare the application.
+2. Record profiling data.
+3. Report profiling data.
 
-# Examples of using simpleperf tools
-This section shows how to use simpleperf tools to profile an Android
-application.
+To profile, we can use either command lines or python scripts. Below shows both.
 
-## Prepare a debuggable Application
-The package name of the application is com.example.sudogame. It has both java
-code and c++ code. We need to run a copy of the app with
-android:debuggable=”true” in its AndroidManifest.xml <application> element,
-because we can’t use run-as for non-debuggable apps. The application should
-has been installed on device, and we can connect device via adb.
 
-## Profile using command line
-To record profiling data, we need to download simpleperf and native libraries
-with debug information on device, run simpleperf to generate profiling data
-file: perf.data, and run simpleperf to report perf.data. Below are the steps.
+### Prepare an Android application
 
-### 1. Enable profiling
+Before profiling, we need to install the application to be profiled on an Android device.
+To get valid profiling results, please check following points:
 
-    $adb shell setprop security.perf_harden 0
+**1. The application should be debuggable.**
+It means [android:debuggable](https://developer.android.com/guide/topics/manifest/application-element.html#debug)
+should be true. So we need to use debug [build type](https://developer.android.com/studio/build/build-variants.html#build-types)
+instead of release build type. It is understandable because we can't profile others' apps.
+However, on a rooted Android device, the application doesn't need to be debuggable.
 
-### 2. Find the process running the app
-Run `ps` in the app’s context. On >=O devices, run `ps -e` instead.
+**2. Run on an Android device >= L.**
+Profiling on emulators are not yet supported. And to profile Java code, we need
+the jvm running in oat mode, which is only available >= L.
 
-    $adb shell
-    angler:/ $ run-as com.example.sudogame
-    angler:/data/data/com.example.sudogame $ ps
-    u0_a93    10324 570   1030480 58104 SyS_epoll_ 00f41b7528 S com.example.sudogame
-    u0_a93    10447 10441 7716   1588  sigsuspend 753c515d34 S sh
-    u0_a93    10453 10447 9112   1644           0 7ba07ff664 R ps
+**3. On Android O, add `wrap.sh` in the apk.**
+To profile Java code, we need the jvm running in oat mode. But on Android O,
+debuggable applications are forced to run in jit mode. To work around this,
+we need to add a `wrap.sh` in the apk. So if you are running on Android O device,
+Check [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle)
+for how to add `wrap.sh` in the apk.
 
-So process 10324 runs the app.
+**4. Make sure C++ code is compiled with optimizing flags.**
+If the application contains C++ code, it can be compiled with -O0 flag in debug build type.
+This makes C++ code slow. Check [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle)
+for how to avoid that.
 
-### 3. Download simpleperf to the app’s data directory
-First we need to find out which architecture the app is using. There are many
-ways, here we just check the map of the process.
+**5. Use native libraries with debug info in the apk when possible.**
+If the application contains C++ code or pre-compiled native libraries, try to use
+unstripped libraries in the apk. This helps simpleperf generating better profiling
+results. Check [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle)
+for how to use unstripped libraries.
 
-    angler:/data/data/com.example.sudogame $cat /proc/10324/maps | grep boot.art
-    70f34000-7144e000 r--p 00000000 fd:00 1082  /system/framework/arm/boot.oat
+Here we use [SimpleperfExamplePureJava](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/SimpleperfExamplePureJava) as an example.
+It builds an app-profiling.apk for profiling.
 
-The file path shows it is arm. So we download simpleperf in arm directory on
-device.
+    $ git clone https://android.googlesource.com/platform/system/extras
+    $ cd extras/simpleperf/demo
+    # Open SimpleperfExamplesPureJava project with Android studio,
+    # and build this project sucessfully, otherwise the `./gradlew` command below will fail.
+    $ cd SimpleperfExamplePureJava
 
-    $adb push bin/android/arm/simpleperf /data/local/tmp
-    $adb shell
-    angler:/ $ run-as com.example.sudogame
-    angler:/data/data/com.example.sudogame $ cp /data/local/tmp/simpleperf .
+    # On windows, use "gradlew" instead.
+    $ ./gradlew clean assemble
+    $ adb install -r app/build/outputs/apk/app-profiling.apk
 
-### 4. Record perf.data
 
-    angler:/data/data/com.example.sudogame $./simpleperf record -p 10324 --duration 30
-    simpleperf I 01-01 09:26:39 10598 10598 cmd_record.cpp:341] Samples recorded: 49471. Samples lost: 0.
-    angler:/data/data/com.example.sudogame $ls -lh perf.data
-    -rw-rw-rw- 1 u0_a93 u0_a93 2.6M 2017-01-01 09:26 perf.data
+### Record and report profiling data (using command-lines)
 
-Don’t forget to run the app while recording. Otherwise, we may get no samples
-because the process is always sleeping.
+We recommend using python scripts for profiling because they are more convenient.
+But using command-line will give us a better understanding of the profile process
+step by step. So we first show how to use command lines.
 
-### 5. Report perf.data
-There are different ways to report perf.data. Below shows some examples.
+**1. Enable profiling**
 
-Report samples in different threads.
+    $ adb shell setprop security.perf_harden 0
 
-    angler:/data/data/com.example.sudogame $./simpleperf report --sort pid,tid,comm
-    Cmdline: /data/data/com.example.sudogame/simpleperf record -p 10324 --duration 30
-    Arch: arm64
-    Event: cpu-cycles (type 0, config 0)
-    Samples: 49471
-    Event count: 16700769019
+**2. Fully compile the app**
 
-    Overhead  Pid    Tid    Command
-    66.31%    10324  10324  xample.sudogame
-    30.97%    10324  10340  RenderThread
+We need to compile Java bytecode into native instructions to profile Java code
+in the application. This needs different commands on different Android versions.
+
+On Android >= N:
+
+    $ adb shell setprop debug.generate-debug-info true
+    $ adb shell cmd package compile -f -m speed com.example.simpleperf.simpleperfexamplepurejava
+    # Restart the app to take effect
+    $ adb shell am force-stop com.example.simpleperf.simpleperfexamplepurejava
+
+On Android M devices, We need root privilege to force Android to fully compile
+Java code into native instructions in ELF binaries with debug information. We
+also need root privilege to read compiled native binaries (because installd
+writes them to a directory whose uid/gid is system:install). So profiling Java
+code can only be done on rooted devices.
+
+    $ adb root
+    $ adb shell setprop dalvik.vm.dex2oat-flags -g
+
+    # Reinstall the app.
+    $ adb install -r app/build/outputs/apk/app-profiling.apk
+
+On Android L devices, we also need root privilege to compile the app with debug info
+and access the native binaries.
+
+    $ adb root
+    $ adb shell setprop dalvik.vm.dex2oat-flags --include-debug-symbols
+
+    # Reinstall the app.
+    $ adb install -r app/build/outputs/apk/app-profiling.apk
+
+
+**3. Find the app process**
+
+    # Start the app if needed
+    $ adb shell am start -n com.example.simpleperf.simpleperfexamplepurejava/.MainActivity
+
+    # Run `ps` in the app's context. On Android >= O devicces, run `ps -e` instead.
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava ps | grep simpleperf
+    u0_a151   6885  3346  1590504 53980 SyS_epoll_ 6fc2024b6c S com.example.simpleperf.simpleperfexamplepurejava
+
+So the id of the app process is `6885`. We will use this number in the command lines below,
+please replace this number with what you get by running `ps` command.
+
+**4. Download simpleperf to the app's data directory**
+
+    # Find which architecture the app is using.
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava cat /proc/6885/maps | grep boot.oat
+    708e6000-70e33000 r--p 00000000 103:09 1214                              /system/framework/arm64/boot.oat
+
+    # The app uses /arm64/boot.oat, so push simpleperf in bin/android/arm64/ to device.
+    $ cd ../../scripts/
+    $ adb push bin/android/arm64/simpleperf /data/local/tmp
+    $ adb shell chmod a+x /data/local/tmp/simpleperf
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava cp /data/local/tmp/simpleperf .
+
+
+**5. Record perf.data**
+
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava ./simpleperf record -p 6885 --duration 10
+    simpleperf I 04-27 20:41:11  6940  6940 cmd_record.cpp:357] Samples recorded: 40008. Samples lost: 0.
+
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava ls -lh perf.data
+    simpleperf I 04-27 20:31:40  5999  5999 cmd_record.cpp:357] Samples recorded: 39949. Samples lost: 0.
+
+The profiling data is recorded at perf.data.
+
+Normally we need to use the app when profiling, otherwise we may record no samples.
+But in this case, the MainActivity starts a busy thread. So we don't need to use
+the app while profiling.
+
+There are many options to record profiling data, check [record command](#simpleperf-record) for details.
+
+**6. Report perf.data**
+
+    # Pull perf.data on host.
+    $ adb shell "run-as com.example.simpleperf.simpleperfexamplepurejava cat perf.data | tee /data/local/tmp/perf.data >/dev/null"
+    $ adb pull /data/local/tmp/perf.data
+
+    # Report samples using corresponding simpleperf executable on host.
+    # On windows, use "bin\windows\x86_64\simpleperf" instead.
+    $ bin/linux/x86_64/simpleperf report
     ...
+    Overhead  Command   Pid   Tid   Shared Object                                                                     Symbol
+    83.54%    Thread-2  6885  6900  /data/app/com.example.simpleperf.simpleperfexamplepurejava-2/oat/arm64/base.odex  void com.example.simpleperf.simpleperfexamplepurejava.MainActivity$1.run()
+    16.11%    Thread-2  6885  6900  /data/app/com.example.simpleperf.simpleperfexamplepurejava-2/oat/arm64/base.odex  int com.example.simpleperf.simpleperfexamplepurejava.MainActivity$1.callFunction(int)
 
-Report samples in different binaries in the main thread.
+See [here](#the-correct-way-to-pull-perfdata-on-host) for why we use tee rather than just >.
+There are many ways to show reports, check [report command](#simpleperf-report) for details.
 
-    angler:/data/data/com.example.sudogame $./simpleperf report --tids 10324 --sort dso -n
-    ...
-    Overhead  Sample  Shared Object
-    37.71%    9970    /system/lib/libc.so
-    35.45%    9786    [kernel.kallsyms]
-    8.71%     3305    /system/lib/libart.so
-    6.44%     2405    /system/framework/arm/boot-framework.oat
-    5.64%     1480    /system/lib/libcutils.so
-    1.55%     426     /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so
-    ...
 
-Report samples in different functions in libsudo-game-jni.so in the main thread.
+### Record and report profiling data (using python scripts)
 
-    angler:/data/data/com.example.sudogame $./simpleperf report --tids 10324 --dsos  /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so --sort symbol -n
-    ...
-    Overhead  Sample  Symbol
-    8.94%     35      libsudo-game-jni.so[+1d54]
-    5.71%     25      libsudo-game-jni.so[+1dae]
-    5.70%     23      @plt
-    5.09%     22      libsudo-game-jni.so[+1d88]
-    4.54%     19      libsudo-game-jni.so[+1d82]
-    3.61%     14      libsudo-game-jni.so[+1f3c]
-    ...
+Besides command lines, We can use `app-profiler.py` to profile Android applications.
+It downloads simpleperf on device, records perf.data, and collects profiling
+results and native binaries on host. It is configured by `app-profiler.config`.
 
-In the above result, most symbols are binary name[+virual_addr]. It is because
-libsudo-game-jni.so used on device has stripped .symbol section. We can
-download libsudo-game-jni.so having debug information on device. In android
-studio project, it locates at
-app/build/intermediates/binaries/debug/arm/obj/armeabi-v7a/libsudo-game-jni.so.
-We have to download libsudo-game-jni.so to the same relative path as recorded
-in perf.data (otherwise, simpleperf can’t find it). In this case, it is
-/data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so.
+**1. Fill `app-profiler.config`**
 
-Report symbols using libraries with debug information.
+    Change `app_package_name` line to  app_package_name="com.example.simpleperf.simpleperfexamplepurejava"
+    Change `apk_file_path` line to apk_file_path = "../SimpleperfExamplePureJava/app/build/outputs/apk/app-profiling.apk"
+    Change `android_studio_project_dir` line to android_studio_project_dir = "../SimpleperfExamplePureJava/"
+    Change `record_options` line to record_options = "--duration 10"
 
-    $adb push app/build/intermediates/binaries/debug/arm/obj/armeabi-v7a/libsudo-game-jni.so /data/local/tmp
-    $adb shell
-    angler:/ $ run-as com.example.sudogame
-    angler:/data/data/com.example.sudogame $ mkdir -p data/app/com.example.sudogame-1/lib/arm
-    angler:/data/data/com.example.sudogame $cp /data/local/tmp/libsudo-game-jni.so data/app/com.example.sudogame-1/lib/arm
-    angler:/data/data/com.example.sudogame $./simpleperf report --tids 10324 --dsos  /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so --sort symbol -n --symfs .
-    ...
-    Overhead  Sample  Symbol
-    75.18%    317     checkValid(Board const&, int, int)
-    14.43%    60      canFindSolution_r(Board&, int, int)
-    5.70%     23      @plt
-    3.51%     20      randomBlock_r(Board&, int, int, int, int, int)
-    ...
+`apk_file_path` is needed to fully compile the application on Android L/M. It is
+not necessary on Android >= N.
 
-Report samples in one function
+`android_studio_project_dir` is used to search native libraries in the
+application. It is not necessary for profiling.
 
-    angler:/data/data/com.example.sudogame $./simpleperf report --tids 10324 --dsos  /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so --symbols “checkValid(Board const&, int, int)” --sort vaddr_in_file -n --symfs .
-    ...
-    Overhead  Sample  VaddrInFile
-    11.89%    35      0x1d54
-    7.59%     25      0x1dae
-    6.77%     22      0x1d88
-    6.03%     19      0x1d82
-    ...
+`record_options` can be set to any option accepted by simpleperf record command.
 
-### 6. Record and report call graph
+**2. Run `app-profiler.py`**
+
+    $ python app_profiler.py
+
+
+If running successfully, it will collect profiling data in perf.data in current
+directory, and related native binaries in binary_cache/.
+
+**3. Report perf.data**
+
+We can use `report.py` to report perf.data.
+
+    $ python report.py
+
+We can add any option accepted by `simpleperf report` command to `report.py`.
+
+
+### Record and report call graph
+
 A call graph is a tree showing function call relations. Below is an example.
 
     main() {
@@ -555,277 +692,135 @@
            |
            |-> FunctionTwo
 
+
 #### Record dwarf based call graph
-To generate call graph, simpleperf needs to generate call chain for each record.
-Simpleperf requests kernel to dump user stack and user register set for each
-record, then it backtraces the user stack to find the function call chain. To
-parse the call chain, it needs support of dwarf call frame information, which
-usually resides in .eh_frame or .debug_frame section of the binary.  So we need
-to use --symfs to point out where is libsudo-game-jni.so with debug information.
 
-    angler:/data/data/com.example.sudogame $./simpleperf record -p 10324 -g --symfs . --duration 30
-    simpleperf I 01-01 09:59:42 11021 11021 cmd_record.cpp:341] Samples recorded: 60700. Samples lost: 1240.
+When using command lines, add `-g` option like below:
 
-Note that kernel can’t dump user stack >= 64K, so the dwarf based call graph
-doesn’t contain call chains consuming >= 64K stack. What’s more, because we
-need to dump stack in each record, it is likely to lost records. Usually, it
-doesn’t matter to lost some records.
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava ./simpleperf record -g -p 6685 --duration 10
+
+When using python scripts, change `app-profiler.config` as below:
+
+    Change `record_options` line to record_options = "--duration 10 -g"
+
+Recording dwarf based call graph needs support of debug information
+in native binaries. So if using native libraries in the application,
+it is better to contain non-stripped native libraries in the apk.
+
 
 #### Record stack frame based call graph
-Another way to generate call graph is to rely on the kernel parsing the call
-chain for each record. To make it possible, kernel has to be able to identify
-the stack frame of each function call. This is not always possible, because
-compilers can optimize away stack frames, or use a stack frame style not
-recognized by the kernel. So how well it works depends (It works well on arm64,
-but not well on arm).
 
-    angler:/data/data/com.example.sudogame $./simpleperf record -p 10324 --call-graph fp --symfs . --duration 30
-    simpleperf I 01-01 10:03:58 11267 11267 cmd_record.cpp:341] Samples recorded: 56736. Samples lost: 0.
+When using command lines, add `--call-graph fp` option like below:
 
-**Recording stack frame based call graph doesn't work well on arm architecture,**
-**even if compiled using -O0 -g -fno-omit-frame-pointer options. It is because**
-**the kernel can't unwind user stack containing both arm/thumb code. So please**
-**consider using dwarf based call graph on arm architecture, or profiling in**
-**aarch64 environment.**
+    $ adb shell run-as com.example.simpleperf.simpleperfexamplepurejava ./simpleperf record --call-graph fp -p 6685 --duration 10
+
+When using python scripts, change `app-profiler.config` as below:
+
+    Change `record_options` line to record_options = "--duration 10 --call-graph fp"
+
+Recording stack frame based call graphs needs support of stack frame
+register. Notice that on arm architecture, the stack frame register
+is not well supported, even if compiled using -O0 -g -fno-omit-frame-pointer
+options. It is because the kernel can't unwind user stack containing both
+arm/thumb code. **So please consider using dwarf based call graph on arm
+architecture, or profiling in arm64 environment.**
+
 
 #### Report call graph
-Report accumulated period. In the table below, the first column is “Children”,
-it is the cpu cycle percentage of a function and functions called by that
-function. The second column is “Self”, it is the cpu cycle percentage of just a
-function. For example, checkValid() itself takes 1.28% cpus, but it takes
-29.43% by running itself and calling other functions.
 
-    angler:/data/data/com.example.sudogame $./simpleperf report --children --symfs .
+To report call graph using command lines, add `-g` option.
+
+    $ bin/linux/x86_64/simpleperf report -g
     ...
-    Children  Self   Command          Pid    Tid    Shared Object                                                 Symbol
-    31.94%    0.00%  xample.sudogame  10324  10324  [kernel.kallsyms]                                             [kernel.kallsyms][+ffffffc000204268]
-    31.10%    0.92%  xample.sudogame  10324  10324  /system/lib/libc.so                                           writev
-    29.43%    1.28%  xample.sudogame  10324  10324  /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so  checkValid(Board const&, int, int)
-    28.43%    0.34%  xample.sudogame  10324  10324  /system/lib/liblog.so                                         __android_log_print
-    28.24%    0.00%  xample.sudogame  10324  10324  /system/lib/libcutils.so                                      libcutils.so[+107b7]
-    28.10%    0.27%  xample.sudogame  10324  10324  /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so  canFindSolution_r(Board&, int, int)
-    ...
+    Children  Self    Command          Pid    Tid    Shared Object                                                                     Symbol
+    99.97%    0.00%   Thread-2         10859  10876  /system/framework/arm64/boot.oat                                                  java.lang.Thread.run
+       |
+       -- java.lang.Thread.run
+          |
+           -- void com.example.simpleperf.simpleperfexamplepurejava.MainActivity$1.run()
+               |--83.66%-- [hit in function]
+               |
+               |--16.22%-- int com.example.simpleperf.simpleperfexamplepurejava.MainActivity$1.callFunction(int)
+               |    |--99.97%-- [hit in function]
 
-Report call graph.
+To report call graph using python scripts, add `-g` option.
 
-    angler:/data/data/com.example.sudogame $./simpleperf report -g --symfs . >report
-    angler:/data/data/com.example.sudogame $exit
-    angler:/ $cp /data/data/com.example.sudogame/report /data/local/tmp
-    angler:/ $exit
-    $adb pull /data/local/tmp/report .
-    $cat report
-    ...
-    29.43%    1.28%  xample.sudogame  10324  10324  /data/app/com.example.sudogame-1/lib/arm/libsudo-game-jni.so  checkValid(Board const&, int, int)
-           |
-           -- checkValid(Board const&, int, int)
-              |
-              |--95.50%-- __android_log_print
-              |    |--0.68%-- [hit in function]
-              |    |
-              |    |--51.84%-- __android_log_buf_write
-              |    |    |--2.07%-- [hit in function]
-              |    |    |
-              |    |    |--30.74%-- libcutils.so[+c69d]
-    ...
+    $ python report.py -g
+    # Double-click an item started with '+' to show its callgraph.
 
-Report call graph in callee mode. We can also show how a function is called by
-other functions.
+### Visualize profiling data
 
-    angler:/data/data/com.example.sudogame $./simpleperf report -g callee --symfs . >report
-    $adb shell run-as com.example.sudogame cat report >report
-    $cat report
-    …
-    28.43%    0.34%  xample.sudogame  10324  10324  /system/lib/liblog.so                                         __android_log_print
-           |
-           -- __android_log_print
-              |
-              |--97.82%-- checkValid(Board const&, int, int)
-              |    |--0.13%-- [hit in function]
-              |    |
-              |    |--94.89%-- canFindSolution_r(Board&, int, int)
-              |    |    |--0.01%-- [hit in function]
-              |    |    |
-    ...
+`simpleperf_report_lib.py` provides an interface reading samples from perf.data.
+By using it, You can write python scripts to read perf.data or convert perf.data
+to other formats. Below are two examples.
 
-## Profile java code
-Simpleperf only supports profiling native instructions in binaries in ELF
-format. If the java code is executed by interpreter, or with jit cache, it
-can’t be profiled by simpleperf. As Android supports Ahead-of-time compilation,
-it can compile java bytecode into native instructions with debug information.
-On devices with Android version <= M, we need root privilege to compile java
-bytecode with debug information. However, on devices with Android version >= N,
-we don't need root privilege to do so.
-
-### On Android N
-#### 1. Fully compile java code into native instructions.
-
-    $adb shell setprop debug.generate-debug-info true
-    $adb shell cmd package compile -f -m speed com.example.sudogame
-    // restart the app to take effect
-
-#### 2. Record perf.data
-
-    angler:/data/data/com.example.sudogame $./simpleperf record -p 11826 -g --symfs . --duration 30
-    simpleperf I 01-01 10:31:40 11859 11859 cmd_record.cpp:341] Samples recorded: 50576. Samples lost: 2139.
-
-#### 3. Report perf.data
-
-    angler:/data/data/com.example.sudogame $./simpleperf report -g --symfs . >report
-    angler:/data/data/com.example.sudogame $exit
-    angler:/ $cp /data/data/com.example.sudogame/report /data/local/tmp
-    angler:/ $exit
-    $adb pull /data/local/tmp/report .
-    $cat report
-    ...
-    21.14%    0.00%  xample.sudogame  11826  11826  /data/app/com.example.sudogame-1/oat/arm/base.odex            boolean com.example.sudogame.MainActivity.onOptionsItemSelected(android.view.MenuItem)
-           |
-           -- boolean com.example.sudogame.MainActivity.onOptionsItemSelected(android.view.MenuItem)
-              |
-               --99.99%-- void com.example.sudogame.GameView.startNewGame()
-                   |--0.01%-- [hit in function]
-                   |
-                   |--99.87%-- void com.example.sudogame.GameModel.reInit()
-                   |    |--0.01%-- [hit in function]
-                   |    |
-                   |    |--89.65%-- boolean com.example.sudogame.GameModel.canFindSolution(int[][])
-                   |    |    |
-                   |    |    |--99.95%-- Java_com_example_sudogame_GameModel_canFindSolution
-                   |    |    |    |
-                   |    |    |    |--99.49%-- canFindSolution(Board&)
-                   |    |    |    |    |--0.01%-- [hit in function]
-                   |    |    |    |    |
-                   |    |    |    |    |--99.97%-- canFindSolution_r(Board&, int, int)
-                   |    |    |    |    |           canFindSolution_r(Board&, int, int)
-    ...
-
-### On Android M
-On M devices, We need root privilege to force Android fully compiling java code
-into native instructions in ELF binaries with debug information. We also need
-root privilege to read compiled native binaries (because installd writes them
-to a directory whose uid/gid is system:install). So profiling java code can
-only be done on rooted devices.
-
-    $adb root
-    $adb shell setprop dalvik.vm.dex2oat-flags -g
-
-    # Reinstall the app.
-    $adb install -r app-debug.apk
-
-    # Change to the app’s data directory.
-    $ adb root && adb shell
-    device# cd `run-as com.example.sudogame pwd`
-
-    # Record as root as simpleperf needs to read the generated native binary.
-    device#./simpleperf record -p 25636 -g --symfs . -f 1000 --duration 30
-    simpleperf I 01-02 07:18:20 27182 27182 cmd_record.cpp:323] Samples recorded: 23552. Samples lost: 39.
-
-### On Android L
-On L devices, we also need root privilege to compile the app with debug info
-and access the native binaries.
-
-    $adb root
-    $adb shell setprop dalvik.vm.dex2oat-flags --include-debug-symbols
-
-    # Reinstall the app.
-    $adb install -r app-debug.apk
-
-## Profile using scripts
-Although using command line is flexible, it can be too complex. So we have
-python scripts to help running commands.
-
-### Record using app_profiler.py
-app_profiler.py is used to profile an Android application. It sets up profiling
-environment, downloads simpleperf and native libraries with debug information,
-runs simpleperf to generate perf.data, and pulls perf.data and binaries from
-device to host.
-It is configured by app_profiler.config. Below is an example.
-
-app_profiler.config:
-
-    app_package_name = “com.example.sudogame”
-    android_studio_project_dir = “/AndroidStudioProjects/SudoGame”  # absolute path of the project
-    ...
-    record_options = "-e cpu-cycles:u -f 4000 -g --dump-symbols --duration 30"
-    ...
-
-run app_profiler.py:
-
-    $python app_profiler.py
-    ...
-    INFO:root:profiling is finished.
-
-It pulls generated perf.data on host, and collects binaries from device in
-binary_cache.
-
-### Report using report.py
-
-    $python report.py -g
-
-It generates a GUI interface to report data.
-
-### Process samples using simpleperf_report_lib.py
-simpleperf_report_lib.py provides an interface reading samples from perf.data.
-An example is report_sample.py.
 
 ### Show flamegraph
 
-    $python report_sample.py >out.perf
-    $stackcollapse-perf.pl out.perf >out.folded
-    $./flamegraph.pl out.folded >a.svg
+    $ python report_sample.py >out.perf
+    $ stackcollapse-perf.pl out.perf >out.folded
+    $ ./flamegraph.pl out.folded >a.svg
+
 
 ### Visualize using pprof
+
 pprof is a tool for visualization and analysis of profiling data. It can
 be got from https://github.com/google/pprof. pprof_proto_generator.py can
 generate profiling data in a format acceptable by pprof.
 
-    $python pprof_proto_generator.py
-    $pprof -pdf pprof.profile
+    $ python pprof_proto_generator.py
+    $ pprof -pdf pprof.profile
+
 
 ### Annotate source code
-annotate.py reads perf.data and binaries in binary_cache. Then it knows which
-source file:line each sample hits. So it can annotate source code. annotate.py
-is configured by annotate.config. Below is an example.
 
-annotate.config:
+`annotate.py` reads perf.data, binaries in `binary-cache` (collected by `app-profiler.py`)
+and source code, and generates annoated source code in `annotated_files/`.
 
+It is configured by `annotate.config`.
+
+**1. Fill `annotate.config`**
+
+    Change `source_dirs` line to source_dirs = ["../SimpleperfExamplePureJava"]
+    Change `addr2line_path` line to addr2line_path = "addr2line"
+
+`addr2line` is need to annotate source code. It can be found in Android ndk release.
+Please set `addr2line_path` to the location of `addr2line` if it can't be found
+in PATH environment variable.
+
+**2. Run `annotate.py`**
+
+    $ python annotate.py
+
+
+**3. Read annotated code**
+
+The annotated source code is located at `annotated_files/`.
+`annotated_files/summary` shows how each source file is annotated.
+
+One annotated source file is `annotated_files/java/com/example/simpleperf/simpleperfexamplepurejava/MainActivity.java`.
+It's content is similar to below:
+
+    // [file] shows how much time is spent in current file.
+    /* [file] acc_p: 99.966552%, p: 99.837438% */package com.example.simpleperf.simpleperfexamplepurejava;
     ...
-    source_dirs = [“/AndroidStudio/SudoGame”]  # It is a directory containing source code.
+    // [func] shows how much time is spent in current function.
+    /* [func] acc_p: 16.213395%, p: 16.209250% */            private int callFunction(int a) {
     ...
+    // This shows how much time is spent in current line.
+    // acc_p field means how much time is spent in current line and functions called by current line.
+    // p field means how much time is spent just in current line.
+    /* acc_p: 99.966552%, p: 83.628188%        */                    i = callFunction(i);
 
-run annotate.py:
 
-    $python annotate.py
+## Answers to common issues
 
-It generates annotated_files directory.
-annotated_files/summary file contains summary information for each source file.
-An example is as below.
+### The correct way to pull perf.data on host
+As perf.data is generated in app's context, it can't be pulled directly to host.
+One way is to `adb shell run-as xxx cat perf.data >perf.data`. However, it
+doesn't work well on Windows, because the content can be modified when it goes
+through the pipe. So we first copy it from app's context to shell's context,
+then pull it on host. The commands are as below:
 
-    /AndroidStudioProjects/SudoGame/app/src/main/jni/sudo-game-jni.cpp: accumulated_period: 25.587937%, period: 1.250961%
-      function (checkValid(Board const&, int, int)): line 99, accumulated_period: 23.564356%, period: 0.908457%
-      function (canFindSolution_r(Board&, int, int)): line 135, accumulated_period: 22.260125%, period: 0.142359%
-      function (canFindSolution(Board&)): line 166, accumulated_period: 22.233101%, period: 0.000000%
-      function (Java_com_example_sudogame_GameModel_canFindSolution): line 470, accumulated_period: 21.983184%, period: 0.000000%
-      function (Java_com_example_sudogame_GameModel_initRandomBoard): line 430, accumulated_period: 2.226896%, period: 0.000000%
-
-      line 27: accumulated_period: 0.011729%, period: 0.000000%
-      line 32: accumulated_period: 0.004362%, period: 0.000000%
-      line 33: accumulated_period: 0.004427%, period: 0.000000%
-      line 36: accumulated_period: 0.003303%, period: 0.000000%
-      line 39: accumulated_period: 0.010367%, period: 0.004123%
-      line 41: accumulated_period: 0.162219%, period: 0.000000%
-
-annotated_files/ also contains annotated source files which are found by
-annotate.py. For example, part of checkValid() function in libsudo-game-jni.cpp
-is annotated as below.
-
-    /* [func] acc_p: 23.564356%, p: 0.908457% */static bool checkValid(const Board& board, int curR, int curC) {
-    /* acc_p: 0.037933%, p: 0.037933%         */    int digit = board.digits[curR][curC];
-    /* acc_p: 0.162355%, p: 0.162355%         */    for (int r = 0; r < BOARD_ROWS; ++r) {
-    /* acc_p: 0.020880%, p: 0.020880%         */        if (r == curR) {
-    /* acc_p: 0.034691%, p: 0.034691%         */            continue;
-                                                        }
-    /* acc_p: 0.176490%, p: 0.176490%         */        if (board.digits[r][curC] == digit) {
-    /* acc_p: 14.957673%, p: 0.059022%        */            LOGI("conflict (%d, %d) (%d, %d)", curR, curC, r, curC);
-    /* acc_p: 0.016296%, p: 0.016296%         */            return false;
-                                                        }
-                                                    }
+    $adb shell "run-as xxx cat perf.data | tee /data/local/tmp/perf.data >/dev/null"
+    $adb pull /data/local/tmp/perf.data
diff --git a/simpleperf/annotate.py b/simpleperf/annotate.py
index d25a6cd..2b253bd 100644
--- a/simpleperf/annotate.py
+++ b/simpleperf/annotate.py
@@ -65,7 +65,7 @@
         dso = self.dso_dict.get(dso_name)
         if dso is None:
             self.dso_dict[dso_name] = dso = dict()
-        if not dso.has_key(addr):
+        if addr not in dso:
             dso[addr] = None
 
 
@@ -95,7 +95,8 @@
         addr_str = '\n'.join(addr_str)
         subproc = subprocess.Popen([self.addr2line_path, '-e', dso_path, '-aifC'],
                                    stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-        (stdoutdata, _) = subproc.communicate(addr_str)
+        (stdoutdata, _) = subproc.communicate(str_to_bytes(addr_str))
+        stdoutdata = bytes_to_str(stdoutdata)
         stdoutdata = stdoutdata.strip().split('\n')
         if len(stdoutdata) < len(addrs):
             log_fatal("addr2line didn't output enough lines")
@@ -106,13 +107,16 @@
             out_pos += 1
             assert addr_line[:2] == "0x"
             assert out_pos < len(stdoutdata)
-            assert addrs[addr_pos] == int(addr_line, 16)
             source_lines = []
             while out_pos < len(stdoutdata) and stdoutdata[out_pos][:2] != "0x":
                 function = stdoutdata[out_pos]
                 out_pos += 1
                 assert out_pos < len(stdoutdata)
-                file, line = stdoutdata[out_pos].split(':')
+                # Handle lines like "C:\Users\...\file:32".
+                items = stdoutdata[out_pos].rsplit(':', 1)
+                if len(items) != 2:
+                    continue
+                (file, line) = items
                 line = line.split()[0]  # Remove comments after line number
                 out_pos += 1
                 if file.find('?') != -1:
@@ -124,8 +128,8 @@
                 else:
                     line = int(line)
                 source_lines.append(SourceLine(file, function, line))
-                dso[addrs[addr_pos]] = source_lines
-                addr_pos += 1
+            dso[addrs[addr_pos]] = source_lines
+            addr_pos += 1
         assert addr_pos == len(addrs)
 
 
@@ -267,7 +271,7 @@
                         'annotate_dest_dir', 'comm_filters', 'pid_filters',
                         'tid_filters', 'dso_filters', 'addr2line_path']
         for name in config_names:
-            if not config.has_key(name):
+            if name not in config:
                 log_fatal('config [%s] is missing' % name)
         symfs_dir = config['symfs_dir']
         if symfs_dir and not os.path.isdir(symfs_dir):
@@ -432,7 +436,7 @@
 
 
     def _add_dso_period(self, dso_name, period, used_dso_dict):
-        if not used_dso_dict.has_key(dso_name):
+        if dso_name not in used_dso_dict:
             used_dso_dict[dso_name] = True
             dso_period = self.dso_periods.get(dso_name)
             if dso_period is None:
@@ -441,7 +445,7 @@
 
 
     def _add_file_period(self, source, period, used_file_dict):
-        if not used_file_dict.has_key(source.file_key):
+        if source.file_key not in used_file_dict:
             used_file_dict[source.file_key] = True
             file_period = self.file_periods.get(source.file)
             if file_period is None:
@@ -450,14 +454,14 @@
 
 
     def _add_line_period(self, source, period, used_line_dict):
-        if not used_line_dict.has_key(source.line_key):
+        if source.line_key not in used_line_dict:
             used_line_dict[source.line_key] = True
             file_period = self.file_periods[source.file]
             file_period.add_line_period(source.line, period)
 
 
     def _add_function_period(self, source, period, used_function_dict):
-        if not used_function_dict.has_key(source.function_key):
+        if source.function_key not in used_function_dict:
             used_function_dict[source.function_key] = True
             file_period = self.file_periods[source.file]
             file_period.add_function_period(source.function, source.line, period)
@@ -468,14 +472,14 @@
         with open(summary, 'w') as f:
             f.write('total period: %d\n\n' % self.period)
             dso_periods = sorted(self.dso_periods.values(),
-                                 cmp=lambda x, y: cmp(y.period.acc_period, x.period.acc_period))
+                                 key=lambda x: x.period.acc_period, reverse=True)
             for dso_period in dso_periods:
                 f.write('dso %s: %s\n' % (dso_period.dso_name,
                                           self._get_percentage_str(dso_period.period)))
             f.write('\n')
 
             file_periods = sorted(self.file_periods.values(),
-                                  cmp=lambda x, y: cmp(y.period.acc_period, x.period.acc_period))
+                                  key=lambda x: x.period.acc_period, reverse=True)
             for file_period in file_periods:
                 f.write('file %s: %s\n' % (file_period.file,
                                            self._get_percentage_str(file_period.period)))
@@ -486,8 +490,7 @@
                 for func_name in file_period.function_dict.keys():
                     func_start_line, period = file_period.function_dict[func_name]
                     values.append((func_name, func_start_line, period))
-                values = sorted(values,
-                                cmp=lambda x, y: cmp(y[2].acc_period, x[2].acc_period))
+                values = sorted(values, key=lambda x: x[2].acc_period, reverse=True)
                 for value in values:
                     f.write('\tfunction (%s): line %d, %s\n' % (
                         value[0], value[1], self._get_percentage_str(value[2])))
@@ -512,7 +515,7 @@
 
     def _collect_source_files(self):
         self.source_file_dict = dict()
-        source_file_suffix = ['h', 'c', 'cpp', 'cc', 'java']
+        source_file_suffix = ['h', 'c', 'cpp', 'cc', 'java', 'kt']
         for source_dir in self.config['source_dirs']:
             for root, _, files in os.walk(source_dir):
                 for file in files:
@@ -558,6 +561,9 @@
                 path = key
                 from_path = path
                 to_path = os.path.join(dest_dir, path[1:])
+            elif is_windows() and key.find(':\\') != -1 and os.path.isfile(key):
+                from_path = key
+                to_path = os.path.join(dest_dir, key.replace(':\\', '\\'))
             else:
                 path = key[1:] if key.startswith('/') else key
                 # Change path on device to path on host
@@ -607,7 +613,10 @@
             for line in range(1, len(lines) + 1):
                 annotate = annotates.get(line)
                 if annotate is None:
-                    annotate = empty_annotate
+                    if not lines[line-1].strip():
+                        annotate = ''
+                    else:
+                        annotate = empty_annotate
                 else:
                     annotate = '/* ' + annotate + (
                         ' ' * (max_annotate_cols - len(annotate))) + ' */'
@@ -624,3 +633,4 @@
     config = load_config(args.config)
     annotator = SourceFileAnnotator(config)
     annotator.annotate()
+    log_info('annotate finish successfully, please check result in annotated_files/.')
diff --git a/simpleperf/app_profiler.config b/simpleperf/app_profiler.config
index 4b61edb..752b85f 100644
--- a/simpleperf/app_profiler.config
+++ b/simpleperf/app_profiler.config
@@ -49,8 +49,8 @@
 
 
 # Profiling record options that will be passed directly to `simpleperf record` command on device.
-# As we can't stop profiling by Ctrl-C, we need to set how long to profile using "--duration".
-record_options = "-e cpu-cycles:u -f 4000 -g --dump-symbols --duration 10"
+# You can set how long to profile using "--duration" option, or use Ctrl-C to stop profiling.
+record_options = "-e cpu-cycles:u -f 4000 -g --duration 10"
 
 
 # The path to store generated perf.data on host.
diff --git a/simpleperf/app_profiler.py b/simpleperf/app_profiler.py
index a47f1aa..e2a137f 100644
--- a/simpleperf/app_profiler.py
+++ b/simpleperf/app_profiler.py
@@ -49,7 +49,7 @@
                         'record_options', 'perf_data_path', 'adb_path', 'readelf_path',
                         'binary_cache_dir']
         for name in config_names:
-            if not config.has_key(name):
+            if name not in config:
                 log_fatal('config [%s] is missing' % name)
         native_lib_dir = config.get('native_lib_dir')
         if native_lib_dir and not os.path.isdir(native_lib_dir):
@@ -121,7 +121,7 @@
         self.adb.set_property('security.perf_harden', '0')
         if self.is_root_device:
             # We can enable kernel symbols
-            self.adb.run(['shell', 'echo', '0', '>/proc/sys/kernel/kptr_restrict'])
+            self.adb.run(['shell', 'echo 0 >/proc/sys/kernel/kptr_restrict'])
 
 
     def _recompile_app(self):
@@ -177,7 +177,8 @@
 
 
     def _find_app_process(self):
-        result, output = self.adb.run_and_return_output(['shell', 'ps'])
+        ps_args = ['-e'] if self.android_version >= 8 else []
+        result, output = self.adb.run_and_return_output(['shell', 'ps'] + ps_args)
         if not result:
             return None
         output = output.split('\n')
@@ -264,16 +265,41 @@
 
 
     def start_and_wait_profiling(self):
-        self.run_in_app_dir([
-            './simpleperf', 'record', self.config['record_options'], '-p',
-            str(self.app_pid), '--symfs', '.'])
+        subproc = None
+        returncode = None
+        try:
+            args = self.get_run_in_app_dir_args([
+                './simpleperf', 'record', self.config['record_options'], '-p',
+                str(self.app_pid), '--symfs', '.'])
+            adb_args = [self.adb.adb_path] + args
+            log_debug('run adb cmd: %s' % adb_args)
+            subproc = subprocess.Popen(adb_args)
+            returncode = subproc.wait()
+        except KeyboardInterrupt:
+            if subproc:
+                self.stop_profiling()
+                returncode = 0
+        log_debug('run adb cmd: %s [result %s]' % (adb_args, returncode == 0))
+
+
+    def stop_profiling(self):
+        """ Stop profiling by sending SIGINT to simpleperf, and wait until it exits
+            to make sure perf.data is completely generated."""
+        has_killed = False
+        while True:
+            (result, _) = self.run_in_app_dir(['pidof', 'simpleperf'], check_result=False)
+            if not result:
+                break
+            if not has_killed:
+                has_killed = True
+                self.run_in_app_dir(['pkill', '-l', '2', 'simpleperf'], check_result=False)
+            time.sleep(1)
 
 
     def collect_profiling_data(self):
-        self.run_in_app_dir(['chmod', 'a+rw', 'perf.data'])
-        self.adb.check_run(['shell', 'cp',
-            '/data/data/%s/perf.data' % self.config['app_package_name'], '/data/local/tmp'])
-        self.adb.check_run(['pull', '/data/local/tmp/perf.data', self.config['perf_data_path']])
+        self.run_in_app_dir(['cat perf.data | tee /data/local/tmp/perf.data >/dev/null'])
+        self.adb.check_run_and_return_output(['pull', '/data/local/tmp/perf.data',
+                                              self.config['perf_data_path']])
         config = copy.copy(self.config)
         config['symfs_dirs'] = []
         if self.config['native_lib_dir']:
@@ -282,13 +308,20 @@
         binary_cache_builder.build_binary_cache()
 
 
-    def run_in_app_dir(self, args):
-        if self.is_root_device:
-            cmd = 'cd /data/data/' + self.config['app_package_name'] + ' && ' + (' '.join(args))
-            return self.adb.check_run_and_return_output(['shell', cmd])
+    def run_in_app_dir(self, args, stdout_file=None, check_result=True):
+        args = self.get_run_in_app_dir_args(args)
+        if check_result:
+            return self.adb.check_run_and_return_output(args, stdout_file)
         else:
-            return self.adb.check_run_and_return_output(
-                ['shell', 'run-as', self.config['app_package_name']] + args)
+            return self.adb.run_and_return_output(args, stdout_file)
+
+
+    def get_run_in_app_dir_args(self, args):
+        if self.is_root_device:
+            return ['shell', 'cd /data/data/' + self.config['app_package_name'] + ' && ' +
+                      (' '.join(args))]
+        else:
+            return ['shell', 'run-as', self.config['app_package_name']] + args
 
 
 if __name__ == '__main__':
diff --git a/simpleperf/bin/android/arm/simpleperf b/simpleperf/bin/android/arm/simpleperf
index a7fa0ab..77d636a 100755
--- a/simpleperf/bin/android/arm/simpleperf
+++ b/simpleperf/bin/android/arm/simpleperf
Binary files differ
diff --git a/simpleperf/bin/android/arm64/simpleperf b/simpleperf/bin/android/arm64/simpleperf
index 71e7141..e16dba7 100755
--- a/simpleperf/bin/android/arm64/simpleperf
+++ b/simpleperf/bin/android/arm64/simpleperf
Binary files differ
diff --git a/simpleperf/bin/android/x86/simpleperf b/simpleperf/bin/android/x86/simpleperf
index cec84b6..580e605 100755
--- a/simpleperf/bin/android/x86/simpleperf
+++ b/simpleperf/bin/android/x86/simpleperf
Binary files differ
diff --git a/simpleperf/bin/android/x86_64/simpleperf b/simpleperf/bin/android/x86_64/simpleperf
index 8ca23bf..07bf5fe 100755
--- a/simpleperf/bin/android/x86_64/simpleperf
+++ b/simpleperf/bin/android/x86_64/simpleperf
Binary files differ
diff --git a/simpleperf/bin/darwin/x86/libsimpleperf_report.dylib b/simpleperf/bin/darwin/x86/libsimpleperf_report.dylib
index 9dea978..b60acab 100755
--- a/simpleperf/bin/darwin/x86/libsimpleperf_report.dylib
+++ b/simpleperf/bin/darwin/x86/libsimpleperf_report.dylib
Binary files differ
diff --git a/simpleperf/bin/darwin/x86/simpleperf b/simpleperf/bin/darwin/x86/simpleperf
index 9a4c745..e505397 100755
--- a/simpleperf/bin/darwin/x86/simpleperf
+++ b/simpleperf/bin/darwin/x86/simpleperf
Binary files differ
diff --git a/simpleperf/bin/darwin/x86_64/libsimpleperf_report.dylib b/simpleperf/bin/darwin/x86_64/libsimpleperf_report.dylib
index be1d0d8..f260a92 100755
--- a/simpleperf/bin/darwin/x86_64/libsimpleperf_report.dylib
+++ b/simpleperf/bin/darwin/x86_64/libsimpleperf_report.dylib
Binary files differ
diff --git a/simpleperf/bin/darwin/x86_64/simpleperf b/simpleperf/bin/darwin/x86_64/simpleperf
index 082dbdf..fbb43de 100755
--- a/simpleperf/bin/darwin/x86_64/simpleperf
+++ b/simpleperf/bin/darwin/x86_64/simpleperf
Binary files differ
diff --git a/simpleperf/bin/linux/x86/libsimpleperf_report.so b/simpleperf/bin/linux/x86/libsimpleperf_report.so
index b41a168..54e93b8 100755
--- a/simpleperf/bin/linux/x86/libsimpleperf_report.so
+++ b/simpleperf/bin/linux/x86/libsimpleperf_report.so
Binary files differ
diff --git a/simpleperf/bin/linux/x86/simpleperf b/simpleperf/bin/linux/x86/simpleperf
index e869a83..1621233 100755
--- a/simpleperf/bin/linux/x86/simpleperf
+++ b/simpleperf/bin/linux/x86/simpleperf
Binary files differ
diff --git a/simpleperf/bin/linux/x86_64/libsimpleperf_report.so b/simpleperf/bin/linux/x86_64/libsimpleperf_report.so
index 0c7598f..74968a4 100755
--- a/simpleperf/bin/linux/x86_64/libsimpleperf_report.so
+++ b/simpleperf/bin/linux/x86_64/libsimpleperf_report.so
Binary files differ
diff --git a/simpleperf/bin/linux/x86_64/simpleperf b/simpleperf/bin/linux/x86_64/simpleperf
index d9a260b..3c5f0be 100755
--- a/simpleperf/bin/linux/x86_64/simpleperf
+++ b/simpleperf/bin/linux/x86_64/simpleperf
Binary files differ
diff --git a/simpleperf/bin/windows/x86/libsimpleperf_report.dll b/simpleperf/bin/windows/x86/libsimpleperf_report.dll
index f74c009..6803307 100755
--- a/simpleperf/bin/windows/x86/libsimpleperf_report.dll
+++ b/simpleperf/bin/windows/x86/libsimpleperf_report.dll
Binary files differ
diff --git a/simpleperf/bin/windows/x86/libwinpthread-1.dll b/simpleperf/bin/windows/x86/libwinpthread-1.dll
new file mode 100755
index 0000000..3aa88d7
--- /dev/null
+++ b/simpleperf/bin/windows/x86/libwinpthread-1.dll
Binary files differ
diff --git a/simpleperf/bin/windows/x86/simpleperf.exe b/simpleperf/bin/windows/x86/simpleperf.exe
index bc877fe..bcab5c1 100755
--- a/simpleperf/bin/windows/x86/simpleperf.exe
+++ b/simpleperf/bin/windows/x86/simpleperf.exe
Binary files differ
diff --git a/simpleperf/bin/windows/x86_64/libsimpleperf_report.dll b/simpleperf/bin/windows/x86_64/libsimpleperf_report.dll
index 2738d54..a3d59bb 100755
--- a/simpleperf/bin/windows/x86_64/libsimpleperf_report.dll
+++ b/simpleperf/bin/windows/x86_64/libsimpleperf_report.dll
Binary files differ
diff --git a/simpleperf/bin/windows/x86_64/libwinpthread-1.dll b/simpleperf/bin/windows/x86_64/libwinpthread-1.dll
new file mode 100755
index 0000000..b2fd346
--- /dev/null
+++ b/simpleperf/bin/windows/x86_64/libwinpthread-1.dll
Binary files differ
diff --git a/simpleperf/bin/windows/x86_64/simpleperf.exe b/simpleperf/bin/windows/x86_64/simpleperf.exe
index 1933c69..bcab5c1 100755
--- a/simpleperf/bin/windows/x86_64/simpleperf.exe
+++ b/simpleperf/bin/windows/x86_64/simpleperf.exe
Binary files differ
diff --git a/simpleperf/binary_cache_builder.py b/simpleperf/binary_cache_builder.py
index aa0e6e6..950e2fb 100644
--- a/simpleperf/binary_cache_builder.py
+++ b/simpleperf/binary_cache_builder.py
@@ -39,7 +39,7 @@
         config_names = ['perf_data_path', 'symfs_dirs', 'adb_path',
                         'readelf_path', 'binary_cache_dir']
         for name in config_names:
-            if not config.has_key(name):
+            if name not in config:
                 log_fatal('config for "%s" is missing' % name)
 
         self.perf_data_path = config.get('perf_data_path')
@@ -82,7 +82,7 @@
 
             for symbol in symbols:
                 dso_name = symbol.dso_name
-                if not binaries.has_key(dso_name):
+                if dso_name not in binaries:
                     binaries[dso_name] = lib.GetBuildIdForPath(dso_name)
         self.binaries = binaries
 
@@ -182,6 +182,7 @@
         if not self.readelf_path:
             return ""
         output = subprocess.check_output([self.readelf_path, '-n', file])
+        output = bytes_to_str(output)
         result = re.search(r'Build ID:\s*(\S+)', output)
         if result:
             build_id = result.group(1)
@@ -197,6 +198,7 @@
         if not self.readelf_path:
             return False
         output = subprocess.check_output([self.readelf_path, '-S', file])
+        output = bytes_to_str(output)
         if output.find('.symtab') != -1:
             return True
         return False
diff --git a/simpleperf/pprof_proto_generator.py b/simpleperf/pprof_proto_generator.py
index c877a16..fa2fdb1 100644
--- a/simpleperf/pprof_proto_generator.py
+++ b/simpleperf/pprof_proto_generator.py
@@ -31,7 +31,6 @@
 import profile_pb2
 import re
 import shutil
-import subprocess
 import sys
 import time
 
@@ -257,7 +256,10 @@
         self.lib = ReportLib()
 
         if config.get('binary_cache_dir'):
-            self.lib.SetSymfs(config['binary_cache_dir'])
+            if not os.path.isdir(config.get('binary_cache_dir')):
+                config['binary_cache_dir'] = ''
+            else:
+                self.lib.SetSymfs(config['binary_cache_dir'])
         if config.get('record_file'):
             self.lib.SetRecordFile(config['record_file'])
         if config.get('kallsyms'):
@@ -316,7 +318,8 @@
                 self.add_sample(sample)
 
         # 2. Generate line info for locations and functions.
-        self.gen_source_lines()
+        if self.config.get('binary_cache_dir'):
+            self.gen_source_lines()
 
         # 3. Produce samples/locations/functions in profile
         for sample in self.sample_list:
@@ -511,8 +514,12 @@
         profile_mapping.build_id = mapping.build_id_id
         profile_mapping.has_filenames = True
         profile_mapping.has_functions = True
-        profile_mapping.has_line_numbers = True
-        profile_mapping.has_inline_frames = True
+        if self.config.get('binary_cache_dir'):
+            profile_mapping.has_line_numbers = True
+            profile_mapping.has_inline_frames = True
+        else:
+            profile_mapping.has_line_numbers = False
+            profile_mapping.has_inline_frames = False
 
     def gen_profile_location(self, location):
         profile_location = self.profile.location.add()
diff --git a/simpleperf/repo.prop b/simpleperf/repo.prop
index 0cdee67..b75f2cd 100644
--- a/simpleperf/repo.prop
+++ b/simpleperf/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/simpleperf/report.py b/simpleperf/report.py
index 5ed633b..87a7c97 100644
--- a/simpleperf/report.py
+++ b/simpleperf/report.py
@@ -28,9 +28,16 @@
 import re
 import subprocess
 import sys
-from tkFont import *
-from Tkinter import *
-from ttk import *
+
+try:
+    from tkinter import *
+    from tkinter.font import Font
+    from tkinter.ttk import *
+except ImportError:
+    from Tkinter import *
+    from tkFont import Font
+    from ttk import *
+
 from utils import *
 
 PAD_X = 3
@@ -188,7 +195,7 @@
     frame = Frame(master)
     frame.pack(fill=BOTH, expand=1)
 
-    font = Font(family='courier', size=10)
+    font = Font(family='courier', size=12)
 
     # Report Context
     for line in report_context:
@@ -279,7 +286,7 @@
 def call_simpleperf_report(args, report_file):
   output_fh = open(report_file, 'w')
   simpleperf_path = get_host_binary_path('simpleperf')
-  args = [simpleperf_path, 'report'] + args
+  args = [simpleperf_path, 'report', '--full-callgraph'] + args
   subprocess.check_call(args, stdout=output_fh)
   output_fh.close()
 
diff --git a/simpleperf/simpleperf_report_lib.py b/simpleperf/simpleperf_report_lib.py
index 27ce08a..c540059 100644
--- a/simpleperf/simpleperf_report_lib.py
+++ b/simpleperf/simpleperf_report_lib.py
@@ -37,17 +37,11 @@
 
 
 def _char_pt(str):
-    if sys.version_info < (3, 0):
-        return str
-    # In python 3, str are wide strings whereas the C api expects 8 bit strings, hence we have to convert
-    # For now using utf-8 as the encoding.
-    return str.encode('utf-8')
+    return str_to_bytes(str)
 
 
 def _char_pt_to_str(char_pt):
-    if sys.version_info < (3, 0):
-        return char_pt
-    return char_pt.decode('utf-8')
+    return bytes_to_str(char_pt)
 
 
 class SampleStruct(ct.Structure):
@@ -167,14 +161,9 @@
         self.convert_to_str = (sys.version_info >= (3, 0))
 
     def _load_dependent_lib(self):
-        # As the windows dll is built with mingw we need to also find "libwinpthread-1.dll".
-        # Load it before libsimpleperf_report.dll if it does exist in the same folder as this script.
+        # As the windows dll is built with mingw we need to load "libwinpthread-1.dll".
         if is_windows():
-            libwinpthread_path = os.path.join(get_script_dir(), "libwinpthread-1.dll")
-            if os.path.exists(libwinpthread_path):
-                self._libwinpthread = ct.CDLL(libwinpthread_path)
-            else:
-                log_fatal('%s is missing' % libwinpthread_path)
+            self._libwinpthread = ct.CDLL(get_host_binary_path('libwinpthread-1.dll'))
 
     def Close(self):
         if self._instance is None:
diff --git a/simpleperf/utils.py b/simpleperf/utils.py
index ab76c3f..a0b3b3b 100644
--- a/simpleperf/utils.py
+++ b/simpleperf/utils.py
@@ -31,6 +31,9 @@
 def is_windows():
     return sys.platform == 'win32' or sys.platform == 'cygwin'
 
+def is_python3():
+    return sys.version_info >= (3, 0)
+
 
 def log_debug(msg):
     logging.debug(msg)
@@ -47,6 +50,17 @@
 def log_fatal(msg):
     raise Exception(msg)
 
+def str_to_bytes(str):
+    if not is_python3():
+        return str
+    # In python 3, str are wide strings whereas the C api expects 8 bit strings, hence we have to convert
+    # For now using utf-8 as the encoding.
+    return str.encode('utf-8')
+
+def bytes_to_str(bytes):
+    if not is_python3():
+        return bytes
+    return bytes.decode('utf-8')
 
 def get_target_binary_path(arch, binary_name):
     if arch == 'aarch64':
@@ -65,6 +79,8 @@
     if is_windows():
         if binary_name.endswith('.so'):
             binary_name = binary_name[0:-3] + '.dll'
+        elif binary_name.find('.') == -1:
+            binary_name += '.exe'
         dir = os.path.join(dir, 'windows')
     elif sys.platform == 'darwin': # OSX
         if binary_name.endswith('.so'):
@@ -88,24 +104,30 @@
         return self.run_and_return_output(adb_args)[0]
 
 
-    def run_and_return_output(self, adb_args):
+    def run_and_return_output(self, adb_args, stdout_file=None):
         adb_args = [self.adb_path] + adb_args
         log_debug('run adb cmd: %s' % adb_args)
-        subproc = subprocess.Popen(adb_args, stdout=subprocess.PIPE)
-        (stdoutdata, _) = subproc.communicate()
-        result = (subproc.returncode == 0)
+        if stdout_file:
+            with open(stdout_file, 'wb') as stdout_fh:
+                returncode = subprocess.call(adb_args, stdout=stdout_fh)
+            stdoutdata = ''
+        else:
+            subproc = subprocess.Popen(adb_args, stdout=subprocess.PIPE)
+            (stdoutdata, _) = subproc.communicate()
+            returncode = subproc.returncode
+        result = (returncode == 0)
         if stdoutdata:
+            stdoutdata = bytes_to_str(stdoutdata)
             log_debug(stdoutdata)
         log_debug('run adb cmd: %s  [result %s]' % (adb_args, result))
         return (result, stdoutdata)
 
-
     def check_run(self, adb_args):
         self.check_run_and_return_output(adb_args)
 
 
-    def check_run_and_return_output(self, adb_args):
-        result, stdoutdata = self.run_and_return_output(adb_args)
+    def check_run_and_return_output(self, adb_args, stdout_file=None):
+        result, stdoutdata = self.run_and_return_output(adb_args, stdout_file)
         if not result:
             log_fatal('run "adb %s" failed' % adb_args)
         return stdoutdata
@@ -141,7 +163,12 @@
     if not os.path.exists(config_file):
         log_fatal("can't find config_file: %s" % config_file)
     config = {}
-    execfile(config_file, config)
+    if is_python3():
+        with open(config_file, 'r') as fh:
+            source = fh.read()
+            exec(source, config)
+    else:
+        execfile(config_file, config)
     return config
 
 
diff --git a/source.properties b/source.properties
index e285348..4061f88 100644
--- a/source.properties
+++ b/source.properties
@@ -1,2 +1,2 @@
 Pkg.Desc = Android NDK
-Pkg.Revision = 15.1.4113355
+Pkg.Revision = 15.2.4203891
diff --git a/sources/android/cpufeatures/repo.prop b/sources/android/cpufeatures/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/android/cpufeatures/repo.prop
+++ b/sources/android/cpufeatures/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/android/native_app_glue/repo.prop b/sources/android/native_app_glue/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/android/native_app_glue/repo.prop
+++ b/sources/android/native_app_glue/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/android/ndk_helper/repo.prop b/sources/android/ndk_helper/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/android/ndk_helper/repo.prop
+++ b/sources/android/ndk_helper/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/android/renderscript/repo.prop b/sources/android/renderscript/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/android/renderscript/repo.prop
+++ b/sources/android/renderscript/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/android/support/repo.prop b/sources/android/support/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/android/support/repo.prop
+++ b/sources/android/support/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/cxx-stl/gabi++/repo.prop b/sources/cxx-stl/gabi++/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/cxx-stl/gabi++/repo.prop
+++ b/sources/cxx-stl/gabi++/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_shared.so
index 3ecb514..4d772d7 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_static.a
index 71784f3..5ea12ec 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libsupc++.a
index ab0eb78..e631105 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so
index fac1822..a6b58f1 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a
index 395a22f..b31c9c8 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a
index fbbcf40..ae5e5a6 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_shared.so
index 1c09486..1817024 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a
index 6c6aa9d..0ec7ffc 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libsupc++.a
index 18bedee..2ff0d44 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_shared.so
index 2c28684..3a194ba 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_static.a
index e5eb935..720dae5 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libsupc++.a
index 441a63f..3e7e5c8 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_shared.so
index dce60f6..423aab7 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_static.a
index 90ed064..3275618 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libsupc++.a
index e231c46..9b98e6e 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips64/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_shared.so
index 4724d1b..5e14df6 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a
index e66965c..c234b29 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libsupc++.a
index 5a72f15..0369bc6 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_shared.so b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_shared.so
index 49086d6..a36eb13 100755
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_shared.so
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_shared.so
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_static.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_static.a
index 232b474..f091d64 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_static.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_static.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libsupc++.a b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libsupc++.a
index 93047f9..4c35f4c 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libsupc++.a
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libsupc++.a
Binary files differ
diff --git a/sources/cxx-stl/gnu-libstdc++/4.9/repo.prop b/sources/cxx-stl/gnu-libstdc++/4.9/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/cxx-stl/gnu-libstdc++/4.9/repo.prop
+++ b/sources/cxx-stl/gnu-libstdc++/4.9/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/cxx-stl/llvm-libc++/repo.prop b/sources/cxx-stl/llvm-libc++/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/cxx-stl/llvm-libc++/repo.prop
+++ b/sources/cxx-stl/llvm-libc++/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/cxx-stl/llvm-libc++/test/lit.site.cfg b/sources/cxx-stl/llvm-libc++/test/lit.site.cfg
index d8b51fa..c9dbdfb 100644
--- a/sources/cxx-stl/llvm-libc++/test/lit.site.cfg
+++ b/sources/cxx-stl/llvm-libc++/test/lit.site.cfg
@@ -1,40 +1,12 @@
 import os
-import sys
 
-# Tell pylint that we know config and lit_config exist somewhere.
-if 'PYLINT_IMPORT' in os.environ:
-    config = object()
-    lit_config = object()
+config.configuration_variant = 'libcxx.android'
+config.android_root = os.getenv('ANDROID_BUILD_TOP')
+config.libcxx_src_root = os.path.join(config.android_root, 'external/libcxx')
+config.python_executable = '/usr/bin/python'
 
-ndk = os.getenv('NDK')
-if ndk is None:
-    sys.exit('The environment variable NDK must point to an NDK toolchain.')
-
-top = os.getenv('ANDROID_BUILD_TOP')
-libcxx_dir = os.path.join(ndk, 'sources/cxx-stl/llvm-libc++')
-
-config.cxx_under_test = os.path.join(
-    ndk, "toolchains/llvm/prebuilt/linux-x86_64/bin/clang++")
-config.std = "c++11"
-config.libcxx_src_root = libcxx_dir
-config.libcxx_obj_root = libcxx_dir
-config.cxx_library_root = os.path.join(libcxx_dir, 'libs/armeabi-v7a')
-config.enable_exceptions = "True"
-config.enable_rtti = "True"
-config.enable_shared = "False"
-config.enable_32bit = "False"
-config.enable_threads = "True"
-config.enable_monotonic_clock = "True"
-config.cxx_abi = "libcxxabi"
-config.use_sanitizer = ""
-config.configuration_variant = "libcxx.ndk"
-config.target_triple = "arm-linux-androideabi"
-config.use_pie = "False"
-config.target_api = 9
-config.arch = "arm"
-config.gcc_toolchain = os.path.join(
-    ndk, "toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64")
+config.timeout = '300'
 
 # Let the main config do the real work.
 lit_config.load_config(
-    config, os.path.join(libcxx_dir, "test/lit.cfg"))
+    config, os.path.join(config.libcxx_src_root, 'test/lit.cfg'))
diff --git a/sources/cxx-stl/llvm-libc++abi/repo.prop b/sources/cxx-stl/llvm-libc++abi/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/cxx-stl/llvm-libc++abi/repo.prop
+++ b/sources/cxx-stl/llvm-libc++abi/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_shared.so b/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_shared.so
index 8c18133..c5a3c06 100755
--- a/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_static.a b/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_static.a
index bcf94eb..fd66926 100644
--- a/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/arm64-v8a/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_shared.so b/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_shared.so
index 9d40f05..3ac62b1 100755
--- a/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a b/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a
index a871a1d..b56325c 100644
--- a/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so b/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so
index 714cfe8..f9dd2c3 100755
--- a/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/armeabi/libstlport_static.a b/sources/cxx-stl/stlport/libs/armeabi/libstlport_static.a
index abbbfaf..8dc5775 100644
--- a/sources/cxx-stl/stlport/libs/armeabi/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/armeabi/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/mips/libstlport_shared.so b/sources/cxx-stl/stlport/libs/mips/libstlport_shared.so
index 5073328..372c2ae 100755
--- a/sources/cxx-stl/stlport/libs/mips/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/mips/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/mips/libstlport_static.a b/sources/cxx-stl/stlport/libs/mips/libstlport_static.a
index 450b7f1..5ebc22a 100644
--- a/sources/cxx-stl/stlport/libs/mips/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/mips/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/mips64/libstlport_shared.so b/sources/cxx-stl/stlport/libs/mips64/libstlport_shared.so
index acf10f1..5cd3fa7 100755
--- a/sources/cxx-stl/stlport/libs/mips64/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/mips64/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/mips64/libstlport_static.a b/sources/cxx-stl/stlport/libs/mips64/libstlport_static.a
index d2896ea..8bf1728 100644
--- a/sources/cxx-stl/stlport/libs/mips64/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/mips64/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so b/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so
index c6ed6e8..aabbc4b 100755
--- a/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/x86/libstlport_static.a b/sources/cxx-stl/stlport/libs/x86/libstlport_static.a
index d43e72a..1faf421 100644
--- a/sources/cxx-stl/stlport/libs/x86/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/x86/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/x86_64/libstlport_shared.so b/sources/cxx-stl/stlport/libs/x86_64/libstlport_shared.so
index 6978b68..8cc2473 100755
--- a/sources/cxx-stl/stlport/libs/x86_64/libstlport_shared.so
+++ b/sources/cxx-stl/stlport/libs/x86_64/libstlport_shared.so
Binary files differ
diff --git a/sources/cxx-stl/stlport/libs/x86_64/libstlport_static.a b/sources/cxx-stl/stlport/libs/x86_64/libstlport_static.a
index 7e0054b..a91baec 100644
--- a/sources/cxx-stl/stlport/libs/x86_64/libstlport_static.a
+++ b/sources/cxx-stl/stlport/libs/x86_64/libstlport_static.a
Binary files differ
diff --git a/sources/cxx-stl/stlport/repo.prop b/sources/cxx-stl/stlport/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/cxx-stl/stlport/repo.prop
+++ b/sources/cxx-stl/stlport/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/cxx-stl/system/repo.prop b/sources/cxx-stl/system/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/cxx-stl/system/repo.prop
+++ b/sources/cxx-stl/system/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/third_party/googletest/repo.prop b/sources/third_party/googletest/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/third_party/googletest/repo.prop
+++ b/sources/third_party/googletest/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/third_party/shaderc/repo.prop b/sources/third_party/shaderc/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/third_party/shaderc/repo.prop
+++ b/sources/third_party/shaderc/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sources/third_party/vulkan/repo.prop b/sources/third_party/vulkan/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sources/third_party/vulkan/repo.prop
+++ b/sources/third_party/vulkan/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sysroot/repo.prop b/sysroot/repo.prop
index 0cdee67..b75f2cd 100644
--- a/sysroot/repo.prop
+++ b/sysroot/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1
diff --git a/sysroot/usr/include/android/asset_manager.h b/sysroot/usr/include/android/asset_manager.h
index 7ef3ecb..2ac7d4d 100644
--- a/sysroot/usr/include/android/asset_manager.h
+++ b/sysroot/usr/include/android/asset_manager.h
@@ -33,6 +33,10 @@
 extern "C" {
 #endif
 
+#if !defined(__ANDROID__) && !defined(__RENAME_IF_FILE_OFFSET64)
+#define __RENAME_IF_FILE_OFFSET64(x)
+#endif
+
 struct AAssetManager;
 /**
  * {@link AAssetManager} provides access to an application's raw assets by
@@ -132,9 +136,9 @@
  *
  * Returns the new position on success, or (off_t) -1 on error.
  */
-off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
+off_t AAsset_seek(AAsset* asset, off_t offset, int whence)
+    __RENAME_IF_FILE_OFFSET64(AAsset_seek64);
 
-#if __ANDROID_API__ >= 13
 /**
  * Seek to the specified offset within the asset data.  'whence' uses the
  * same constants as lseek()/fseek().
@@ -145,7 +149,6 @@
  * Returns the new position on success, or (off64_t) -1 on error.
  */
 off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence);
-#endif
 
 /**
  * Close the asset, freeing all associated resources.
@@ -162,29 +165,27 @@
 /**
  * Report the total size of the asset data.
  */
-off_t AAsset_getLength(AAsset* asset);
+off_t AAsset_getLength(AAsset* asset)
+    __RENAME_IF_FILE_OFFSET64(AAsset_getLength64);
 
-#if __ANDROID_API__ >= 13
 /**
  * Report the total size of the asset data. Reports the size using a 64-bit
  * number insted of 32-bit as AAsset_getLength.
  */
 off64_t AAsset_getLength64(AAsset* asset);
-#endif
 
 /**
  * Report the total amount of asset data that can be read from the current position.
  */
-off_t AAsset_getRemainingLength(AAsset* asset);
+off_t AAsset_getRemainingLength(AAsset* asset)
+    __RENAME_IF_FILE_OFFSET64(AAsset_getRemainingLength64);
 
-#if __ANDROID_API__ >= 13
 /**
  * Report the total amount of asset data that can be read from the current position.
  *
  * Uses a 64-bit number instead of a 32-bit number as AAsset_getRemainingLength does.
  */
 off64_t AAsset_getRemainingLength64(AAsset* asset);
-#endif
 
 /**
  * Open a new file descriptor that can be used to read the asset data. If the
@@ -194,9 +195,9 @@
  * Returns < 0 if direct fd access is not possible (for example, if the asset is
  * compressed).
  */
-int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
+int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength)
+    __RENAME_IF_FILE_OFFSET64(AAsset_openFileDescriptor64);
 
-#if __ANDROID_API__ >= 13
 /**
  * Open a new file descriptor that can be used to read the asset data.
  *
@@ -207,7 +208,6 @@
  * compressed).
  */
 int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength);
-#endif
 
 /**
  * Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not
diff --git a/sysroot/usr/include/android/legacy_strings_inlines.h b/sysroot/usr/include/android/legacy_strings_inlines.h
new file mode 100644
index 0000000..6679c30
--- /dev/null
+++ b/sysroot/usr/include/android/legacy_strings_inlines.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _ANDROID_LEGACY_STRINGS_INLINES_H_
+#define _ANDROID_LEGACY_STRINGS_INLINES_H_
+
+#include <strings.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#if defined(__i386__) && __ANDROID_API__ < __ANDROID_API_J_MR2__
+/* Everyone except x86 had ffs since the beginning. */
+static __inline int ffs(int __n) { return __builtin_ffs(__n); }
+#endif
+
+__END_DECLS
+
+#endif
diff --git a/sysroot/usr/include/android/legacy_termios_inlines.h b/sysroot/usr/include/android/legacy_termios_inlines.h
index 02e9429..4ed56f0 100644
--- a/sysroot/usr/include/android/legacy_termios_inlines.h
+++ b/sysroot/usr/include/android/legacy_termios_inlines.h
@@ -36,74 +36,8 @@
 #include <linux/termios.h>
 
 #if __ANDROID_API__ < __ANDROID_API_L__
-
-__BEGIN_DECLS
-
-static __inline int tcgetattr(int fd, struct termios *s) {
-  return ioctl(fd, TCGETS, s);
-}
-
-static __inline int tcsetattr(int fd, int __opt, const struct termios *s) {
-  return ioctl(fd, __opt, (void *)s);
-}
-
-static __inline int tcflow(int fd, int action) {
-  return ioctl(fd, TCXONC, (void *)(intptr_t)action);
-}
-
-static __inline int tcflush(int fd, int __queue) {
-  return ioctl(fd, TCFLSH, (void *)(intptr_t)__queue);
-}
-
-static __inline pid_t tcgetsid(int fd) {
-  pid_t _pid;
-  return ioctl(fd, TIOCGSID, &_pid) ? (pid_t)-1 : _pid;
-}
-
-static __inline int tcsendbreak(int fd, int __duration) {
-  return ioctl(fd, TCSBRKP, (void *)(uintptr_t)__duration);
-}
-
-static __inline speed_t cfgetospeed(const struct termios *s) {
-  return (speed_t)(s->c_cflag & CBAUD);
-}
-
-static __inline int cfsetospeed(struct termios *s, speed_t speed) {
-  s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
-  return 0;
-}
-
-static __inline speed_t cfgetispeed(const struct termios *s) {
-  return (speed_t)(s->c_cflag & CBAUD);
-}
-
-static __inline int cfsetispeed(struct termios *s, speed_t speed) {
-  s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
-  return 0;
-}
-
-static __inline void cfmakeraw(struct termios *s) {
-  s->c_iflag &=
-      ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
-  s->c_oflag &= ~OPOST;
-  s->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
-  s->c_cflag &= ~(CSIZE | PARENB);
-  s->c_cflag |= CS8;
-}
-
-static __inline int cfsetspeed(struct termios* s, speed_t speed) {
-  // TODO: check 'speed' is valid.
-  s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
-  return 0;
-}
-
-static __inline int tcdrain(int fd) {
-  // A non-zero argument to TCSBRK means "don't send a break".
-  // The drain is a side-effect of the ioctl!
-  return ioctl(fd, TCSBRK, __BIONIC_CAST(static_cast, unsigned long, 1));
-}
-
-__END_DECLS
-
+#define __BIONIC_TERMIOS_INLINE static __inline
+#include <bits/termios_inlines.h>
 #endif
+
 #endif /* _ANDROID_LEGACY_TERMIOS_INLINES_H_ */
diff --git a/sysroot/usr/include/android/sensor.h b/sysroot/usr/include/android/sensor.h
index 97b4a2a..7f46087 100644
--- a/sysroot/usr/include/android/sensor.h
+++ b/sysroot/usr/include/android/sensor.h
@@ -381,8 +381,13 @@
  *     ASensorManager* sensorManager = ASensorManager_getInstance();
  *
  */
+#if __ANDROID_API__ >= __ANDROID_API_O__
 __attribute__ ((deprecated)) ASensorManager* ASensorManager_getInstance();
+#else
+ASensorManager* ASensorManager_getInstance();
+#endif
 
+#if __ANDROID_API__ >= __ANDROID_API_O__
 /*
  * Get a reference to the sensor manager. ASensorManager is a singleton
  * per package as different packages may have access to different sensors.
@@ -393,6 +398,7 @@
  *
  */
 ASensorManager* ASensorManager_getInstanceForPackage(const char* packageName);
+#endif
 
 /**
  * Returns the list of available sensors.
diff --git a/sysroot/usr/include/bits/lockf.h b/sysroot/usr/include/bits/lockf.h
index 5222910..4594373 100644
--- a/sysroot/usr/include/bits/lockf.h
+++ b/sysroot/usr/include/bits/lockf.h
@@ -40,7 +40,11 @@
 __BEGIN_DECLS
 
 #if defined(__USE_FILE_OFFSET64)
-int lockf(int, int, off_t) __RENAME(lockf64);
+
+#if __ANDROID_API__ >= 24
+int lockf(int, int, off_t) __RENAME(lockf64) __INTRODUCED_IN(24);
+#endif /* __ANDROID_API__ >= 24 */
+
 #else
 
 #if __ANDROID_API__ >= 24
diff --git a/sysroot/usr/include/bits/termios_inlines.h b/sysroot/usr/include/bits/termios_inlines.h
new file mode 100644
index 0000000..d49167e
--- /dev/null
+++ b/sysroot/usr/include/bits/termios_inlines.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _BITS_TERMIOS_INLINES_H_
+#define _BITS_TERMIOS_INLINES_H_
+
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+
+#include <linux/termios.h>
+
+#if !defined(__BIONIC_TERMIOS_INLINE)
+#define __BIONIC_TERMIOS_INLINE static __inline
+#endif
+
+__BEGIN_DECLS
+
+static __inline speed_t cfgetspeed(const struct termios* s) {
+  return __BIONIC_CAST(static_cast, speed_t, s->c_cflag & CBAUD);
+}
+
+__BIONIC_TERMIOS_INLINE speed_t cfgetispeed(const struct termios* s) {
+  return cfgetspeed(s);
+}
+
+__BIONIC_TERMIOS_INLINE speed_t cfgetospeed(const struct termios* s) {
+  return cfgetspeed(s);
+}
+
+__BIONIC_TERMIOS_INLINE void cfmakeraw(struct termios* s) {
+  s->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+  s->c_oflag &= ~OPOST;
+  s->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+  s->c_cflag &= ~(CSIZE|PARENB);
+  s->c_cflag |= CS8;
+}
+
+__BIONIC_TERMIOS_INLINE int cfsetspeed(struct termios* s, speed_t speed) {
+  // TODO: check 'speed' is valid.
+  s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
+  return 0;
+}
+
+__BIONIC_TERMIOS_INLINE int cfsetispeed(struct termios* s, speed_t speed) {
+  return cfsetspeed(s, speed);
+}
+
+__BIONIC_TERMIOS_INLINE int cfsetospeed(struct termios* s, speed_t speed) {
+  return cfsetspeed(s, speed);
+}
+
+__BIONIC_TERMIOS_INLINE int tcdrain(int fd) {
+  // A non-zero argument to TCSBRK means "don't send a break".
+  // The drain is a side-effect of the ioctl!
+  return ioctl(fd, TCSBRK, __BIONIC_CAST(static_cast, unsigned long, 1));
+}
+
+__BIONIC_TERMIOS_INLINE int tcflow(int fd, int action) {
+  return ioctl(fd, TCXONC, __BIONIC_CAST(static_cast, unsigned long, action));
+}
+
+__BIONIC_TERMIOS_INLINE int tcflush(int fd, int queue) {
+  return ioctl(fd, TCFLSH, __BIONIC_CAST(static_cast, unsigned long, queue));
+}
+
+__BIONIC_TERMIOS_INLINE int tcgetattr(int fd, struct termios* s) {
+  return ioctl(fd, TCGETS, s);
+}
+
+__BIONIC_TERMIOS_INLINE pid_t tcgetsid(int fd) {
+  pid_t sid;
+  return (ioctl(fd, TIOCGSID, &sid) == -1) ? -1 : sid;
+}
+
+__BIONIC_TERMIOS_INLINE int tcsendbreak(int fd, int duration) {
+  return ioctl(fd, TCSBRKP, __BIONIC_CAST(static_cast, unsigned long, duration));
+}
+
+__BIONIC_TERMIOS_INLINE int tcsetattr(int fd, int optional_actions, const struct termios* s) {
+  int cmd;
+  switch (optional_actions) {
+    case TCSANOW: cmd = TCSETS; break;
+    case TCSADRAIN: cmd = TCSETSW; break;
+    case TCSAFLUSH: cmd = TCSETSF; break;
+    default: errno = EINVAL; return -1;
+  }
+  return ioctl(fd, cmd, s);
+}
+
+__END_DECLS
+
+#endif
diff --git a/sysroot/usr/include/media/NdkMediaCodec.h b/sysroot/usr/include/media/NdkMediaCodec.h
index 637bf9b..7e7e81e 100644
--- a/sysroot/usr/include/media/NdkMediaCodec.h
+++ b/sysroot/usr/include/media/NdkMediaCodec.h
@@ -27,6 +27,7 @@
 #ifndef _NDK_MEDIA_CODEC_H
 #define _NDK_MEDIA_CODEC_H
 
+#include <stdint.h>
 #include <sys/cdefs.h>
 
 #include "NdkMediaCrypto.h"
@@ -130,17 +131,45 @@
  */
 ssize_t AMediaCodec_dequeueInputBuffer(AMediaCodec*, int64_t timeoutUs);
 
-/**
- * Send the specified buffer to the codec for processing.
+/*
+ * __USE_FILE_OFFSET64 changes the type of off_t in LP32, which changes the ABI
+ * of these declarations to  not match the platform. In that case, define these
+ * APIs in terms of int32_t instead. Passing an off_t in this situation will
+ * result in silent truncation unless the user builds with -Wconversion, but the
+ * only alternative it to not expose them at all for this configuration, which
+ * makes the whole API unusable.
+ *
+ * https://github.com/android-ndk/ndk/issues/459
  */
-media_status_t AMediaCodec_queueInputBuffer(AMediaCodec*,
-        size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags);
+#if defined(__USE_FILE_OFFSET64) && !defined(__LP64__)
+#define _off_t_compat int32_t
+#else
+#define _off_t_compat off_t
+#endif  /* defined(__USE_FILE_OFFSET64) && !defined(__LP64__) */
+
+#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
+    __STDC_VERSION__ >= 201112L
+static_assert(sizeof(_off_t_compat) == sizeof(long),
+              "_off_t_compat does not match the NDK ABI. See "
+              "https://github.com/android-ndk/ndk/issues/459.");
+#endif
 
 /**
  * Send the specified buffer to the codec for processing.
  */
-media_status_t AMediaCodec_queueSecureInputBuffer(AMediaCodec*,
-        size_t idx, off_t offset, AMediaCodecCryptoInfo*, uint64_t time, uint32_t flags);
+media_status_t AMediaCodec_queueInputBuffer(AMediaCodec*, size_t idx,
+                                            _off_t_compat offset, size_t size,
+                                            uint64_t time, uint32_t flags);
+
+/**
+ * Send the specified buffer to the codec for processing.
+ */
+media_status_t AMediaCodec_queueSecureInputBuffer(AMediaCodec*, size_t idx,
+                                                  _off_t_compat offset,
+                                                  AMediaCodecCryptoInfo*,
+                                                  uint64_t time, uint32_t flags);
+
+#undef _off_t_compat
 
 /**
  * Get the index of the next available buffer of processed data.
diff --git a/sysroot/usr/include/pthread.h b/sysroot/usr/include/pthread.h
index 131ad82..cecdee4 100644
--- a/sysroot/usr/include/pthread.h
+++ b/sysroot/usr/include/pthread.h
@@ -182,14 +182,22 @@
 
 #if defined(__LP32__) && __ANDROID_API__ < 21
 /*
- * Cruft for supporting old API levels. Pre-L we didn't have
- * pthread_mutex_timedlock, instead we had pthread_mutex_lock_timeout_np. NDK
- * users targeting pre-L still need this, but anyone targeting L or newer (or
- * LP64 code) should just use pthread_mutex_timedlock.
+ * Cruft for supporting old API levels. Pre-L we didn't have the proper POSIX
+ * APIs for things, but instead had some locally grown, artisan equivalents.
+ * Keep exposing the old prototypes on old API levels so we don't regress
+ * functionality.
  *
- * https://github.com/android-ndk/ndk/issues/420
+ * See the following bugs:
+ *  * https://github.com/android-ndk/ndk/issues/420
+ *  * https://github.com/android-ndk/ndk/issues/423
+ *  * https://stackoverflow.com/q/44580542/632035
  */
+
 int pthread_mutex_lock_timeout_np(pthread_mutex_t* mutex, unsigned msecs);
+int pthread_cond_timeout_np(pthread_cond_t* cond, pthread_mutex_t* mutex, unsigned msecs);
+int pthread_cond_timedwait_monotonic_np(pthread_cond_t*, pthread_mutex_t*, const struct timespec*);
+int pthread_cond_timedwait_relative_np(pthread_cond_t* cond, pthread_mutex_t* mutex,
+                                       const struct timespec* reltime);
 #endif
 
 int pthread_once(pthread_once_t* _Nonnull, void (* _Nonnull init_routine)(void));
diff --git a/sysroot/usr/include/stdio.h b/sysroot/usr/include/stdio.h
index 7f8ad3c..77009a4 100644
--- a/sysroot/usr/include/stdio.h
+++ b/sysroot/usr/include/stdio.h
@@ -184,17 +184,25 @@
 int fseek(FILE*, long, int);
 long ftell(FILE*);
 
-#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= __ANDROID_API_N__
-int fgetpos(FILE*, fpos_t*) __RENAME(fgetpos64);
-int fsetpos(FILE*, const fpos_t*) __RENAME(fsetpos64);
-int fseeko(FILE*, off_t, int) __RENAME(fseeko64);
-off_t ftello(FILE*) __RENAME(ftello64);
+#if defined(__USE_FILE_OFFSET64)
+
+#if __ANDROID_API__ >= 24
+int fgetpos(FILE*, fpos_t*) __RENAME(fgetpos64) __INTRODUCED_IN(24);
+int fsetpos(FILE*, const fpos_t*) __RENAME(fsetpos64) __INTRODUCED_IN(24);
+int fseeko(FILE*, off_t, int) __RENAME(fseeko64) __INTRODUCED_IN(24);
+off_t ftello(FILE*) __RENAME(ftello64) __INTRODUCED_IN(24);
+#endif /* __ANDROID_API__ >= 24 */
+
 #  if defined(__USE_BSD)
+
+#if __ANDROID_API__ >= 24
 FILE* funopen(const void*,
               int (*)(void*, char*, int),
               int (*)(void*, const char*, int),
               fpos_t (*)(void*, fpos_t, int),
-              int (*)(void*)) __RENAME(funopen64);
+              int (*)(void*)) __RENAME(funopen64) __INTRODUCED_IN(24);
+#endif /* __ANDROID_API__ >= 24 */
+
 #  endif
 #else
 int fgetpos(FILE*, fpos_t*);
diff --git a/sysroot/usr/include/stdlib.h b/sysroot/usr/include/stdlib.h
index 6372b62..8740ad2 100644
--- a/sysroot/usr/include/stdlib.h
+++ b/sysroot/usr/include/stdlib.h
@@ -281,12 +281,12 @@
 // Implemented as static inlines before 21.
 #endif
 
-#if __ANDROID_API__ >= __ANDROID_API_FUTURE__
+#if __ANDROID_API__ >= __ANDROID_API_O__
 double strtod_l(const char*, char**, locale_t) __INTRODUCED_IN(26);
 float strtof_l(const char*, char**, locale_t) __INTRODUCED_IN(26);
 long strtol_l(const char*, char**, int, locale_t) __INTRODUCED_IN(26);
 #else
-// Implemented as static inlines.
+// Implemented as static inlines before 26.
 #endif
 
 __END_DECLS
diff --git a/sysroot/usr/include/strings.h b/sysroot/usr/include/strings.h
index 47070e5..11f3213 100644
--- a/sysroot/usr/include/strings.h
+++ b/sysroot/usr/include/strings.h
@@ -54,12 +54,12 @@
 #define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
 #endif
 
-
-#if (defined(__LP64__)) || (defined(__mips__)) || (defined(__arm__)) || (defined(__i386__) && __ANDROID_API__ >= 18)
+#if !defined(__i386__) || __ANDROID_API__ >= __ANDROID_API_J_MR2__
 int ffs(int) __INTRODUCED_IN_X86(18);
-#endif /* (defined(__LP64__)) || (defined(__mips__)) || (defined(__arm__)) || (defined(__i386__) && __ANDROID_API__ >= 18) */
-
+#endif
 
 __END_DECLS
 
+#include <android/legacy_strings_inlines.h>
+
 #endif /* !defined(_STRINGS_H_) */
diff --git a/sysroot/usr/include/sys/cdefs.h b/sysroot/usr/include/sys/cdefs.h
index d62206d..307545c 100644
--- a/sysroot/usr/include/sys/cdefs.h
+++ b/sysroot/usr/include/sys/cdefs.h
@@ -235,10 +235,11 @@
 #endif
 
 /* _FILE_OFFSET_BITS 64 support. */
-#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS)
-#if _FILE_OFFSET_BITS == 64
+#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
 #define __USE_FILE_OFFSET64 1
-#endif
+#define __RENAME_IF_FILE_OFFSET64(func) __RENAME(func)
+#else
+#define __RENAME_IF_FILE_OFFSET64(func)
 #endif
 
 #define  __BIONIC__   1
diff --git a/sysroot/usr/include/sys/mman.h b/sysroot/usr/include/sys/mman.h
index cdaada0..a7ba31b 100644
--- a/sysroot/usr/include/sys/mman.h
+++ b/sysroot/usr/include/sys/mman.h
@@ -43,8 +43,12 @@
 #define MREMAP_MAYMOVE  1
 #define MREMAP_FIXED    2
 
-#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= __ANDROID_API_L__
+#if defined(__USE_FILE_OFFSET64)
+
+#if __ANDROID_API__ >= 21
 void* mmap(void*, size_t, int, int, int, off_t) __RENAME(mmap64) __INTRODUCED_IN(21);
+#endif /* __ANDROID_API__ >= 21 */
+
 #else
 void* mmap(void*, size_t, int, int, int, off_t);
 #endif
@@ -79,7 +83,7 @@
  * Some third-party code uses the existence of POSIX_MADV_NORMAL to detect the
  * availability of posix_madvise. This is not correct, since having up-to-date
  * UAPI headers says nothing about the C library, but for the time being we
- * don't want to harm adoption to the unified headers.
+ * don't want to harm adoption of the unified headers.
  *
  * https://github.com/android-ndk/ndk/issues/395
  */
diff --git a/sysroot/usr/include/sys/sendfile.h b/sysroot/usr/include/sys/sendfile.h
index e7197b3..c451f7d 100644
--- a/sysroot/usr/include/sys/sendfile.h
+++ b/sysroot/usr/include/sys/sendfile.h
@@ -34,9 +34,12 @@
 
 __BEGIN_DECLS
 
-#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= __ANDROID_API_L__
-ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) __RENAME(sendfile64)
-  __INTRODUCED_IN(21);
+#if defined(__USE_FILE_OFFSET64)
+
+#if __ANDROID_API__ >= 21
+ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) __RENAME(sendfile64) __INTRODUCED_IN(21);
+#endif /* __ANDROID_API__ >= 21 */
+
 #else
 ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
 #endif
diff --git a/sysroot/usr/include/sys/uio.h b/sysroot/usr/include/sys/uio.h
index fb2701f..4f4a7ca 100644
--- a/sysroot/usr/include/sys/uio.h
+++ b/sysroot/usr/include/sys/uio.h
@@ -39,8 +39,12 @@
 
 #if defined(__USE_GNU)
 #if defined(__USE_FILE_OFFSET64)
-ssize_t preadv(int, const struct iovec*, int, off_t) __RENAME(preadv64);
-ssize_t pwritev(int, const struct iovec*, int, off_t) __RENAME(pwritev64);
+
+#if __ANDROID_API__ >= 24
+ssize_t preadv(int, const struct iovec*, int, off_t) __RENAME(preadv64) __INTRODUCED_IN(24);
+ssize_t pwritev(int, const struct iovec*, int, off_t) __RENAME(pwritev64) __INTRODUCED_IN(24);
+#endif /* __ANDROID_API__ >= 24 */
+
 #else
 
 #if __ANDROID_API__ >= 24
diff --git a/sysroot/usr/include/unistd.h b/sysroot/usr/include/unistd.h
index 7d4a803..3ec931a 100644
--- a/sysroot/usr/include/unistd.h
+++ b/sysroot/usr/include/unistd.h
@@ -201,13 +201,21 @@
 
 off64_t lseek64(int __fd, off64_t __offset, int __whence);
 
-#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= __ANDROID_API_L__
+#if defined(__USE_FILE_OFFSET64)
+
+#if __ANDROID_API__ >= 21
 int truncate(const char* __path, off_t __length) __RENAME(truncate64) __INTRODUCED_IN(21);
+#endif /* __ANDROID_API__ >= 21 */
+
+
+#if __ANDROID_API__ >= 12
 ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset)
   __overloadable __RENAME(pread64) __INTRODUCED_IN(12);
 ssize_t pwrite(int __fd, const void* __buf, size_t __count, off_t __offset)
   __overloadable __RENAME(pwrite64) __INTRODUCED_IN(12);
 int ftruncate(int __fd, off_t __length) __RENAME(ftruncate64) __INTRODUCED_IN(12);
+#endif /* __ANDROID_API__ >= 12 */
+
 #else
 int truncate(const char* __path, off_t __length);
 ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset)
diff --git a/toolchains/renderscript/prebuilt/linux-x86_64/repo.prop b/toolchains/renderscript/prebuilt/linux-x86_64/repo.prop
index 0cdee67..b75f2cd 100644
--- a/toolchains/renderscript/prebuilt/linux-x86_64/repo.prop
+++ b/toolchains/renderscript/prebuilt/linux-x86_64/repo.prop
@@ -11,7 +11,7 @@
 platform/external/shaderc/spirv-tools cdf7d311f76879d6bb7346384d6f60aec67d52b8
 platform/external/vulkan-validation-layers ea04d8a697116044ba085f678ec98438883bfc7c
 platform/manifest 49bd41084d862834be0ff802e4aff81936fba9cf
-platform/ndk 99be4579a475eed05f8d8ea7048fcea1cb640108
+platform/ndk ab5ba377dd6beb8f8aceccad0b96607a3a679366
 platform/prebuilts/clang/host/darwin-x86 3f290e47786b558ff0d9e934327ad77a5d6cf9c0
 platform/prebuilts/clang/host/linux-x86 bc064d0cee56d96d74048ad633c9615051f7a847
 platform/prebuilts/clang/host/windows-x86 35d96b57acfbc644d6c80b620ab688649cb0e751
@@ -32,7 +32,7 @@
 platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8 904c3639d1e574671c969f3642ca475d3b00c382
 platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9 a332df8dadd78866c2a57f2c7348d499952939c2
 platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9 1944f44167a907969de5138fe4cc442432b7cc37
-platform/prebuilts/ndk 92d7ee7733f67d334786677c7796e3c2de6db20a
+platform/prebuilts/ndk 6ea989048815512d990746cf2cc35bc40d0ecb5d
 platform/prebuilts/ninja/darwin-x86 00f798346dedb4a7a6a6dcc9ad32ff09d66ee0db
 platform/prebuilts/ninja/linux-x86 6369b19fc3fbe765636af75d394627e2b92599ed
 platform/prebuilts/python/darwin-x86/2.7.5 0c5958b1636c47ed7c284f859c8e805fd06a0e63
@@ -40,7 +40,7 @@
 platform/prebuilts/renderscript/host/darwin-x86 a0ede5664b4741348c0b6c8d5da06d483dcf2876
 platform/prebuilts/renderscript/host/linux-x86 bad4a4a7b6a3d0e77bfb2e30c43f68a3f681d245
 platform/prebuilts/renderscript/host/windows-x86 5df9f20565e63906167c82f6120c78e969b3b467
-platform/prebuilts/simpleperf e519a1656ef4a8eb9ead9b6f7108267d9f3a1668
+platform/prebuilts/simpleperf 30c7142470b17436948e3f29de63b1e2dacd8545
 toolchain/binutils 9bf6cbf6dd88777719c5757922aff0190ec46539
 toolchain/build 58be6006bb71abb97d7cdff7be3e73d55bbc22b8
 toolchain/cloog 604793eab97d360aef729f064674569ee6dbf3e1