Commit 1ecc5fff authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Document how mini_installer avoids linking to the CRT

We spent a while figuring out how and why mini_installer.exe avoids
pulling in the C run-time and I wanted to make sure it was working
correctly and was slightly better documented. This just adds some
comments, for future generations.

Bug: 934032
Change-Id: I917a7532d6d8e92a21d58e9cedf0af44fee488ed
Reviewed-on: https://chromium-review.googlesource.com/c/1481956
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634753}
parent 3a6bb87b
......@@ -278,6 +278,9 @@ template("generate_mini_installer") {
# dependency on //buildtools/third_party/libc++ in builds that set
# use_custom_libcxx=true.
#
# The net result is similar to linking with /NODEFAULTLIB, but more precise
# as it just excludes the CRT.
#
# 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.
......
......@@ -14,7 +14,8 @@
// BasicRuntimeChecks="0"
// BufferSecurityCheck="false" compiler: /GS-
// EntryPointSymbol="MainEntryPoint" linker: /ENTRY
// IgnoreAllDefaultLibraries="true" linker: /NODEFAULTLIB
// /ENTRY also stops the CRT from being pulled in and does this more
// precisely than /NODEFAULTLIB
// OptimizeForWindows98="1" linker: /OPT:NOWIN98
// linker: /SAFESEH:NO
......
......@@ -28,8 +28,9 @@ extern "C" int WINAPI wWinMain(HINSTANCE /* instance */,
}
#endif
// We don't link with the CRT so we have to implement CRT functions that the
// compiler generates calls to.
// We don't link with the CRT (this is enforced through use of the /ENTRY linker
// flag) so we have to implement CRT functions that the compiler generates calls
// to.
// VC Express editions don't come with the memset CRT obj file and linking to
// the obj files between versions becomes a bit problematic. Therefore,
......
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