Commit ffdfde4c authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Commit Bot

mini_installer: Don't depend on exe_and_shlib_deps unless asan is enabled.

mini_installer is a "special" target that avoids linking against
vcruntime by defining a custom entry point. In normal Windows builds,
exe_and_shlib_deps will be empty, so depending on it has no effect. But
when building with use_custom_libcxx=true, exe_and_shlib_deps depends
on libc++, which in turn depends on vcruntime, leading to undefined
symbol errors at link time when the custom entry point is used.

This change avoids the dependency on exe_and_shlib_deps unless the
custom entry point is disabled, i.e. when we are linking with asan.

Bug: 801780
Change-Id: Ieff8004ef14c9fda20ff23234cab364ae949afbe
Reviewed-on: https://chromium-review.googlesource.com/952068
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541580}
parent 6cc3336b
......@@ -270,19 +270,30 @@ template("generate_mini_installer") {
"/NXCOMPAT",
]
if (!is_asan) {
ldflags += [ "/ENTRY:MainEntryPoint" ]
}
libs = [ "setupapi.lib" ]
deps = [
":$archive_name",
":lib",
":version",
"//build/config:exe_and_shlib_deps",
"//build/win:default_exe_manifest",
]
# In general, mini_installer tries to avoid depending on the C++ standard
# library for size reasons. This is achieved by setting a custom entry point
# (which avoids pulling in the standard library via a link dependency) as
# well as by not depending on exe_and_shlib_deps (which depends on
# libc++ in use_custom_libcxx=true builds).
#
# But in asan builds we need to link against the asan runtime library, which
# in turn depends on the standard library and relies on it to run
# initializers. So in asan builds we depend on exe_and_shlib_deps for the
# asan runtime and use the standard entry point.
if (is_asan) {
deps += [ "//build/config:exe_and_shlib_deps" ]
} else {
ldflags += [ "/ENTRY:MainEntryPoint" ]
}
}
}
......
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