From 4ebc105ec1ccc849c069ea613befad95e51fd9b6 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 19 Jul 2021 19:57:02 -0400 Subject: [PATCH] [gn build] Fix llvm_build_instrumented_coverage=true builds with goma/rbe --- utils/gn/build/BUILD.gn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/gn/build/BUILD.gn b/utils/gn/build/BUILD.gn index 7998cde3712..9c19114ad52 100644 --- a/utils/gn/build/BUILD.gn +++ b/utils/gn/build/BUILD.gn @@ -233,6 +233,14 @@ config("compiler_defaults") { "-fprofile-instr-generate=" + 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") { ldflags += [ "-fprofile-instr-generate" ] }