• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git a/base/Android.bp b/base/Android.bp
2index 32859ea24..5d7e55e42 100644
3--- a/base/Android.bp
4+++ b/base/Android.bp
5@@ -15,7 +15,7 @@ package {
6 rust_test {
7     name: "base_test_src_lib",
8     defaults: ["crosvm_defaults"],
9-    host_supported: true,
10+    host_supported: false, // Can't seem to access syslog in TH host tests.
11     crate_name: "base",
12     cargo_env_compat: true,
13     cargo_pkg_version: "0.1.0",
14@@ -47,12 +47,31 @@ rust_test {
15         "libbase_event_token_derive",
16         "libremain",
17     ],
18+    target: {
19+        android: {
20+            rustlibs: ["libandroid_log_sys"],
21+        },
22+        linux_bionic_arm64: {
23+            // For ARM architecture, we use aarch64-linux-android for BOTH
24+            // device and host targets. As a result, host targets are also
25+            // built with target_os = "android". Therefore, sys_util/src/android
26+            // is used and thus this android module is required.
27+            // This seems incorrect, but is inevitable because rustc doesn't
28+            // yet support a Linux-based target using Bionic as libc. We can't
29+            // use aarch64-unknown-linux-gnu because it's using glibc which
30+            // we don't support for cross-host builds.
31+            rustlibs: [
32+                "libandroid_log_sys",
33+            ],
34+        },
35+    },
36+    shared_libs: ["libcap"], // specified in src/linux/capabilities.rs
37 }
38
39 rust_test {
40     name: "base_test_tests_linux_main",
41     defaults: ["crosvm_defaults"],
42-    host_supported: true,
43+    host_supported: false, // Can't seem to access syslog in TH host tests.
44     crate_name: "linux",
45     cargo_env_compat: true,
46     cargo_pkg_version: "0.1.0",
47@@ -161,6 +180,25 @@ rust_test {
48         "libbase_event_token_derive",
49         "libremain",
50     ],
51+    target: {
52+        android: {
53+            rustlibs: ["libandroid_log_sys"],
54+        },
55+        linux_bionic_arm64: {
56+            // For ARM architecture, we use aarch64-linux-android for BOTH
57+            // device and host targets. As a result, host targets are also
58+            // built with target_os = "android". Therefore, sys_util/src/android
59+            // is used and thus this android module is required.
60+            // This seems incorrect, but is inevitable because rustc doesn't
61+            // yet support a Linux-based target using Bionic as libc. We can't
62+            // use aarch64-unknown-linux-gnu because it's using glibc which
63+            // we don't support for cross-host builds.
64+            rustlibs: [
65+                "libandroid_log_sys",
66+            ],
67+        },
68+    },
69+    shared_libs: ["libcap"], // specified in src/linux/capabilities.rs
70 }
71
72 rust_library {
73@@ -194,3 +232,22 @@ rust_library {
74     ],
75     apex_available: ["com.android.virt"],
76+    target: {
77+        android: {
78+            rustlibs: ["libandroid_log_sys"],
79+        },
80+        linux_bionic_arm64: {
81+            // For ARM architecture, we use aarch64-linux-android for BOTH
82+            // device and host targets. As a result, host targets are also
83+            // built with target_os = "android". Therefore, sys_util/src/android
84+            // is used and thus this android module is required.
85+            // This seems incorrect, but is inevitable because rustc doesn't
86+            // yet support a Linux-based target using Bionic as libc. We can't
87+            // use aarch64-unknown-linux-gnu because it's using glibc which
88+            // we don't support for cross-host builds.
89+            rustlibs: [
90+                "libandroid_log_sys",
91+            ],
92+        },
93+    },
94+    shared_libs: ["libcap"], // specified in src/linux/capabilities.rs
95 }
96