From 20768b88404325d62ba84a7dc917c377defcbdbc Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Mon, 1 Feb 2021 14:56:21 -0800 Subject: [PATCH] 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 --- rust/config/global.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/config/global.go b/rust/config/global.go index fb6227804..182dc6ac2 100644 --- a/rust/config/global.go +++ b/rust/config/global.go @@ -47,6 +47,8 @@ var ( "-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{