Enable linker string tail merging |
||||||
Issue descriptionWe should set the linker opt level to -O2 so that we can use string tail merging in gold and lld. This reduced the size of libmonochrome.so by 150KB. String tail merging is currently not a feature of link.exe, but we've also been thinking about how to implement this feature in the COFF version of lld.
,
Feb 7 2018
,
Feb 8 2018
,
Feb 8 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c9ee8b32a9740805d519c57cef154c9d30b7db98 commit c9ee8b32a9740805d519c57cef154c9d30b7db98 Author: Peter Collingbourne <pcc@chromium.org> Date: Thu Feb 08 02:28:38 2018 build: Increase linker optimization level to -O2. This enables string tail merge optimization in gold and lld. It decreased the size of an official build of libmonochrome.so by 150KB. Bug: 810154 Change-Id: I69a6446a2dfccbe0b438477661087524bf1018e9 Reviewed-on: https://chromium-review.googlesource.com/907635 Reviewed-by: agrieve <agrieve@chromium.org> Commit-Queue: Peter Collingbourne <pcc@chromium.org> Cr-Commit-Position: refs/heads/master@{#535268} [modify] https://crrev.com/c9ee8b32a9740805d519c57cef154c9d30b7db98/build/config/compiler/BUILD.gn
,
Mar 2 2018
I've attached a prototype patch that implements string tail merging in COFF lld. Here's the effect on binary size in an official build: Without tail merging: 02/28/2018 07:32 PM 75,499,008 chrome_child0.dll 03/02/2018 03:40 PM 52,397,568 chrome0.dll With tail merging: 02/28/2018 07:33 PM 75,318,784 chrome_child1.dll 03/02/2018 03:41 PM 52,308,480 chrome1.dll So that's about 270KB saved overall.
,
Mar 14 2018
Could you send this patch for review?
,
Mar 14 2018
It's still a little prototypish, so I haven't sent it for review yet. I'll try to do that soon.
,
Mar 15 2018
,
Mar 15 2018
,
Mar 15 2018
,
Apr 3 2018
Removing Android label since this is now done on Android
,
Apr 3 2018
It's also done on Linux.
,
Jun 1 2018
As https://chromium-review.googlesource.com/c/chromium/src/+/907635 there is nothing to do on Windows but is macOS/iOS OK? If so this can be closed I guess.
,
Jun 1 2018
We had to disable string tail merging on Windows because it regressed compressed binary size (see https://bugs.chromium.org/p/chromium/issues/detail?id=838449#c24). I'd still like to re-enable it on Windows by figuring out a way to avoid the regression. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by p...@chromium.org
, Feb 7 2018