diff options
author | 2024-11-01 16:57:47 +0000 | |
---|---|---|
committer | 2024-11-01 16:57:47 +0000 | |
commit | b6d77bf6b7efd9850aa5587a805a173e143ee5cf (patch) | |
tree | fdbab4ce0df22cae03a1145e377d75958ab16789 /filesystem/system_image.go | |
parent | afd8aacf5850899cf7ae5bf8d7b88135d6e5fc6a (diff) | |
parent | 8fe68dcfd71efa99aebf7f5ef2f3b19d78621a24 (diff) |
Merge changes from topic "linker_config_product_soong" into main
* changes:
Create linker_config_srcs for autogenerated product partition
Dedupe logic to generate linker.config.pb
Diffstat (limited to 'filesystem/system_image.go')
-rw-r--r-- | filesystem/system_image.go | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/filesystem/system_image.go b/filesystem/system_image.go index 6200df44d..898987dbc 100644 --- a/filesystem/system_image.go +++ b/filesystem/system_image.go @@ -59,40 +59,7 @@ func (s *systemImage) buildLinkerConfigFile(ctx android.ModuleContext, root andr input := android.PathForModuleSrc(ctx, android.String(s.properties.Linker_config_src)) output := root.Join(ctx, "system", "etc", "linker.config.pb") - // we need "Module"s for packaging items - modulesInPackageByModule := make(map[android.Module]bool) - modulesInPackageByName := make(map[string]bool) - - deps := s.gatherFilteredPackagingSpecs(ctx) - ctx.WalkDeps(func(child, parent android.Module) bool { - for _, ps := range android.OtherModuleProviderOrDefault( - ctx, child, android.InstallFilesProvider).PackagingSpecs { - if _, ok := deps[ps.RelPathInPackage()]; ok { - modulesInPackageByModule[child] = true - modulesInPackageByName[child.Name()] = true - return true - } - } - return true - }) - - provideModules := make([]android.Module, 0, len(modulesInPackageByModule)) - for mod := range modulesInPackageByModule { - provideModules = append(provideModules, mod) - } - - var requireModules []android.Module - ctx.WalkDeps(func(child, parent android.Module) bool { - _, parentInPackage := modulesInPackageByModule[parent] - _, childInPackageName := modulesInPackageByName[child.Name()] - - // When parent is in the package, and child (or its variant) is not, this can be from an interface. - if parentInPackage && !childInPackageName { - requireModules = append(requireModules, child) - } - return true - }) - + provideModules, requireModules := s.getLibsForLinkerConfig(ctx) builder := android.NewRuleBuilder(pctx, ctx) linkerconfig.BuildLinkerConfig(ctx, builder, android.Paths{input}, provideModules, requireModules, output) builder.Build("conv_linker_config", "Generate linker config protobuf "+output.String()) |