pvmfw: Compile aarch64 specifics conditionally
This commit add separate section in Build script that
provide ARM specific dependencies.
This code is part of bigger refactoring before adding new CPU architecture.
Bug: 362733888
Test: m pvmfw
Change-Id: Ie0f3f2e25fc90659354f0a45659b449247070b13
diff --git a/guest/pvmfw/Android.bp b/guest/pvmfw/Android.bp
index 4ef57a6..6f113c8 100644
--- a/guest/pvmfw/Android.bp
+++ b/guest/pvmfw/Android.bp
@@ -11,7 +11,6 @@
"legacy",
],
rustlibs: [
- "libaarch64_paging",
"libbssl_avf_nostd",
"libcbor_util_nostd",
"libciborium_nostd",
@@ -24,8 +23,6 @@
"libpvmfw_avb_nostd",
"libpvmfw_embedded_key",
"libpvmfw_fdt_template",
- "libservice_vm_version",
- "libsmccc",
"libstatic_assertions",
"libtinyvec_nostd",
"libuuid_nostd",
@@ -34,6 +31,15 @@
"libzerocopy_nostd",
"libzeroize_nostd",
],
+ target: {
+ android_arm64: {
+ rustlibs: [
+ "libaarch64_paging",
+ "libsmccc",
+ "libservice_vm_version",
+ ],
+ },
+ },
}
// Generates an empty file.
@@ -270,17 +276,21 @@
cc_binary {
name: "pvmfw",
defaults: ["vmbase_elf_defaults"],
- srcs: [
- "idmap.S",
- ],
static_libs: [
"libpvmfw",
"libvmbase_dice_clear_memory",
],
- linker_scripts: [
- "image.ld",
- ":vmbase_sections",
- ],
+ target: {
+ android_arm64: {
+ srcs: [
+ "asm/aarch64/idmap.S",
+ ],
+ linker_scripts: [
+ "asm/aarch64/image.ld",
+ ":vmbase_sections",
+ ],
+ },
+ },
// `installable: false` is inherited from vmbase_elf_defaults, and that
// hides this module from Make, which makes it impossible for the Make world
// to place the unstripped binary to the symbols directory. Marking back as