Merge "Workaround unexported sancov symbols. Fix multiple sanitizer RT deps." am: 83246459d1
am: 708b9e6c38
Change-Id: I08c7279a4e836c19fe9610d16fc44efdd0a14b73
This commit is contained in:
@@ -465,7 +465,6 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
||||
|
||||
if Bool(sanitize.Properties.Sanitize.Fuzzer) {
|
||||
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.
|
||||
_, 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.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.
|
||||
_, flags.CFlags = removeFromList("-fexperimental-new-pass-manager", flags.CFlags)
|
||||
flags.CFlags = append(flags.CFlags, "-fno-experimental-new-pass-manager")
|
||||
@@ -860,7 +865,8 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
|
||||
} else {
|
||||
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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user