rust: Use v0 mangling format globally
By default, rust uses the `legacy` mangling format. Using llvm coverage
switches it to using the new `v0` format. Rather than pushing the llvm
coverage back to `legacy` format, move Android forwards to `v0`. This
also has the added benefit that Rust symbols can be detected in the
codebase by looking for a leading "_R", aiding in demangler selection.
Test: builds, resulting object files have leading _R rather than _Z
Test: atest keystore2_test
Bug: 178565008
Change-Id: I7fcd591535d08260686c62fbfa6f7b61b31ed989
diff --git a/rust/config/global.go b/rust/config/global.go
index fb62278..182dc6a 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -47,6 +47,8 @@
"-C debuginfo=2",
"-C opt-level=3",
"-C relocation-model=pic",
+ // Use v0 mangling to distinguish from C++ symbols
+ "-Z symbol-mangling-version=v0",
}
deviceGlobalRustFlags = []string{