-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathAndroid.bp
More file actions
125 lines (118 loc) · 3.75 KB
/
Copy pathAndroid.bp
File metadata and controls
125 lines (118 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
// The Rust implementation of the C API.
rust_ffi {
name: "libvm_payload",
crate_name: "vm_payload",
defaults: [
"avf_build_flags_rust",
"no_bti",
],
srcs: ["src/lib.rs"],
include_dirs: ["include"],
prefer_rlib: true,
rustlibs: [
"android.system.virtualization.payload-rust",
"libandroid_logger",
"libanyhow",
"libbinder_rs",
"libbssl_crypto",
"liblibc",
"libnix",
"liblog_rust",
"librpcbinder_rs",
"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 {
name: "libvm_payload_status_bindgen",
wrapper_src: "include/vm_payload.h",
crate_name: "vm_payload_status_bindgen",
defaults: ["avf_build_flags_rust"],
source_stem: "bindings",
bindgen_flags: [
"--default-enum-style rust",
"--allowlist-type=AVmAttestationStatus",
"--allowlist-type=AVmAccessRollbackProtectedSecretStatus",
"--allowlist-type=AVmMountEncryptedAssetsStatus",
],
visibility: [":__subpackages__"],
}
// Access to the C API for Rust code.
// This shouldn't be used directly - prefer libvm_payload_rs (below)
rust_bindgen {
name: "libvm_payload_bindgen",
wrapper_src: "include-restricted/vm_payload_restricted.h",
crate_name: "vm_payload_bindgen",
defaults: ["avf_build_flags_rust"],
source_stem: "bindings",
apex_available: ["com.android.compos"],
bindgen_flags: [
"--default-enum-style rust",
],
shared_libs: [
"libvm_payload#current",
],
}
// Wrapper library for the raw C API for use by Rust clients.
// (Yes, this involves going Rust -> C -> Rust.)
// This is not a stable API - we may change it in subsequent versions.
// But it is made available as an rlib so it is linked into any
// code using it, leaving only dependencies on stable APIs.
// So code built with it should run unchanged on future versions.
rust_library_rlib {
name: "libvm_payload_rs",
crate_name: "vm_payload",
defaults: ["avf_build_flags_rust"],
srcs: ["wrapper/lib.rs"],
rustlibs: [
"libbinder_rs",
"libstatic_assertions",
"libvm_payload_bindgen",
],
apex_available: [
"//apex_available:platform",
"com.android.compos",
],
visibility: ["//visibility:public"],
}
// Just the headers. Mostly useful for clients that only want the
// declaration of AVmPayload_main().
cc_library_headers {
name: "vm_payload_headers",
defaults: ["avf_build_flags_cc"],
apex_available: ["//apex_available:anyapex"],
export_include_dirs: ["include"],
visibility: ["//visibility:public"],
// Set to 33 for appsearch, but can be arbitrary low since symbols
// are guarded by __INTRODUCED_IN. Comment requested by ioffe@.
// Library introduced at SDK 34, so no symbols are actually usable
// at 33.
min_sdk_version: "33",
}
// Restricted headers for use by internal clients & associated tests.
cc_library_headers {
name: "vm_payload_restricted_headers",
defaults: ["avf_build_flags_cc"],
header_libs: ["vm_payload_headers"],
export_header_lib_headers: ["vm_payload_headers"],
export_include_dirs: ["include-restricted"],
apex_available: ["com.android.compos"],
visibility: ["//packages/modules/Virtualization:__subpackages__"],
}