aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernie Innocenti <codewiz@google.com>2020-12-14 17:20:54 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-12-14 17:20:54 +0000
commitc21571c785fc871d26c02cc91d5b8ac6b05b78a0 (patch)
treef75afeab9f6a1ee15e6663aa42002623c56fc72f
parent7ba209d4ca58b30c4329275d254f179c933b658c (diff)
parentc195fa059afd6b20298114cb403a2500fa6c6ac8 (diff)
downloadquiche-c21571c785fc871d26c02cc91d5b8ac6b05b78a0.tar.gz
Build Quiche as a rust_ffi library for DnsResolver am: ead1814d81 am: d2dc8cb3ed am: c195fa059a
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/quiche/+/1521441 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I96e1e265335f5cf0e7a1e42a7a8a3e5c57e46553
-rw-r--r--Android.bp28
-rw-r--r--patches/Android.bp.patch89
2 files changed, 108 insertions, 9 deletions
diff --git a/Android.bp b/Android.bp
index 9e84e00..96101dd 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,8 +1,8 @@
-// This file is generated by cargo2android.py --run --device --dependencies.
+// This file is generated by cargo2android.py --run --device --dependencies --patch=patches/Android.bp.patch.
-
-rust_library {
- name: "libquiche",
+rust_ffi {
+ name: "libquiche_ffi",
+ stem: "libquiche",
host_supported: true,
crate_name: "quiche",
srcs: ["src/lib.rs"],
@@ -11,29 +11,39 @@ rust_library {
"boringssl",
"default",
],
- rustlibs: [
+
+ // Link all crates statically to create a self-contained .so library.
+ rlibs: [
"liblazy_static",
"liblibc",
"liblibm",
"liblog_rust",
"libring",
],
+ prefer_rlib: true,
+
shared_libs: [
"libcrypto",
"libssl",
],
-}
+ // For DnsResolver (Mainline module introduced in Q).
+ min_sdk_version: "29",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.resolv",
+ ],
+}
// dependent_library ["feature_list"]
-// cc-1.0.65
+// cc-1.0.66
// cfg-if-0.1.10
// cmake-0.1.45
// lazy_static-1.4.0
-// libc-0.2.80 "default,std"
+// libc-0.2.81 "default,std"
// libm-0.2.1 "default"
// log-0.4.11 "std"
// once_cell-1.5.2 "alloc,std"
-// ring-0.16.17 "alloc,default,dev_urandom_fallback,once_cell"
+// ring-0.16.19 "alloc,default,dev_urandom_fallback,once_cell"
// spin-0.5.2
// untrusted-0.7.1
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
new file mode 100644
index 0000000..0fc5a78
--- /dev/null
+++ b/patches/Android.bp.patch
@@ -0,0 +1,89 @@
+--- Android.bp 2020-12-12 01:46:35.080262701 +0900
++++ Android.bp.new 2020-12-12 01:44:35.649397815 +0900
+@@ -1,73 +1,37 @@
+ // This file is generated by cargo2android.py --run --device --dependencies --patch=patches/Android.bp.patch.
+
+-rust_library_shared {
+- name: "libquiche_shared",
++rust_ffi {
++ name: "libquiche_ffi",
+ stem: "libquiche",
+ host_supported: true,
+ crate_name: "quiche",
+ srcs: ["src/lib.rs"],
+ edition: "2018",
+ features: [
+- "boringssl-vendored",
++ "boringssl",
+ "default",
+ ],
+- rustlibs: [
+- "liblazy_static",
+- "liblibc",
+- "liblibm",
+- "liblog_rust",
+- "libring",
+- ],
+- static_libs: [
+- "libcrypto",
+- "libssl",
+- ],
+-}
+
+-rust_library {
+- name: "libquiche",
+- host_supported: true,
+- crate_name: "quiche",
+- srcs: ["src/lib.rs"],
+- edition: "2018",
+- features: [
+- "boringssl-vendored",
+- "default",
+- ],
+- rustlibs: [
++ // Link all crates statically to create a self-contained .so library.
++ rlibs: [
+ "liblazy_static",
+ "liblibc",
+ "liblibm",
+ "liblog_rust",
+ "libring",
+ ],
+- static_libs: [
++ prefer_rlib: true,
++
++ shared_libs: [
+ "libcrypto",
+ "libssl",
+ ],
+-}
+
+-rust_library_static {
+- name: "libquiche_static",
+- stem: "libquiche",
+- host_supported: true,
+- crate_name: "quiche",
+- srcs: ["src/lib.rs"],
+- edition: "2018",
+- features: [
+- "boringssl-vendored",
+- "default",
+- ],
+- rustlibs: [
+- "liblazy_static",
+- "liblibc",
+- "liblibm",
+- "liblog_rust",
+- "libring",
+- ],
+- static_libs: [
+- "libcrypto",
+- "libssl",
++ // For DnsResolver (Mainline module introduced in Q).
++ min_sdk_version: "29",
++ apex_available: [
++ "//apex_available:platform",
++ "com.android.resolv",
+ ],
+ }
+