static rust binaries are also prohibited in APEXes
Also fixes a bug that the test runs for host APEXes like
com.android.art.host.
Bug: 185971244
Test: m
Test: build mainline_modules target on aosp-master
Change-Id: Ie2012adbf2f4eda5454d5eaa30f128fb1e20ad37
diff --git a/apex/apex.go b/apex/apex.go
index e8bb9b7..58faa68 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2490,11 +2490,17 @@
// checkStaticExecutable ensures that executables in an APEX are not static.
func (a *apexBundle) checkStaticExecutables(ctx android.ModuleContext) {
+ // No need to run this for host APEXes
+ if ctx.Host() {
+ return
+ }
+
ctx.VisitDirectDepsBlueprint(func(module blueprint.Module) {
if ctx.OtherModuleDependencyTag(module) != executableTag {
return
}
- if cc, ok := module.(*cc.Module); ok && cc.StaticExecutable() {
+
+ if l, ok := module.(cc.LinkableInterface); ok && l.StaticExecutable() {
apex := a.ApexVariationName()
exec := ctx.OtherModuleName(module)
if isStaticExecutableAllowed(apex, exec) {