Link archive libraries needed by libring as whole_static_libs

Without this, linking against libring fails with missing symbols from
libring-core. Soong does not propagate static_libs across targets, and
apparently this behavior is WAI.

Bug: 193446464
Bug: 155855709
Test: Remove libring-core from doh_ffi_test and run "m doh_ffi_test"
Change-Id: I3068448cf7b58fcad775342dc6fa0db36f9c664e
diff --git a/Android.bp b/Android.bp
index dff53e7..a1c4c87 100644
--- a/Android.bp
+++ b/Android.bp
@@ -54,7 +54,7 @@
         "libspin",
         "libuntrusted",
     ],
-    static_libs: [
+    whole_static_libs: [
         "libring-core",
         "libring-test",
     ],
@@ -463,8 +463,8 @@
 }
 
 // dependent_library ["feature_list"]
-//   cc-1.0.68
-//   libc-0.2.96
-//   once_cell-1.7.2 "alloc,race,std"
+//   cc-1.0.69
+//   libc-0.2.98
+//   once_cell-1.8.0 "alloc,race,std"
 //   spin-0.5.2
 //   untrusted-0.7.1
diff --git a/cargo2android.json b/cargo2android.json
index 3616930..27fbf76 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -10,5 +10,6 @@
   "features": "alloc,default,dev_urandom_fallback,once_cell,std",
   "min-sdk-version": "29",
   "run": true,
-  "tests": true
+  "tests": true,
+  "patch": "patches/whole_static_libs.patch"
 }
diff --git a/patches/whole_static_libs.patch b/patches/whole_static_libs.patch
new file mode 100644
index 0000000..cdc7da8
--- /dev/null
+++ b/patches/whole_static_libs.patch
@@ -0,0 +1,11 @@
+--- Android.bp.orig	2021-07-13 05:18:27.737087081 +0900
++++ Android.bp	2021-07-13 05:19:16.036656691 +0900
+@@ -54,7 +54,7 @@ rust_library {
+         "libspin",
+         "libuntrusted",
+     ],
+-    static_libs: [
++    whole_static_libs: [
+         "libring-core",
+         "libring-test",
+     ],