Merge "rust: Skip global 'fuzzer' sanitizer static bins"
diff --git a/rust/sanitize.go b/rust/sanitize.go
index 5318be3..be9dc42 100644
--- a/rust/sanitize.go
+++ b/rust/sanitize.go
@@ -144,7 +144,7 @@
// Global Sanitizers
if found, globalSanitizers = android.RemoveFromList("hwaddress", globalSanitizers); found && s.Hwaddress == nil {
- // TODO(b/180495975): HWASan for static Rust binaries isn't supported yet.
+ // TODO(b/204776996): HWASan for static Rust binaries isn't supported yet.
if !ctx.RustModule().StaticExecutable() {
s.Hwaddress = proptools.BoolPtr(true)
}
@@ -161,7 +161,10 @@
}
if found, globalSanitizers = android.RemoveFromList("fuzzer", globalSanitizers); found && s.Fuzzer == nil {
- s.Fuzzer = proptools.BoolPtr(true)
+ // TODO(b/204776996): HWASan for static Rust binaries isn't supported yet, and fuzzer enables HWAsan
+ if !ctx.RustModule().StaticExecutable() {
+ s.Fuzzer = proptools.BoolPtr(true)
+ }
}
// Global Diag Sanitizers
@@ -287,7 +290,7 @@
deps = []string{config.LibclangRuntimeLibrary(mod.toolchain(mctx), "asan")}
} else if mod.IsSanitizerEnabled(cc.Hwasan) ||
(mod.IsSanitizerEnabled(cc.Fuzzer) && mctx.Arch().ArchType == android.Arm64) {
- // TODO(b/180495975): HWASan for static Rust binaries isn't supported yet.
+ // TODO(b/204776996): HWASan for static Rust binaries isn't supported yet.
if binary, ok := mod.compiler.(binaryInterface); ok {
if binary.staticallyLinked() {
mctx.ModuleErrorf("HWASan is not supported for static Rust executables yet.")