blob: e7f4c2cf33c581c935e4aeaef607a2a77cb85f9b [file] [log] [blame] [view]
nodir62c9184e2015-08-25 00:57:461# Windows Split DLLs
andybons3322f762015-08-24 21:37:092
nodir62c9184e2015-08-25 00:57:463A build mode where chrome.dll is split into two separate DLLs. This was
4undertaken as one possible workaround for toolchain limitations on Windows.
andybons3322f762015-08-24 21:37:095
6## How
7
nodir62c9184e2015-08-25 00:57:468Normally, you probably don't need to worry about doing this build. If for some
9reason you need to build it locally:
andybons3322f762015-08-24 21:37:0910
nodir62c9184e2015-08-25 00:57:46111. From a _Visual Studio Command Prompt_ running as **Administrator** run
12 `python tools\win\split_link\install_split_link.py`.
131. Set `GYP_DEFINES=chrome_split_dll=1`. In particular, don't have
14 `component=shared_library`. Other things, like `buildtype` or `fastbuild`
15 are fine.
161. `gclient runhooks`
171. `ninja -C out\Release chrome`
andybons3322f762015-08-24 21:37:0918
19`chrome_split_dll` currently applies only to chrome.dll (and not test binaries).
20
21## What
22
nodir62c9184e2015-08-25 00:57:4623This is intended to be a temporary measure until either the toolchain is
24improved or the code can be physically separated into two DLLs (based on a
25browser/child split).
andybons3322f762015-08-24 21:37:0926
nodir62c9184e2015-08-25 00:57:4627The link replacement forcibly splits chrome.dll into two halves based on a
28description in `build\split_link_partition.py`. Code is primarily split along
29browser/renderer lines. Roughly, Blink and its direct dependencies are in the
30"chrome1.dll", and the rest of the browser code remains in "chrome.dll".
andybons3322f762015-08-24 21:37:0931
nodir62c9184e2015-08-25 00:57:4632TODO: build\split_link_partition.py doesn't exist.
andybons3322f762015-08-24 21:37:0933
nodir62c9184e2015-08-25 00:57:4634Splitting the code this way allows keeping maximum optimization on the Blink
35portion of the code, which is important for performance.
36
37There is a compile time define set when building in this mode
38`CHROME_SPLIT_DLL`, however it should be used very sparingly-to-not-at-all.
andybons3322f762015-08-24 21:37:0939
40## Details
41
nodir62c9184e2015-08-25 00:57:4642This forcible split is implemented by putting .lib files in either one DLL or
43the other, and causing unresolved externals that result during linking to be
44forcibly exported from the other DLL. This works relatively cleanly for function
45import/export, however it cannot work for data export.
andybons3322f762015-08-24 21:37:0946
nodir62c9184e2015-08-25 00:57:4647There are relatively few instances where data exports are required across the
48DLL boundary. The waterfall builder
xiaoyin.l1003c0b2016-12-06 02:51:1749https://build.chromium.org/p/chromium/waterfall?show=Win%20Split will detect when
nodir62c9184e2015-08-25 00:57:4650new data exports are added, and these will need to be repaired. For constants,
51the data can be duplicated to both DLLs, but for writeable data, a wrapping
52set/get function will need to be added.
andybons3322f762015-08-24 21:37:0953
xiaoyin.l1003c0b2016-12-06 02:51:1754https://build.chromium.org/p/chromium/waterfall?show=Win%20Split does not exist.
nodir62c9184e2015-08-25 00:57:4655
56Some more details can be found on the initial commit of the split_link script
xiaoyin.l1003c0b2016-12-06 02:51:1757https://src.chromium.org/viewvc/chrome?revision=200049&view=revision and the
58associated bugs: https://crbug.com/237249 https://crbug.com/237267.