Revert "libvm_payload: Use Rust stubs instead of cc"
This reverts commit c8d8aecb844ee5a724384d3174b8219a6b7ec18c.
Reason for revert: <Potential culprit for b/393554373 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted>
Change-Id: I21e8d71b0fa2cdcf2868d33c80a91c40a50cdd8e
diff --git a/libs/libvm_payload/Android.bp b/libs/libvm_payload/Android.bp
index 0d99113..1ebbe39 100644
--- a/libs/libvm_payload/Android.bp
+++ b/libs/libvm_payload/Android.bp
@@ -3,10 +3,11 @@
}
// The Rust implementation of the C API.
-rust_ffi {
- name: "libvm_payload",
+rust_ffi_static {
+ name: "libvm_payload_impl",
crate_name: "vm_payload",
defaults: ["avf_build_flags_rust"],
+ visibility: ["//visibility:private"],
srcs: ["src/lib.rs"],
include_dirs: ["include"],
prefer_rlib: true,
@@ -22,20 +23,6 @@
"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 {
@@ -89,6 +76,28 @@
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 {