aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-05-15 14:24:05 +0000
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-05-17 10:20:05 +0000
commitbd733f739a50c609321d916ba3e028bb7f0551da (patch)
tree58056501869adedd80326b29429072510c06458d
parentc1cdbd681848edc29ac778050786726ac5324c58 (diff)
downloadvirtio-drivers-bd733f739a50c609321d916ba3e028bb7f0551da.tar.gz
Use new no-std flag and reduce size of patch.
Test: m pvmfw (cherry picked from https://android-review.googlesource.com/q/commit:7fd303a1fbe1f2549115749f0d2fc39b910a6be7) Merged-In: I4935696f2e2a5067d7e7811ce0764b090c17742f Change-Id: I4935696f2e2a5067d7e7811ce0764b090c17742f
-rw-r--r--Android.bp9
-rw-r--r--cargo2android.json2
-rw-r--r--patches/Android.bp.patch8
3 files changed, 12 insertions, 7 deletions
diff --git a/Android.bp b/Android.bp
index 4e47048..538e284 100644
--- a/Android.bp
+++ b/Android.bp
@@ -20,14 +20,13 @@ license {
],
}
-rust_library {
+rust_library_rlib {
name: "libvirtio_drivers",
crate_name: "virtio_drivers",
cargo_env_compat: true,
cargo_pkg_version: "0.4.0",
srcs: ["src/lib.rs"],
edition: "2018",
- no_stdlibs: true,
rustlibs: [
"libbitflags",
"liblog_rust_nostd",
@@ -37,6 +36,12 @@ rust_library {
"//apex_available:platform",
"//apex_available:anyapex",
],
+ prefer_rlib: true,
+ no_stdlibs: true,
+ stdlibs: [
+ "libcompiler_builtins.rust_sysroot",
+ "libcore.rust_sysroot",
+ ],
}
rust_test {
diff --git a/cargo2android.json b/cargo2android.json
index d7a5b20..8bd0ae6 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -2,7 +2,9 @@
"dependencies": true,
"device": true,
"features": "",
+ "force-rlib": true,
"no-host": "true",
+ "no-std": true,
"patch": "patches/Android.bp.patch",
"run": true,
"tests": true,
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
index cd5208e..a89d5a7 100644
--- a/patches/Android.bp.patch
+++ b/patches/Android.bp.patch
@@ -1,12 +1,9 @@
diff --git a/Android.bp b/Android.bp
-index b08769d..230c659 100644
+index 07e10b6..5949f7f 100644
--- a/Android.bp
+++ b/Android.bp
-@@ -29,9 +29,10 @@ rust_library {
- cargo_pkg_version: "0.2.0",
- srcs: ["src/lib.rs"],
+@@ -29,8 +29,8 @@ rust_library {
edition: "2018",
-+ no_stdlibs: true,
rustlibs: [
"libbitflags",
- "liblog_rust",
@@ -15,3 +12,4 @@ index b08769d..230c659 100644
+ "libzerocopy_nostd",
],
apex_available: [
+ "//apex_available:platform",