Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc9d3516 authored by Yi Kong's avatar Yi Kong Committed by Gerrit Code Review
Browse files

Merge "Add option to emit ThinLTO indexes and imports for MLGO training" into main

parents 9301b11e b8eaee68
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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...)