summaryrefslogtreecommitdiff
path: root/rust/coverage.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/coverage.go')
-rw-r--r--rust/coverage.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/coverage.go b/rust/coverage.go
index 8fdfa2342..91d34acce 100644
--- a/rust/coverage.go
+++ b/rust/coverage.go
@@ -22,6 +22,7 @@ import (
var CovLibraryName = "libprofile-clang-extras"
+// Add '%c' to default specifier after we resolve http://b/210012154
const profileInstrFlag = "-fprofile-instr-generate=/data/misc/trace/clang-%p-%m.profraw"
type coverage struct {
@@ -70,6 +71,10 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags
"-Wl,-z,nostart-stop-gc",
)
deps.StaticLibs = append(deps.StaticLibs, coverage.OutputFile().Path())
+ if cc.EnableContinuousCoverage(ctx) {
+ flags.RustFlags = append(flags.RustFlags, "-C llvm-args=--runtime-counter-relocation")
+ flags.LinkFlags = append(flags.LinkFlags, "-Wl,-mllvm,-runtime-counter-relocation")
+ }
}
return flags, deps