summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2024-02-12 14:13:37 -0500
committer Ivan Lozano <ivanlozano@google.com> 2024-02-12 14:16:26 -0500
commit357433ae73693a60465dccfc0e3d7561baae92d0 (patch)
tree325aa2f4a3b3e3e24f3f1eff849513e544a0919d
parent1c9213d89fe10be0acf82346eeb3431388d5c7fe (diff)
rust: Re-enable host address sanitizer.
Our toolchain supports a flag "-Z external-clangrt=true" which prevents rustc from emitting a missing dependency to librust-dev_rt. Instead, we link in libclang_rt. Bug: 304507701 Bug: 324826914 Test: SANITIZE_HOST=address m aconfig Change-Id: I8020c550b7a922c80620f61c22e01848a4f4a349
-rw-r--r--rust/sanitize.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/rust/sanitize.go b/rust/sanitize.go
index 9dda43fd6..3c08cd8fd 100644
--- a/rust/sanitize.go
+++ b/rust/sanitize.go
@@ -56,6 +56,8 @@ type SanitizeProperties struct {
}
var fuzzerFlags = []string{
+ "-Z external-clangrt=true",
+
"-C passes='sancov-module'",
"--cfg fuzzing",
@@ -73,11 +75,13 @@ var fuzzerFlags = []string{
}
var asanFlags = []string{
+ "-Z external-clangrt=true",
"-Z sanitizer=address",
}
// See cc/sanitize.go's hwasanGlobalOptions for global hwasan options.
var hwasanFlags = []string{
+ "-Z external-clangrt=true",
"-Z sanitizer=hwaddress",
"-C target-feature=+tagged-globals",
@@ -203,11 +207,6 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Address = nil
}
- // TODO: Remove once b/304507701 is resolved
- if Bool(s.Address) && ctx.Host() {
- s.Address = nil
- }
-
// Memtag_heap is only implemented on AArch64.
if ctx.Arch().ArchType != android.Arm64 || !ctx.Os().Bionic() {
s.Memtag_heap = nil