Commit 5158b6cf authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

win: Clean up coverage linker flags after clang r360674.

After clang r360674, each .obj file embeds the path to the profile library
as a dependent lib. No intended behavior change.

Change-Id: Ie892fccdb8aaefc2545db56fb3274dc6f0992a96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630986Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663751}
parent c30e29df
......@@ -17,22 +17,10 @@ config("pgo_instrumentation_flags") {
if (chrome_pgo_phase == 1) {
if (is_clang) {
cflags = [ "-fprofile-instr-generate" ]
if (is_win) {
# Normally, we pass -fprofile-instr-generate to the compiler and it
# automatically passes the right flags to the linker.
# However, on Windows, we call the linker directly, without going
# through the compiler driver. This means we need to pass the right
# flags ourselves.
_clang_rt_base_path =
"$clang_base_path/lib/clang/$clang_version/lib/windows"
if (target_cpu == "x86") {
_clang_rt_suffix = "-i386.lib"
} else if (target_cpu == "x64") {
_clang_rt_suffix = "-x86_64.lib"
}
assert(_clang_rt_suffix != "", "target CPU $target_cpu not supported")
ldflags += [ "$_clang_rt_base_path/clang_rt.profile$_clang_rt_suffix" ]
} else {
if (!is_win) {
# Windows directly calls link.exe instead of the compiler driver when
# linking, and embeds the path to the profile runtime library as
# dependent library into each object file.
ldflags += [ "-fprofile-instr-generate" ]
}
} else if (is_win) {
......
......@@ -8,21 +8,10 @@ config("default_coverage") {
if (use_clang_coverage) {
ldflags = []
if (!is_win) {
ldflags += [ "-fprofile-instr-generate" ]
} else {
# Windows directly calls link.exe instead of the compiler driver when
# linking. Hence, pass the runtime libraries instead of
# -fsanitize=address.
# TODO(rnk): Come up with a more uniform approach for linking against
# compiler-rt for sanitizers and coverage.
if (target_cpu == "x64") {
ldflags += [ "clang_rt.profile-x86_64.lib" ]
} else if (target_cpu == "x86") {
ldflags += [ "clang_rt.profile-i386.lib" ]
} else {
assert(false &&
"use_clang_coverage=true not supported yet for this target_cpu")
}
# linking, and embeds the path to the profile runtime library as
# dependent library into each object file.
ldflags += [ "-fprofile-instr-generate" ]
}
cflags = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment