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

Commit bedca744 authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar
Browse files

[pgo] Do not explicitly link profile runtime

Bug: http://b/181740505

Explicitly adding dependency to profile runtime causes apex dependency
errors.  We're already passing -fprofile-instr-generate to the linker so
depending on the profile runtimes is unnecessary.

Test: pgo-coral-config1 on internal release branch and run tests on
      APCT.
Change-Id: Ie54785726c7ac044e5a5a2299073d02d45d5e0a7
parent c5993b2c
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -1833,12 +1833,6 @@ func (c *Module) deps(ctx DepsContext) Deps {
	if c.compiler != nil {
		deps = c.compiler.compilerDeps(ctx, deps)
	}
	// Add the PGO dependency (the clang_rt.profile runtime library), which
	// sometimes depends on symbols from libgcc, before libgcc gets added
	// in linkerDeps().
	if c.pgo != nil {
		deps = c.pgo.deps(ctx, deps)
	}
	if c.linker != nil {
		deps = c.linker.linkerDeps(ctx, deps)
	}
+0 −4
Original line number Diff line number Diff line
@@ -245,10 +245,6 @@ func ThreadSanitizerRuntimeLibrary(t Toolchain) string {
	return LibclangRuntimeLibrary(t, "tsan")
}

func ProfileRuntimeLibrary(t Toolchain) string {
	return LibclangRuntimeLibrary(t, "profile")
}

func ScudoRuntimeLibrary(t Toolchain) string {
	return LibclangRuntimeLibrary(t, "scudo")
}
+0 −9
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import (
	"github.com/google/blueprint/proptools"

	"android/soong/android"
	"android/soong/cc/config"
)

var (
@@ -271,14 +270,6 @@ func (pgo *pgo) begin(ctx BaseModuleContext) {
	}
}

func (pgo *pgo) deps(ctx BaseModuleContext, deps Deps) Deps {
	if pgo.Properties.ShouldProfileModule {
		runtimeLibrary := config.ProfileRuntimeLibrary(ctx.toolchain())
		deps.LateStaticLibs = append(deps.LateStaticLibs, runtimeLibrary)
	}
	return deps
}

func (pgo *pgo) flags(ctx ModuleContext, flags Flags) Flags {
	if ctx.Host() {
		return flags