mac: Introduce libaperitif.dylib
Chrome currently has several .app executables packaged within its bundle
and the the Framework. Each one of these executables statically links
libc++, and in the helpers, a //sandbox target.
Apéritif moves the C++ components of early app initialization into a
shared library, reducing the size of each of the executables. The
executable main file transitions back to being a plain C file rather
than C++ to avoid linking in libc++.
In order to support linking the library to multiple images at different
bundle depths, the linker_driver.py gains the ability to run
install_name_tool as part of the link step.
Disk size changes for an x86_64, official, branded, stripped build:
17168 out/official/aperitif/Google Chrome.app/Contents/MacOS/Google Chrome
214512 out/official/pristine/Google Chrome.app/Contents/MacOS/Google Chrome
17240 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (Alerts).app/Contents/MacOS/Google Chrome Helper (Alerts)
17240 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (GPU).app/Contents/MacOS/Google Chrome Helper (GPU)
17240 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (Plugin).app/Contents/MacOS/Google Chrome Helper (Plugin)
17240 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (Renderer).app/Contents/MacOS/Google Chrome Helper (Renderer)
17240 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper.app/Contents/MacOS/Google Chrome Helper
264736 out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (Alerts).app/Contents/MacOS/Google Chrome Helper (Alerts)
264736 out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (GPU).app/Contents/MacOS/Google Chrome Helper (GPU)
264736 out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (Plugin).app/Contents/MacOS/Google Chrome Helper (Plugin)
264736 out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper (Renderer).app/Contents/MacOS/Google Chrome Helper (Renderer)
264736 out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Helpers/Google Chrome Helper.app/Contents/MacOS/Google Chrome Helper
338400 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Libraries/libaperitif.dylib
0 (NA) out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Libraries/libaperitif.dylib
179263608 out/official/aperitif/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/Current/Google Chrome Framework
179263608 out/official/pristine/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/Current/Google Chrome Framework
As reported by `du -k`:
261464 out/official/aperitif/Google Chrome.app
262524 out/official/pristine/Google Chrome.app
As reported by Finder Get Info:
267,309,919 bytes (267.7 MB on disk) out/official/aperitif
268,406,343 bytes (268.8 MB on disk) out/official/pristine
Bug: 1255223
Change-Id: I4e3c0fa542f2f7f1eae5df9b2c71d6840bc4a30e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3430220
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#978773}
NOKEYCHECK=True
GitOrigin-RevId: 31576eb814252c9a0113b46be9fa57d5d92a0d57
2 files changed