Add option to emit ThinLTO indexes and imports for MLGO training
Test: presubmit Bug: 293827654 Change-Id: I8de1287543194d8e47ff5b57d4cabc7416048bbf
This commit is contained in:
parent
87e4128270
commit
b8eaee68b6
1 changed files with 6 additions and 0 deletions
|
@ -147,6 +147,12 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
|
|||
}
|
||||
}
|
||||
|
||||
// For ML training
|
||||
if ctx.Config().IsEnvTrue("THINLTO_EMIT_INDEXES_AND_IMPORTS") {
|
||||
ltoLdFlags = append(ltoLdFlags, "-Wl,--save-temps=import")
|
||||
ltoLdFlags = append(ltoLdFlags, "-Wl,--thinlto-emit-index-files")
|
||||
}
|
||||
|
||||
flags.Local.CFlags = append(flags.Local.CFlags, ltoCFlags...)
|
||||
flags.Local.AsFlags = append(flags.Local.AsFlags, ltoCFlags...)
|
||||
flags.Local.LdFlags = append(flags.Local.LdFlags, ltoCFlags...)
|
||||
|
|
Loading…
Reference in a new issue