diff options
author | 2024-10-28 22:49:38 +0000 | |
---|---|---|
committer | 2024-10-31 17:03:32 +0000 | |
commit | 9263188d99be646e559bb78777c65f8516b3d0a7 (patch) | |
tree | ea8e8bdd7f91d022b20b6279f457e1fea308f260 /linkerconfig | |
parent | 840880cf7627d2342f78c9b25419eaf059b43799 (diff) |
Add linker.config.pb support to android_filesystem
As part of the mk->bp conversion, all modules and partitions will
eventually be built with Soong. vendor.img (built with kati) uses some
rules in build/make/core to install a /etc/linker.config.pb file. This
CL adds this logic to `android_filesystem`. This soong module will
eventually be used to build vendor.img
There are two main inputs to linker.config.pb generation for vendor.
1. PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS, a list of json files
2. List of stub libraries installed in vendor
(1) will be passed to `android_filesystem` as `Linker_config_srcs`.
(2) has a subtle difference between kati and soong implementation. Kati
uses `SOONG_STUB_VENDOR_LIBRARIES` to determine the list of all vendor
stub libraries in the tree, and then uses `--system $TARGET_OUT/vendor`
to filter in the libraries which are actually installed. For the Soong
implementation, this will be replaced with ctx.VisitDirectDeps, followed
by child.HasStubVariants
Test: go test ./filesystem
Bug: 375686533
Change-Id: I6f9130d2aa866dcac9272b71939e40ed50a952ac
Diffstat (limited to 'linkerconfig')
-rw-r--r-- | linkerconfig/linkerconfig.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/linkerconfig/linkerconfig.go b/linkerconfig/linkerconfig.go index 05b99fd6d..d42287113 100644 --- a/linkerconfig/linkerconfig.go +++ b/linkerconfig/linkerconfig.go @@ -77,7 +77,7 @@ func (l *linkerConfig) GenerateAndroidBuildActions(ctx android.ModuleContext) { output := android.PathForModuleOut(ctx, "linker.config.pb").OutputPath builder := android.NewRuleBuilder(pctx, ctx) - BuildLinkerConfig(ctx, builder, input, nil, nil, output) + BuildLinkerConfig(ctx, builder, android.Paths{input}, nil, nil, output) builder.Build("conv_linker_config", "Generate linker config protobuf "+output.String()) l.outputFilePath = output @@ -91,16 +91,18 @@ func (l *linkerConfig) GenerateAndroidBuildActions(ctx android.ModuleContext) { } func BuildLinkerConfig(ctx android.ModuleContext, builder *android.RuleBuilder, - input android.Path, provideModules []android.Module, requireModules []android.Module, output android.OutputPath) { + inputs android.Paths, provideModules []android.Module, requireModules []android.Module, output android.OutputPath) { // First, convert the input json to protobuf format interimOutput := android.PathForModuleOut(ctx, "temp.pb") - builder.Command(). + cmd := builder.Command(). BuiltTool("conv_linker_config"). Flag("proto"). - Flag("--force"). - FlagWithInput("-s ", input). - FlagWithOutput("-o ", interimOutput) + Flag("--force") + for _, input := range inputs { + cmd.FlagWithInput("-s ", input) + } + cmd.FlagWithOutput("-o ", interimOutput) // Secondly, if there's provideLibs gathered from provideModules, append them var provideLibs []string |