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

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

Merge "Remove Use_clang_lld in lto"

parents 0cb87709 a7a345d5
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -56,9 +56,6 @@ type LTOProperties struct {
	ThinDep      bool `blueprint:"mutated"`
	NoLtoDep     bool `blueprint:"mutated"`

	// Use clang lld instead of gnu ld.
	Use_clang_lld *bool

	// Use -fwhole-program-vtables cflag.
	Whole_program_vtables *bool
}
@@ -77,13 +74,6 @@ func (lto *lto) begin(ctx BaseModuleContext) {
	}
}

func (lto *lto) useClangLld(ctx BaseModuleContext) bool {
	if lto.Properties.Use_clang_lld != nil {
		return Bool(lto.Properties.Use_clang_lld)
	}
	return true
}

func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
	// TODO(b/131771163): Disable LTO when using explicit fuzzing configurations.
	// LTO breaks fuzzer builds.
@@ -112,7 +102,7 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
			flags.Local.CFlags = append(flags.Local.CFlags, "-fwhole-program-vtables")
		}

		if (lto.DefaultThinLTO(ctx) || lto.ThinLTO()) && ctx.Config().IsEnvTrue("USE_THINLTO_CACHE") && lto.useClangLld(ctx) {
		if (lto.DefaultThinLTO(ctx) || lto.ThinLTO()) && ctx.Config().IsEnvTrue("USE_THINLTO_CACHE") {
			// Set appropriate ThinLTO cache policy
			cacheDirFormat := "-Wl,--thinlto-cache-dir="
			cacheDir := android.PathForOutput(ctx, "thinlto-cache").String()