Support coverage instrumentation for Linux host

Bug: http://b/77792074

- Add the libclang_rt.profile runtime libraries directly to the compile
command (for both host and target) instead of relying on the Clang
driver.
- Move the coverage mutator to PreDepsMutators so the mutation has
already happened when runtime libraries are added during dependence
computation.
- Factor out cc/config/toolchain to identify libclang_rt.profile modules
for the x86 and x86_64 host.

Test: make NATIVE_COVERAGE=true produces coverage-enabled host binaries.
Change-Id: I1ebc8cffdf11622bfc18199a57674672888b3a5f
This commit is contained in:
Pirama Arumuga Nainar
2018-04-14 01:03:35 -07:00
parent 4884a172de
commit 358056c058
5 changed files with 38 additions and 10 deletions

View File

@@ -270,6 +270,14 @@ func (t *toolchainLinuxX8664) YasmFlags() string {
return "${config.LinuxX8664YasmFlags}"
}
func (t *toolchainLinuxX86) profileRuntimeLibrary() string {
return "libclang_rt.profile-i386"
}
func (t *toolchainLinuxX8664) profileRuntimeLibrary() string {
return "libclang_rt.profile-x86_64"
}
func (t *toolchainLinux) AvailableLibraries() []string {
return linuxAvailableLibraries
}