Merge "Disable LTO when building with fuzzer support."
diff --git a/apex/apex.go b/apex/apex.go
index bdac2e3..ffcc503 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1497,6 +1497,10 @@
// to build the prebuilts themselves.
forceDisable = forceDisable || ctx.Config().UnbundledBuild()
+ // Force disable the prebuilts when coverage is enabled.
+ forceDisable = forceDisable || ctx.DeviceConfig().NativeCoverageEnabled()
+ forceDisable = forceDisable || ctx.Config().IsEnvTrue("EMMA_INSTRUMENT")
+
// b/137216042 don't use prebuilts when address sanitizer is on
forceDisable = forceDisable || android.InList("address", ctx.Config().SanitizeDevice()) ||
android.InList("hwaddress", ctx.Config().SanitizeDevice())