diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 20:04:15 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-14 20:04:15 +0000 |
commit | ac4d0ff231ca1a04e06d783d56d3fc00a02dead1 (patch) | |
tree | 802b955cbfb64d17c696e4f506257d38a4f19da2 /build | |
parent | 602e54ce5a2a0c6b9eb3b75b60d6ccca747eaf97 (diff) | |
download | chromium_src-ac4d0ff231ca1a04e06d783d56d3fc00a02dead1.zip chromium_src-ac4d0ff231ca1a04e06d783d56d3fc00a02dead1.tar.gz chromium_src-ac4d0ff231ca1a04e06d783d56d3fc00a02dead1.tar.bz2 |
split_link tool, config, and scripts for windows build
First pass at split linker. Splits inputs based on json spec, uses .def files
to export symbols in the other half, relinks to generate an import lib, and
finally links again for the real link, using the generated def file and import
lib. And then, repeats those steps until success (not all unresolved externals
are reported by the linker on the first pass). It's necessary to use the
linker to report externals rather than cracking lib/objs because when doing
LTCG, the object files are in an undocumented compiler-internal format and the
exports can't be gathered (and probably aren't fully determined yet).
Currently this approach only handles chrome.dll, not other large targets that
are monolithic exes (rather than mostly in a DLL with an EXE loader).
Integrated with build system by a linker shim. Original link.exe is saved, and
replaced by split_link binary. If "/splitlink" is found on the command line,
then run our script that does the iterations/exporting magic. Otherwise,
fallback to the original linker.
When GYP_DEFINES includes chrome_split_dll=1, the split linker is invoked.
chrome.exe has not yet been modified to know how to load split binaries, so
the build flag will not yet be directly useful for those not working on this
problem.
Release, non-LTCG, non-split:
05/09/2013 04:57 PM 57,447,936 chrome.dll
Release, non-LTCG, split:
05/10/2013 12:47 PM 39,567,872 chrome0.dll
05/10/2013 12:48 PM 19,274,240 chrome1.dll
Release, partial-LTCG (same as current settings), split:
05/10/2013 03:56 PM 25,934,336 chrome0.dll
05/10/2013 04:13 PM 16,347,648 chrome1.dll
It should be possible to get higher optimization levels for chrome1.dll (or
perhaps both parts), but that can happen in subsequent changes after more
testing.
TBR=cpu@chromium.org, maruel@chromium.org
BUG=237249
Review URL: https://codereview.chromium.org/15067010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 7 | ||||
-rw-r--r-- | build/split_link_partition.py | 112 |
2 files changed, 117 insertions, 2 deletions
diff --git a/build/common.gypi b/build/common.gypi index d3b0b27..b449afc 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -894,8 +894,8 @@ # to get incremental linking to be faster in debug builds. 'incremental_chrome_dll%': '0', - # Experimental setting to break chrome.dll in to chrome_browser.dll and - # chrome_child.dll. + # Experimental setting to break chrome.dll in to multiple parts (currently + # two, split primarily along browser/render lines). 'chrome_split_dll%': '0', # The default settings for third party code for treating @@ -1829,6 +1829,9 @@ ], }], ['chrome_split_dll', { + 'variables': { + 'chrome_split_dll': '<!(python <(DEPTH)/tools/win/split_link/check_installed.py)', + }, 'defines': ['CHROME_SPLIT_DLL'], }], ['OS=="linux" and clang==1 and host_arch=="ia32"', { diff --git a/build/split_link_partition.py b/build/split_link_partition.py new file mode 100644 index 0000000..b77f63d --- /dev/null +++ b/build/split_link_partition.py @@ -0,0 +1,112 @@ +# This dict determines how chrome.dll is split into multiple parts.
+{
+ 'parts': [
+ # These sections are matched in order, and a matching input will go into
+ # the part for the last block that matches. Inputs are lower()d before
+ # the regex is run.
+
+ # chrome0.dll.
+ [
+ r'.*',
+ ],
+
+ # chrome1.dll.
+ [
+ r'\\libwebp\\.*\.lib$',
+ r'\\media\\.*\.lib$',
+ r'bindings',
+ r'content_worker\.lib$',
+ r'hunspell\.lib$',
+ r'hyphen\.lib$',
+ r'renderer\.lib$',
+ r'v8.*\.lib$',
+ r'webcore.*\.lib$',
+ r'webkit.*\.lib$',
+ r'webkit.*modules\.lib$',
+ r'wtf\.lib$',
+ ],
+ ],
+
+ # These go into all parts.
+ 'all': [
+ # Duplicated code. Be sure that you really want N copies of your code
+ # before adding it here. Hopefully we don't really need all of these.
+ #r'_common\.lib$', # TODO: This might be a bit general.
+ #r'\\base\\base.*\.lib$',
+ #r'modp_b64\.lib$',
+ #r'\\icu\\icu.*\.lib$',
+ #r'\\skia\\skia.*\.lib$',
+ #r'ipc\.lib$',
+ ## TODO: These image/coded related things should probably be renderer only?
+ #r'\\libvpx\\.*\.lib$',
+ #r'opus\.lib$',
+ #r'libjpeg\.lib$',
+ #r'qcms\.lib$',
+ #r'libpng\.lib$',
+ #r'zlib\\.*\.lib$',
+ #r'libxml2\.lib$',
+ #r'libxslt\.lib$',
+ #r'\\sdch\\.*\.lib$',
+ #r'\\net\\.*\.lib$',
+ #r'\\nss\\.*\.lib$',
+ #r'\\crypto\\.*\.lib$',
+ #r'googleurl\.lib$', # TODO: renaming.
+ #r'\\sql\\.*\.lib$',
+ #r'sqlite3\.lib$',
+
+ # See comment in .cc for explanation.
+ r'split_dll_fake_entry\.obj$',
+
+ # To get DLL version information in all.
+ r'chrome_dll_version.*\.res$',
+
+ # System and third party import libs.
+ r'^advapi32\.lib$',
+ r'^atlthunk\.lib$',
+ r'^chrome\.user32\.delay\.lib$',
+ r'^comctl32\.lib$',
+ r'^comdlg32\.lib$',
+ r'^crypt32\.lib$',
+ r'^d2d1\.lib$',
+ r'^d3d9\.lib$',
+ r'^dbghelp\.lib$',
+ r'^delayimp\.lib$',
+ r'^dinput8\.lib$',
+ r'^dnsapi\.lib$',
+ r'^dwmapi\.lib$',
+ r'^dxva2\.lib$',
+ r'ffmpegsumo\.lib$',
+ r'^gdi32\.lib$',
+ r'libcmt\.lib$', # No ^ so it matches gen/allocator, etc.
+ r'^imm32\.lib$',
+ r'^iphlpapi\.lib$',
+ r'^kernel32\.lib$',
+ r'^locationapi\.lib$',
+ r'^mf\.lib$',
+ r'^mfplat\.lib$',
+ r'^mfreadwrite\.lib$',
+ r'^mfuuid\.lib$',
+ r'^msimg32\.lib$',
+ r'^odbc32\.lib$',
+ r'^odbccp32\.lib$',
+ r'^ole32\.lib$',
+ r'^oleacc\.lib$',
+ r'^oleaut32\.lib$',
+ r'^portabledeviceguids\.lib$',
+ r'^psapi\.lib$',
+ r'^secur32\.lib$',
+ r'^sensorsapi\.lib$',
+ r'^setupapi\.lib$',
+ r'^shell32\.lib$',
+ r'^shlwapi\.lib$',
+ r'^strmiids\.lib$',
+ r'^user32\.winxp\.lib$',
+ r'^usp10\.lib$',
+ r'^uuid\.lib$',
+ r'^version\.lib$',
+ r'^wininet\.lib$',
+ r'^winmm\.lib$',
+ r'^winspool\.lib$',
+ r'^ws2_32\.lib$',
+ ],
+}
|