Merge "Disable LTO when building with fuzzer support."

am: df7d2cc9f8

Change-Id: Ie4f0e1c6266cca662c4eb133ce2bd9ce85b1dcd9
This commit is contained in:
Mitch Phillips 2019-08-05 11:39:28 -07:00 committed by android-build-merger
commit cead9bad66
2 changed files with 8 additions and 0 deletions

View file

@ -80,6 +80,12 @@ func (lto *lto) useClangLld(ctx BaseModuleContext) bool {
}
func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
// TODO(b/131771163): Disable LTO when using explicit fuzzing configurations.
// LTO breaks fuzzer builds.
if inList("-fsanitize=fuzzer-no-link", flags.CFlags) {
return flags
}
if lto.LTO() {
var ltoFlag string
if Bool(lto.Properties.Lto.Thin) {

View file

@ -465,7 +465,9 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
// TODO(b/131771163): LTO and Fuzzer support is mutually incompatible.
_, flags.LdFlags = removeFromList("-flto", flags.LdFlags)
_, flags.CFlags = removeFromList("-flto", flags.CFlags)
flags.LdFlags = append(flags.LdFlags, "-fno-lto")
flags.CFlags = append(flags.CFlags, "-fno-lto")
// TODO(b/133876586): Experimental PM breaks sanitizer coverage.
_, flags.CFlags = removeFromList("-fexperimental-new-pass-manager", flags.CFlags)