Disable PGO profile use in Clang-based coverage builds
Bug: http://b/143977934
Clang errors that -fprofile-use and -fprofile-instr-generate are
incompatible.
Test: m CLANG_COVERAGE=true COVERAGE_PATHS="*" on cf_x86_phone target
Change-Id: I584b615639fcef86668b7fa34b7511b4820d9548
diff --git a/cc/pgo.go b/cc/pgo.go
index 8eb3400..d5c4b87 100644
--- a/cc/pgo.go
+++ b/cc/pgo.go
@@ -256,6 +256,12 @@
}
}
+ // PGO profile use is not feasible for a Clang coverage build because
+ // -fprofile-use and -fprofile-instr-generate are incompatible.
+ if ctx.DeviceConfig().ClangCoverageEnabled() {
+ return
+ }
+
if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") &&
proptools.BoolDefault(pgo.Properties.Pgo.Enable_profile_use, true) {
if profileFile := pgo.Properties.getPgoProfileFile(ctx); profileFile.Valid() {