libvm_payload: Use Rust stubs instead of cc
Rust has support for stubs libraries now, so remove the cc_library which
wrapped libvm_payload for this purpose and simply use the stubs provided
by rust_library.
Bug: 203478530
Test: mma
Change-Id: I91fc78ae3e96ad116595ebb0ade223fe73d38865
diff --git a/libs/libvm_payload/Android.bp b/libs/libvm_payload/Android.bp
index 1ebbe39..0d99113 100644
--- a/libs/libvm_payload/Android.bp
+++ b/libs/libvm_payload/Android.bp
@@ -3,11 +3,10 @@
}
// The Rust implementation of the C API.
-rust_ffi_static {
- name: "libvm_payload_impl",
+rust_ffi {
+ name: "libvm_payload",
crate_name: "vm_payload",
defaults: ["avf_build_flags_rust"],
- visibility: ["//visibility:private"],
srcs: ["src/lib.rs"],
include_dirs: ["include"],
prefer_rlib: true,
@@ -23,6 +22,20 @@
"libvm_payload_status_bindgen",
"libvsock",
],
+ shared_libs: [
+ "libbinder_ndk",
+ "libbinder_rpc_unstable",
+ "liblog",
+ "libcrypto",
+ ],
+ no_full_install: true,
+ version_script: "libvm_payload.map.txt",
+ stubs: {
+ symbol_file: "libvm_payload.map.txt",
+ // Implementation is available inside a Microdroid VM.
+ implementation_installable: false,
+ },
+ visibility: ["//visibility:public"],
}
rust_bindgen {
@@ -76,28 +89,6 @@
visibility: ["//visibility:public"],
}
-// Shared library for clients to link against.
-cc_library_shared {
- name: "libvm_payload",
- defaults: ["avf_build_flags_cc"],
- shared_libs: [
- "libbinder_ndk",
- "libbinder_rpc_unstable",
- "liblog",
- "libcrypto",
- ],
- whole_static_libs: ["libvm_payload_impl"],
- export_static_lib_headers: ["libvm_payload_impl"],
- no_full_install: true,
- version_script: "libvm_payload.map.txt",
- stubs: {
- symbol_file: "libvm_payload.map.txt",
- // Implementation is available inside a Microdroid VM.
- implementation_installable: false,
- },
- visibility: ["//visibility:public"],
-}
-
// Just the headers. Mostly useful for clients that only want the
// declaration of AVmPayload_main().
cc_library_headers {