Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Issue 15067010: split_link tool, config, and scripts for windows build (Closed)

Created:
7 years, 7 months ago by scottmg
Modified:
7 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200049

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : links! #

Patch Set 4 : . #

Patch Set 5 : better linker shim, install check #

Patch Set 6 : fix corrupted file from machine crash :( #

Patch Set 7 : . #

Total comments: 8

Patch Set 8 : simplify entry point, comments #

Patch Set 9 : dll version resource in all dlls #

Total comments: 1

Patch Set 10 : linebreak() #

Total comments: 16

Patch Set 11 : fixes #

Total comments: 27

Patch Set 12 : . #

Total comments: 24

Patch Set 13 : . #

Patch Set 14 : . #

Patch Set 15 : . #

Total comments: 8

Patch Set 16 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+887 lines, -136 lines) Patch
M build/common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -2 lines 0 comments Download
A build/split_link_partition.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +112 lines, -0 lines 0 comments Download
M chrome/chrome_dll.gypi View 1 2 3 4 5 6 7 5 chunks +72 lines, -134 lines 0 comments Download
A chrome/split_dll_fake_entry.cc View 1 2 3 4 5 6 7 8 9 1 chunk +38 lines, -0 lines 0 comments Download
A tools/win/split_link/check_installed.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
A tools/win/split_link/install_split_link.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +95 lines, -0 lines 0 comments Download
A tools/win/split_link/split_link.cc View 1 2 3 4 5 6 1 chunk +257 lines, -0 lines 0 comments Download
A tools/win/split_link/split_link.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +262 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
scottmg
Hi, I'm not sure there's a great reviewer for this, so I'm hitting all 3 ...
7 years, 7 months ago (2013-05-13 16:45:57 UTC) #1
cpu_(ooo_6.6-7.5)
looking good on the parts I understand. https://codereview.chromium.org/15067010/diff/13001/build/split_link_partition.json File build/split_link_partition.json (right): https://codereview.chromium.org/15067010/diff/13001/build/split_link_partition.json#newcode56 build/split_link_partition.json:56: add short ...
7 years, 7 months ago (2013-05-13 19:29:52 UTC) #2
scottmg
https://codereview.chromium.org/15067010/diff/13001/build/split_link_partition.json File build/split_link_partition.json (right): https://codereview.chromium.org/15067010/diff/13001/build/split_link_partition.json#newcode56 build/split_link_partition.json:56: On 2013/05/13 19:29:52, cpu wrote: > add short comment ...
7 years, 7 months ago (2013-05-13 20:00:11 UTC) #3
darin (slow to review)
I don't think I'm going to be very helpful on this code review. If you ...
7 years, 7 months ago (2013-05-13 20:04:09 UTC) #4
cpu_(ooo_6.6-7.5)
lgtm https://codereview.chromium.org/15067010/diff/25001/chrome/split_dll_fake_entry.cc File chrome/split_dll_fake_entry.cc (right): https://codereview.chromium.org/15067010/diff/25001/chrome/split_dll_fake_entry.cc#newcode34 chrome/split_dll_fake_entry.cc:34: int main() { __debugbreak(); } main() { __debugbreak(); ...
7 years, 7 months ago (2013-05-13 20:58:08 UTC) #5
scottmg
+maruel M-A, since this is vaguely similar to https://codereview.chromium.org/8059024 which you reviewed, would you mind ...
7 years, 7 months ago (2013-05-13 21:11:14 UTC) #6
M-A Ruel
A few nits, nothing super important. https://codereview.chromium.org/15067010/diff/30001/tools/win/split_link/check_installed.py File tools/win/split_link/check_installed.py (right): https://codereview.chromium.org/15067010/diff/30001/tools/win/split_link/check_installed.py#newcode5 tools/win/split_link/check_installed.py:5: import sys sort ...
7 years, 7 months ago (2013-05-13 21:23:41 UTC) #7
scottmg
Thanks! https://codereview.chromium.org/15067010/diff/30001/tools/win/split_link/check_installed.py File tools/win/split_link/check_installed.py (right): https://codereview.chromium.org/15067010/diff/30001/tools/win/split_link/check_installed.py#newcode5 tools/win/split_link/check_installed.py:5: import sys On 2013/05/13 21:23:42, Marc-Antoine Ruel wrote: ...
7 years, 7 months ago (2013-05-13 21:30:22 UTC) #8
M-A Ruel
https://codereview.chromium.org/15067010/diff/30001/tools/win/split_link/install_split_link.py File tools/win/split_link/install_split_link.py (right): https://codereview.chromium.org/15067010/diff/30001/tools/win/split_link/install_split_link.py#newcode83 tools/win/split_link/install_split_link.py:83: subprocess.check_call('cl /nologo /Ox /Zi /W4 /WX /D_UNICODE /DUNICODE' On ...
7 years, 7 months ago (2013-05-13 21:55:59 UTC) #9
scottmg
https://codereview.chromium.org/15067010/diff/30002/tools/win/split_link/split_link.py File tools/win/split_link/split_link.py (right): https://codereview.chromium.org/15067010/diff/30002/tools/win/split_link/split_link.py#newcode22 tools/win/split_link/split_link.py:22: """Parse the command line intended for link.exe and return ...
7 years, 7 months ago (2013-05-13 23:00:14 UTC) #10
M-A Ruel
https://codereview.chromium.org/15067010/diff/30002/tools/win/split_link/split_link.py File tools/win/split_link/split_link.py (right): https://codereview.chromium.org/15067010/diff/30002/tools/win/split_link/split_link.py#newcode22 tools/win/split_link/split_link.py:22: """Parse the command line intended for link.exe and return ...
7 years, 7 months ago (2013-05-14 00:39:09 UTC) #11
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/15067010/diff/42001/build/common.gypi File build/common.gypi (left): https://codereview.chromium.org/15067010/diff/42001/build/common.gypi#oldcode1841 build/common.gypi:1841: 'defines': ['CHROME_SPLIT_DLL'], can we put the define back? I ...
7 years, 7 months ago (2013-05-14 00:51:55 UTC) #12
scottmg
Also removed the half-hearted attempts at cygwin as it was untested anyway. (Except in the ...
7 years, 7 months ago (2013-05-14 03:35:07 UTC) #13
M-A Ruel
lgtm with nits https://codereview.chromium.org/15067010/diff/55001/tools/win/split_link/install_split_link.py File tools/win/split_link/install_split_link.py (right): https://codereview.chromium.org/15067010/diff/55001/tools/win/split_link/install_split_link.py#newcode71 tools/win/split_link/install_split_link.py:71: subprocess.check_call('cl /nologo /Ox /Zi /W4 /WX ...
7 years, 7 months ago (2013-05-14 19:38:08 UTC) #14
scottmg
thanks https://codereview.chromium.org/15067010/diff/55001/tools/win/split_link/install_split_link.py File tools/win/split_link/install_split_link.py (right): https://codereview.chromium.org/15067010/diff/55001/tools/win/split_link/install_split_link.py#newcode71 tools/win/split_link/install_split_link.py:71: subprocess.check_call('cl /nologo /Ox /Zi /W4 /WX /D_UNICODE /DUNICODE' ...
7 years, 7 months ago (2013-05-14 19:45:51 UTC) #15
scottmg
7 years, 7 months ago (2013-05-14 20:04:21 UTC) #16
Message was sent while issue was closed.
Committed patchset #16 manually as r200049 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698