Allow static binaries to enable AFDO
The static() property is true for both static libraries and static binaries. We should allow static binaries to enable AFDO. Test: Enable AFDO for linker Change-Id: I409fc9f764ea878f01dc42bb2e5c075219403009
This commit is contained in:
@@ -93,7 +93,13 @@ func (props *AfdoProperties) GetAfdoProfileFile(ctx android.BaseModuleContext, m
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (afdo *afdo) begin(ctx BaseModuleContext) {
|
func (afdo *afdo) begin(ctx BaseModuleContext) {
|
||||||
if afdo.Properties.Afdo && !ctx.static() && !ctx.Host() {
|
if ctx.Host() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ctx.static() && !ctx.staticBinary() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if afdo.Properties.Afdo {
|
||||||
module := ctx.ModuleName()
|
module := ctx.ModuleName()
|
||||||
if afdo.Properties.GetAfdoProfileFile(ctx, module).Valid() {
|
if afdo.Properties.GetAfdoProfileFile(ctx, module).Valid() {
|
||||||
afdo.Properties.AfdoTarget = proptools.StringPtr(module)
|
afdo.Properties.AfdoTarget = proptools.StringPtr(module)
|
||||||
|
Reference in New Issue
Block a user