Merge "Workaround unexported sancov symbols. Fix multiple sanitizer RT deps."
This commit is contained in:
@@ -465,7 +465,6 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
|
|
||||||
if Bool(sanitize.Properties.Sanitize.Fuzzer) {
|
if Bool(sanitize.Properties.Sanitize.Fuzzer) {
|
||||||
flags.CFlags = append(flags.CFlags, "-fsanitize=fuzzer-no-link")
|
flags.CFlags = append(flags.CFlags, "-fsanitize=fuzzer-no-link")
|
||||||
flags.LdFlags = append(flags.LdFlags, "-fsanitize=fuzzer-no-link")
|
|
||||||
|
|
||||||
// TODO(b/131771163): LTO and Fuzzer support is mutually incompatible.
|
// TODO(b/131771163): LTO and Fuzzer support is mutually incompatible.
|
||||||
_, flags.LdFlags = removeFromList("-flto", flags.LdFlags)
|
_, flags.LdFlags = removeFromList("-flto", flags.LdFlags)
|
||||||
@@ -473,6 +472,12 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
flags.LdFlags = append(flags.LdFlags, "-fno-lto")
|
flags.LdFlags = append(flags.LdFlags, "-fno-lto")
|
||||||
flags.CFlags = append(flags.CFlags, "-fno-lto")
|
flags.CFlags = append(flags.CFlags, "-fno-lto")
|
||||||
|
|
||||||
|
// TODO(b/142430592): Upstream linker scripts for sanitizer runtime libraries
|
||||||
|
// discard the sancov_lowest_stack symbol, because it's emulated TLS (and thus
|
||||||
|
// doesn't match the linker script due to the "__emutls_v." prefix).
|
||||||
|
flags.LdFlags = append(flags.LdFlags, "-fno-sanitize-coverage=stack-depth")
|
||||||
|
flags.CFlags = append(flags.CFlags, "-fno-sanitize-coverage=stack-depth")
|
||||||
|
|
||||||
// TODO(b/133876586): Experimental PM breaks sanitizer coverage.
|
// TODO(b/133876586): Experimental PM breaks sanitizer coverage.
|
||||||
_, flags.CFlags = removeFromList("-fexperimental-new-pass-manager", flags.CFlags)
|
_, flags.CFlags = removeFromList("-fexperimental-new-pass-manager", flags.CFlags)
|
||||||
flags.CFlags = append(flags.CFlags, "-fno-experimental-new-pass-manager")
|
flags.CFlags = append(flags.CFlags, "-fno-experimental-new-pass-manager")
|
||||||
@@ -860,7 +865,8 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
|
|||||||
} else {
|
} else {
|
||||||
runtimeLibrary = config.ScudoRuntimeLibrary(toolchain)
|
runtimeLibrary = config.ScudoRuntimeLibrary(toolchain)
|
||||||
}
|
}
|
||||||
} else if len(diagSanitizers) > 0 || c.sanitize.Properties.UbsanRuntimeDep {
|
} else if len(diagSanitizers) > 0 || c.sanitize.Properties.UbsanRuntimeDep ||
|
||||||
|
Bool(c.sanitize.Properties.Sanitize.Fuzzer) {
|
||||||
runtimeLibrary = config.UndefinedBehaviorSanitizerRuntimeLibrary(toolchain)
|
runtimeLibrary = config.UndefinedBehaviorSanitizerRuntimeLibrary(toolchain)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user