From 9c6b67661ac6b2663ea25403f2e422ae3b888024 Mon Sep 17 00:00:00 2001 From: Yu Liu Date: Wed, 8 Jan 2025 22:04:35 +0000 Subject: Don't include disabled modules in linker config files. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: Ie327e03418e8762771fdbf290a35293aa5fb8e17 --- filesystem/filesystem.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'filesystem/filesystem.go') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 6dfbfd1be..bd8018b80 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -1081,7 +1081,10 @@ func (f *filesystem) getLibsForLinkerConfig(ctx android.ModuleContext) ([]androi modulesInPackageByName := make(map[string]bool) deps := f.gatherFilteredPackagingSpecs(ctx) - ctx.WalkDeps(func(child, parent android.Module) bool { + ctx.WalkDeps(func(child, _ android.Module) bool { + if !child.Enabled(ctx) { + return false + } for _, ps := range android.OtherModuleProviderOrDefault( ctx, child, android.InstallFilesProvider).PackagingSpecs { if _, ok := deps[ps.RelPathInPackage()]; ok && ps.Partition() == f.PartitionType() { @@ -1100,6 +1103,9 @@ func (f *filesystem) getLibsForLinkerConfig(ctx android.ModuleContext) ([]androi var requireModules []android.Module ctx.WalkDeps(func(child, parent android.Module) bool { + if !child.Enabled(ctx) { + return false + } _, parentInPackage := modulesInPackageByModule[parent] _, childInPackageName := modulesInPackageByName[child.Name()] -- cgit v1.2.3-59-g8ed1b