diff options
Diffstat (limited to 'cc/cc.go')
| -rw-r--r-- | cc/cc.go | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -64,6 +64,9 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) { ctx.BottomUp("coverage", coverageMutator).Parallel() + ctx.TopDown("afdo_deps", afdoDepsMutator) + ctx.BottomUp("afdo", afdoMutator).Parallel() + ctx.TopDown("lto_deps", ltoDepsMutator) ctx.BottomUp("lto", ltoMutator).Parallel() @@ -810,6 +813,7 @@ type Module struct { sabi *sabi vndkdep *vndkdep lto *lto + afdo *afdo pgo *pgo library libraryInterface @@ -1143,6 +1147,9 @@ func (c *Module) Init() android.Module { if c.lto != nil { c.AddProperties(c.lto.props()...) } + if c.afdo != nil { + c.AddProperties(c.afdo.props()...) + } if c.pgo != nil { c.AddProperties(c.pgo.props()...) } @@ -1620,6 +1627,7 @@ func newModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *Mo module.sabi = &sabi{} module.vndkdep = &vndkdep{} module.lto = <o{} + module.afdo = &afdo{} module.pgo = &pgo{} return module } @@ -1815,6 +1823,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { if c.lto != nil { flags = c.lto.flags(ctx, flags) } + if c.afdo != nil { + flags = c.afdo.flags(ctx, flags) + } if c.pgo != nil { flags = c.pgo.flags(ctx, flags) } @@ -1942,6 +1953,9 @@ func (c *Module) begin(ctx BaseModuleContext) { if c.lto != nil { c.lto.begin(ctx) } + if c.afdo != nil { + c.afdo.begin(ctx) + } if c.pgo != nil { c.pgo.begin(ctx) } @@ -3461,8 +3475,15 @@ func (c *Module) ConvertWithBp2build(ctx android.TopDownMutatorContext) { objectBp2Build(ctx, c) } } else if c.CcLibrary() { - static := c.BuildStaticVariant() - shared := c.BuildSharedVariant() + static := false + shared := false + if library, ok := c.linker.(*libraryDecorator); ok { + static = library.MutatedProperties.BuildStatic + shared = library.MutatedProperties.BuildShared + } else if library, ok := c.linker.(*prebuiltLibraryLinker); ok { + static = library.MutatedProperties.BuildStatic + shared = library.MutatedProperties.BuildShared + } if static && shared { if !prebuilt { @@ -3534,6 +3555,7 @@ func DefaultsFactory(props ...interface{}) android.Module { &SAbiProperties{}, &VndkProperties{}, <OProperties{}, + &AfdoProperties{}, &PgoProperties{}, &android.ProtoProperties{}, // RustBindgenProperties is included here so that cc_defaults can be used for rust_bindgen modules. |