Add NDK static ti-fast target

Add libtifasts. A static NDK agent target that can more easily be run
on android.

Test: am attach-agent com.antonioleiva.bandhookkotlin /data/data/com.antonioleiva.bandhookkotlin/code_cache/libtifasts.so=SingleStep
Change-Id: I3a48581c5af82ddf8c24fad2070d0cf60f4bdfa1
diff --git a/tools/jvmti-agents/ti-fast/Android.bp b/tools/jvmti-agents/ti-fast/Android.bp
index fd867c9..3000656 100644
--- a/tools/jvmti-agents/ti-fast/Android.bp
+++ b/tools/jvmti-agents/ti-fast/Android.bp
@@ -16,20 +16,17 @@
 
 // Build variants {target,host} x {debug,ndebug} x {32,64}
 cc_defaults {
-    name: "tifast-defaults",
-    host_supported: true,
+    name: "tifast-base-defaults",
     srcs: ["tifast.cc"],
     defaults: ["art_defaults"],
 
     // Note that this tool needs to be built for both 32-bit and 64-bit since it requires
     // to be same ISA as what it is attached to.
     compile_multilib: "both",
-
-    shared_libs: [
-        "libbase",
-    ],
     header_libs: [
         "libopenjdkjvmti_headers",
+        "libnativehelper_header_only",
+        "jni_headers",
     ],
     multilib: {
         lib32: {
@@ -42,6 +39,35 @@
     symlink_preferred_arch: true,
 }
 
+cc_defaults {
+    name: "tifast-defaults",
+    host_supported: true,
+    shared_libs: [
+        "libbase",
+    ],
+    defaults: ["tifast-base-defaults"],
+}
+
+cc_defaults {
+    name: "tifast-static-defaults",
+    host_supported: false,
+    defaults: ["tifast-base-defaults"],
+
+    shared_libs: [
+        "liblog",
+    ],
+    static_libs: [
+        "libbase_ndk",
+    ],
+    sdk_version: "current",
+    stl: "c++_static",
+}
+
+art_cc_library {
+    name: "libtifasts",
+    defaults: ["tifast-static-defaults"],
+}
+
 art_cc_library {
     name: "libtifast",
     defaults: ["tifast-defaults"],
diff --git a/tools/jvmti-agents/ti-fast/README.md b/tools/jvmti-agents/ti-fast/README.md
index 9178931..6194af9 100644
--- a/tools/jvmti-agents/ti-fast/README.md
+++ b/tools/jvmti-agents/ti-fast/README.md
@@ -11,6 +11,8 @@
 The libraries will be built for 32-bit, 64-bit, host and target. Below examples
 assume you want to use the 64-bit version.
 
+Use `libtifasts` if you wish to build a version without non-NDK dynamic dependencies.
+
 ### Command Line
 
 The agent is loaded using -agentpath like normal. It takes arguments in the