Merge "[rust/coverage] Remove obsolete WAR to pass -z,start-stop-gc" am: 1785fcb171

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1960243

Change-Id: I5147e9eb8630f40ef5c0afbc2ed5a50e1dfdbcf4
This commit is contained in:
Pirama Arumuga Nainar
2022-01-27 18:46:48 +00:00
committed by Automerger Merge Worker

View File

@@ -57,18 +57,7 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags
flags.RustFlags = append(flags.RustFlags, flags.RustFlags = append(flags.RustFlags,
"-Z instrument-coverage", "-g") "-Z instrument-coverage", "-g")
flags.LinkFlags = append(flags.LinkFlags, flags.LinkFlags = append(flags.LinkFlags,
profileInstrFlag, "-g", coverage.OutputFile().Path().String(), "-Wl,--wrap,open", profileInstrFlag, "-g", coverage.OutputFile().Path().String(), "-Wl,--wrap,open")
// Upstream LLVM change 6d2d3bd0a6 made
// -z,start-stop-gc the default. It drops metadata
// sections like __llvm_prf_data unless they are marked
// SHF_GNU_RETAIN. https://reviews.llvm.org/D97448
// marks generated sections, including __llvm_prf_data
// as SHF_GNU_RETAIN. However this change is not in
// the Rust toolchain. Since we link Rust libs with
// new lld, we should use nostart-stop-gc until the
// Rust toolchain updates past D97448.
"-Wl,-z,nostart-stop-gc",
)
deps.StaticLibs = append(deps.StaticLibs, coverage.OutputFile().Path()) deps.StaticLibs = append(deps.StaticLibs, coverage.OutputFile().Path())
} }