summaryrefslogtreecommitdiffstats
path: root/chrome/chrome_dll.gypi
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-14 20:04:15 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-14 20:04:15 +0000
commitac4d0ff231ca1a04e06d783d56d3fc00a02dead1 (patch)
tree802b955cbfb64d17c696e4f506257d38a4f19da2 /chrome/chrome_dll.gypi
parent602e54ce5a2a0c6b9eb3b75b60d6ccca747eaf97 (diff)
downloadchromium_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 'chrome/chrome_dll.gypi')
-rw-r--r--chrome/chrome_dll.gypi206
1 files changed, 72 insertions, 134 deletions
diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi
index b38bfa1..9ed89d6 100644
--- a/chrome/chrome_dll.gypi
+++ b/chrome/chrome_dll.gypi
@@ -2,75 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
- 'variables': {
- 'browser_dll_sources': [
- 'app/chrome_command_ids.h',
- 'app/chrome_dll.rc',
- 'app/chrome_dll_resource.h',
- 'app/chrome_main.cc',
- 'app/chrome_main_delegate.cc',
- 'app/chrome_main_delegate.h',
- 'app/delay_load_hook_win.cc',
- 'app/delay_load_hook_win.h',
-
- '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
- '../base/win/dllmain.cc',
-
- '../ui/resources/cursors/aliasb.cur',
- '../ui/resources/cursors/cell.cur',
- '../ui/resources/cursors/col_resize.cur',
- '../ui/resources/cursors/copy.cur',
- '../ui/resources/cursors/none.cur',
- '../ui/resources/cursors/row_resize.cur',
- '../ui/resources/cursors/vertical_text.cur',
- '../ui/resources/cursors/zoom_in.cur',
- '../ui/resources/cursors/zoom_out.cur',
-
- # TODO: It would be nice to have these pulled in
- # automatically from direct_dependent_settings in
- # their various targets (net.gyp:net_resources, etc.),
- # but that causes errors in other targets when
- # resulting .res files get referenced multiple times.
- '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
- ],
- 'delay_load_dlls_win': [
- 'comdlg32.dll',
- 'crypt32.dll',
- 'cryptui.dll',
- 'dhcpcsvc.dll',
- 'imagehlp.dll',
- 'imm32.dll',
- 'iphlpapi.dll',
- 'setupapi.dll',
- 'urlmon.dll',
- 'winhttp.dll',
- 'wininet.dll',
- 'winspool.drv',
- 'ws2_32.dll',
- 'wsock32.dll',
- ],
- 'browser_dependencies_win': [
- # On Windows, link the dependencies (libraries) that make
- # up actual Chromium functionality into this .dll.
- 'chrome_resources.gyp:chrome_resources',
- 'chrome_version_resources',
- '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
- '../crypto/crypto.gyp:crypto',
- '../printing/printing.gyp:printing',
- '../net/net.gyp:net_resources',
- '../third_party/cld/cld.gyp:cld',
- '../ui/views/views.gyp:views',
- '../webkit/support/webkit_support.gyp:webkit_resources',
- ],
- 'manifest_files_win': '$(ProjectDir)\\app\\chrome.dll.manifest',
- },
'conditions': [
['OS=="mac" or OS=="win"', {
'targets': [
@@ -169,11 +100,55 @@
['OS=="win"', {
'product_name': 'chrome',
'dependencies': [
- '<@(browser_dependencies_win)',
+ # On Windows, link the dependencies (libraries) that make
+ # up actual Chromium functionality into this .dll.
'chrome_dll_pdb_workaround',
+ 'chrome_resources.gyp:chrome_resources',
+ 'chrome_version_resources',
+ '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
+ '../crypto/crypto.gyp:crypto',
+ '../printing/printing.gyp:printing',
+ '../net/net.gyp:net_resources',
+ '../third_party/cld/cld.gyp:cld',
+ '../ui/views/views.gyp:views',
+ '../webkit/support/webkit_support.gyp:webkit_resources',
],
'sources': [
- '<@(browser_dll_sources)',
+ 'app/chrome_command_ids.h',
+ 'app/chrome_dll.rc',
+ 'app/chrome_dll_resource.h',
+ 'app/chrome_main.cc',
+ 'app/chrome_main_delegate.cc',
+ 'app/chrome_main_delegate.h',
+ 'app/delay_load_hook_win.cc',
+ 'app/delay_load_hook_win.h',
+
+ '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
+ '../base/win/dllmain.cc',
+
+ '../ui/resources/cursors/aliasb.cur',
+ '../ui/resources/cursors/cell.cur',
+ '../ui/resources/cursors/col_resize.cur',
+ '../ui/resources/cursors/copy.cur',
+ '../ui/resources/cursors/none.cur',
+ '../ui/resources/cursors/row_resize.cur',
+ '../ui/resources/cursors/vertical_text.cur',
+ '../ui/resources/cursors/zoom_in.cur',
+ '../ui/resources/cursors/zoom_out.cur',
+
+ # TODO: It would be nice to have these pulled in
+ # automatically from direct_dependent_settings in
+ # their various targets (net.gyp:net_resources, etc.),
+ # but that causes errors in other targets when
+ # resulting .res files get referenced multiple times.
+ '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
],
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
@@ -230,11 +205,24 @@
}],
],
'DelayLoadDLLs': [
- '<@(delay_load_dlls_win)',
+ 'comdlg32.dll',
+ 'crypt32.dll',
+ 'cryptui.dll',
+ 'dhcpcsvc.dll',
+ 'imagehlp.dll',
+ 'imm32.dll',
+ 'iphlpapi.dll',
+ 'setupapi.dll',
+ 'urlmon.dll',
+ 'winhttp.dll',
+ 'wininet.dll',
+ 'winspool.drv',
+ 'ws2_32.dll',
+ 'wsock32.dll',
],
},
'VCManifestTool': {
- 'AdditionalManifestFiles': '<(manifest_files_win)',
+ 'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.dll.manifest',
},
},
}], # OS=="win"
@@ -244,6 +232,17 @@
['OS=="mac" and component=="shared_library"', {
'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
}],
+ ['chrome_split_dll', {
+ 'sources': [
+ # See comment in .cc for explanation.
+ 'split_dll_fake_entry.cc',
+ ],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalOptions': ['/splitlink'],
+ },
+ }
+ }],
['OS=="mac"', {
'xcode_settings': {
# Define the order of symbols within the framework. This
@@ -307,67 +306,6 @@
}, # target chrome_main_dll
], # targets
}], # OS=="mac" or OS=="win"
- ['OS=="win" and chrome_split_dll', {
- 'targets': [
- {
- 'target_name': 'chrome_browser_dll',
- 'type': 'shared_library',
- 'variables': {
- 'enable_wexit_time_destructors': 1,
- },
- 'dependencies': [
- '<@(chromium_browser_dependencies)',
- 'app/policy/cloud_policy_codegen.gyp:policy',
- # TODO(scottmg): http://crbug.com/237249 Probably should be
- # renderer.
- '../ppapi/ppapi_internal.gyp:ppapi_host',
- ],
- 'conditions': [
- ['use_aura==1', {
- 'dependencies': [
- '../ui/compositor/compositor.gyp:compositor',
- ],
- }],
- ['use_ash==1', {
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/ash/ash_resources/ash_wallpaper_resources.rc',
- ],
- }],
- ['OS=="win"', {
- 'product_name': 'chrome_browser',
- 'dependencies': [
- '<@(browser_dependencies_win)',
- ],
- 'sources': [
- '<@(browser_dll_sources)',
- ],
- 'include_dirs': [
- '<(DEPTH)/third_party/wtl/include',
- ],
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'BaseAddress': '0x01c30000',
- 'ImportLibrary': '$(OutDir)\\lib\\chrome_browser_dll.lib',
- # Set /SUBSYSTEM:WINDOWS for chrome_browser.dll (for consistency).
- 'SubSystem': '2',
- 'DelayLoadDLLs': [
- '<@(delay_load_dlls_win)',
- ],
- },
- 'VCManifestTool': {
- 'AdditionalManifestFiles': '<(manifest_files_win)',
- },
- },
- }], # OS=="win"
- ['win_use_allocator_shim==1', {
- 'dependencies': [
- '<(allocator_target)',
- ],
- }],
- ], # conditions
- }, # target chrome_browser_dll
- ], # targets
- }],
['OS=="win"', {
'targets': [
{