[rust] [coverage] Don't pass -C link-dead-code

Bug: http://b/186873963

Per jgalenson@, this was added for GCOV and is not needed for clang
coverage.

Test: http://go/abtd/run/L71000000950546158
Change-Id: I352669687cbe764d938acb94d9d4fe0c24a31a56
This commit is contained in:
Pirama Arumuga Nainar 2021-07-15 10:10:29 -07:00
parent e04058f291
commit b13e8ac6c8
2 changed files with 2 additions and 2 deletions

View file

@ -55,7 +55,7 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags
flags.Coverage = true
coverage := ctx.GetDirectDepWithTag(CovLibraryName, cc.CoverageDepTag).(cc.LinkableInterface)
flags.RustFlags = append(flags.RustFlags,
"-Z instrument-coverage", "-g", "-C link-dead-code")
"-Z instrument-coverage", "-g")
flags.LinkFlags = append(flags.LinkFlags,
profileInstrFlag, "-g", coverage.OutputFile().Path().String(), "-Wl,--wrap,open")
deps.StaticLibs = append(deps.StaticLibs, coverage.OutputFile().Path())

View file

@ -56,7 +56,7 @@ func TestCoverageFlags(t *testing.T) {
fizzCov := ctx.ModuleForTests("fizz_cov", "android_arm64_armv8-a_cov").Rule("rustc")
buzzNoCov := ctx.ModuleForTests("buzzNoCov", "android_arm64_armv8-a").Rule("rustc")
rustcCoverageFlags := []string{"-Z instrument-coverage", " -g ", "-C link-dead-code"}
rustcCoverageFlags := []string{"-Z instrument-coverage", " -g "}
for _, flag := range rustcCoverageFlags {
missingErrorStr := "missing rustc flag '%s' for '%s' module with coverage enabled; rustcFlags: %#v"
containsErrorStr := "contains rustc flag '%s' for '%s' module with coverage disabled; rustcFlags: %#v"