rust: Only apply hwasan flags once to fuzz targets

On HWASAN global sanitized builds, fuzz targets had hwasanFlags applied
twice. Rust only allows llvm-args flags to be passed in once however, so
this broke compilation.

Bug: 204915322
Test: SANITIZE_TARGET='hwaddress fuzzer' m <fuzzer>
Change-Id: I4f6c35e04bc4c891d9c66e8a53c3dcb88e8670cf
This commit is contained in:
Ivan Lozano
2021-11-13 07:43:54 -05:00
parent 52a3e36c92
commit f3e8fc3f0b

View File

@@ -237,12 +237,10 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags, deps PathDeps) (
} else {
flags.RustFlags = append(flags.RustFlags, asanFlags...)
}
}
if Bool(sanitize.Properties.Sanitize.Address) {
flags.RustFlags = append(flags.RustFlags, asanFlags...)
}
if Bool(sanitize.Properties.Sanitize.Hwaddress) {
} else if Bool(sanitize.Properties.Sanitize.Hwaddress) {
flags.RustFlags = append(flags.RustFlags, hwasanFlags...)
} else if Bool(sanitize.Properties.Sanitize.Address) {
flags.RustFlags = append(flags.RustFlags, asanFlags...)
}
return flags, deps
}