Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(48)

Issue 2114783002: Shrink chrome_elf.dll by switching source_sets to static_library (Closed)

Created:
3 years, 5 months ago by brucedawson
Modified:
3 years, 5 months ago
Reviewers:
brettw
CC:
chromium-reviews, darin-cc_chromium.org, jam, sadrul, kalyank
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Shrink chrome_elf.dll by switching source_sets to static_library Investigation of why official chrome_elf.dll builds were 86,016 bytes larger on gn than gyp showed that encryption functions such as aesni_cbc_encrypt were being pulled in. Deleting the implementations of these functions from the .asm file caused no errors which proved that the functions weren't being referenced, they just weren't being discarded. Changing the yasm_assemble template to use static_library fixed that and made the file sizes identical. Comparison of the dia2dump -p output after that change showed there were still two extra symbols in the gn builds: class breakpad::CrashKeysWin * breakpad::CrashKeysWin::keeper_ __aullrem(__aullrem) keeper_ is a global variable - those are harder to discard, even with /Gw - but making its source file part of a static_library fixed it. link /verbose showed that __aullrem is pulled in by an object file that is then discarded but I decided that following that trail wasn't worth it. The file sizes are identical and dumpbin /headers shows that the .text sections virtual size is just 96 bytes larger in the gn case. Additional changes of source set to static_library may address the remaining diffs, but they are not large enough to matter. TL;DR The linker tries to discard unreferenced symbols but it is not perfect at doing it, even with /Gw and /Gy. Assembly functions may be difficult also. Use source_set with care. BUG=624274 Committed: https://crrev.com/0ab90cb1edf8f08f1fa5d2551aa21cac225163cf Cr-Commit-Position: refs/heads/master@{#403480}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M build/linux/unbundle/yasm.gn View 1 chunk +1 line, -1 line 0 comments Download
M components/crash/content/app/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download
M third_party/yasm/yasm_assemble.gni View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (3 generated)
brucedawson
3 years, 5 months ago (2016-06-30 21:40:51 UTC) #2
brettw
lgtm
3 years, 5 months ago (2016-07-01 17:47:45 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2114783002/1
3 years, 5 months ago (2016-07-01 17:51:15 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1)
3 years, 5 months ago (2016-07-01 17:56:17 UTC) #6
commit-bot: I haz the power
CQ bit was unchecked.
3 years, 5 months ago (2016-07-01 17:56:24 UTC) #7
commit-bot: I haz the power
3 years, 5 months ago (2016-07-01 17:57:45 UTC) #9
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/0ab90cb1edf8f08f1fa5d2551aa21cac225163cf
Cr-Commit-Position: refs/heads/master@{#403480}

Powered by Google App Engine
This is Rietveld 408576698