Support building a host version of minijail0
This change enables building a host version of minijail0. This is
desirable to run some host tests.
Bug: 78307138
Test: m out/host/linux-x86/bin/minijail0 && \
out/host/linux-x86/bin/minijail0 -h
Change-Id: Iceb7f75d44c09dd8934ef3a9a70edb72ca94d3a4
Merged-Id: I7f29a8b04842fcd6a5054aebb54a97b3aa815124
(cherry picked from commit 413af658ee448c138830b3bc7eecb972f18fb6fc)
diff --git a/Android.bp b/Android.bp
index a52439e..cdda3c8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -114,6 +114,7 @@
// =========================================================
cc_library {
name: "libminijail",
+ host_supported: true,
vendor_available: true,
vndk: {
@@ -132,6 +133,14 @@
shared_libs: minijailCommonLibraries,
},
export_include_dirs: ["."],
+
+ target: {
+ host: {
+ cflags: [
+ "-DPRELOADPATH=\"/invalidminijailpreload.so\"",
+ ],
+ },
+ },
}
// Example ASan-ified libminijail shared library for target.
@@ -341,6 +350,7 @@
cc_binary {
name: "minijail0",
defaults: ["libminijail_flags"],
+ host_supported: true,
cflags: [
"-DPRELOADPATH=\"/invalidminijailpreload.so\"",