Support recovery and recovery_available
`recovery: true` installs a module to the recovery partition.
`recovery_available: true` makes a module to be available to other
`recovery:true` or `recovery_available: true` modules.
These to are very similar to vendor, vendor_available properties, except
for the target partition.
Bug: 67916654
Bug: 64960723
Test: m -j, toybox_recovery is installed to the recovery/root/sbin
Change-Id: Iaebe0593de16c69fa70de251a61f4d018a251509
diff --git a/cc/library.go b/cc/library.go
index b31fee2..c83e89a 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -477,6 +477,11 @@
deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Vendor.Exclude_shared_libs)
deps.StaticLibs = removeListFromList(deps.StaticLibs, library.baseLinker.Properties.Target.Vendor.Exclude_static_libs)
}
+ if ctx.inRecovery() {
+ deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, library.baseLinker.Properties.Target.Recovery.Exclude_static_libs)
+ deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Recovery.Exclude_shared_libs)
+ deps.StaticLibs = removeListFromList(deps.StaticLibs, library.baseLinker.Properties.Target.Recovery.Exclude_static_libs)
+ }
android.ExtractSourceDeps(ctx, library.Properties.Version_script)
android.ExtractSourceDeps(ctx, library.Properties.Unexported_symbols_list)
@@ -745,7 +750,7 @@
}
if Bool(library.Properties.Static_ndk_lib) && library.static() &&
- !ctx.useVndk() && ctx.Device() &&
+ !ctx.useVndk() && !ctx.inRecovery() && ctx.Device() &&
library.sanitize.isUnsanitizedVariant() {
installPath := getNdkSysrootBase(ctx).Join(
ctx, "usr/lib", config.NDKTriple(ctx.toolchain()), file.Base())