[gn build] Fix llvm_build_instrumented_coverage=true builds with goma/rbe

This commit is contained in:
Nico Weber 2021-07-19 19:57:02 -04:00
parent 15bf66d2f8
commit 18a8aaee0e
1 changed files with 8 additions and 0 deletions

View File

@ -233,6 +233,14 @@ config("compiler_defaults") {
"-fprofile-instr-generate=" + "-fprofile-instr-generate=" +
rebase_path("$root_build_dir/profiles/%4m.profraw"), rebase_path("$root_build_dir/profiles/%4m.profraw"),
] ]
if (use_goma) {
# goma has a bug where it writes the server-side absolute path.
# Work around that.
# FIXME: Instead, set this to `.` for deterministic builds and pass
# the build dir to prepare-code-coverage-artifact.py instead.
cflags += [ "-fcoverage-compilation-dir=" + rebase_path(root_build_dir) ]
}
if (host_os != "win") { if (host_os != "win") {
ldflags += [ "-fprofile-instr-generate" ] ldflags += [ "-fprofile-instr-generate" ]
} }