Commit add2efb3 authored by Reid Kleckner's avatar Reid Kleckner Committed by Commit Bot

Drop redundant ASan library from exe link line

This works around a bug (https://llvm.org/pr37592) in LLD, where if
foo.lib appears on the link line without -wholearchive:, it doesn't take
effect. Instead, only pass the -wholearchive:foo.lib flag, which adds
the library as an input and turns on the wholearchive behavior that we
need.

Fixes base_unittests StackSamplingProfilerTest.OtherLibrary and related
tests, which were failing because chrome.exe was missing an exported
function.

Remove the /include flag workaround for https://crbug.com/777087.

BUG=777087,844398
R=mmoroz@chromium.org

Change-Id: I493e1dcf6963048f7e83df1c937b4a4a62dd96bb
Reviewed-on: https://chromium-review.googlesource.com/1073890Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562042}
parent 1c11fb94
...@@ -311,22 +311,10 @@ config("asan_flags") { ...@@ -311,22 +311,10 @@ config("asan_flags") {
config("link_executable") { config("link_executable") {
if (is_asan && is_win && !is_component_build) { if (is_asan && is_win && !is_component_build) {
if (target_cpu == "x64") { if (target_cpu == "x64") {
libs = [ "clang_rt.asan-x86_64.lib" ] ldflags = [ "-wholearchive:clang_rt.asan-x86_64.lib" ]
ldflags = [
"-wholearchive:clang_rt.asan-x86_64.lib",
"-include:__asan_get_free_stack",
]
} else { } else {
assert(target_cpu == "x86", "WinASan unsupported architecture") assert(target_cpu == "x86", "WinASan unsupported architecture")
libs = [ "clang_rt.asan-i386.lib" ] ldflags = [ "-wholearchive:clang_rt.asan-i386.lib" ]
ldflags = [
"-wholearchive:clang_rt.asan-i386.lib",
# TODO(crbug.com/777087): The linker in VS 15.4 does not respect
# /wholearchive. This manually includes a symbol to work around that.
# We can remove it when the linker is fixed.
"-include:___asan_get_free_stack",
]
} }
} }
} }
......
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