New issue
Advanced search Search tips

Issue 857060 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Drop split_static_library when link.exe is no longer used

Project Member Reported by brat...@opera.com, Jun 27 2018

Issue description

I think split_static_library was mostly needed because of 2 GB limitations in the Visual Studio tool chain, and specifically in link.exe. Now when link.exe is no longer used, maybe it would be an opportunity to clean up a little bit.
 
Components: Build
I have a patch to do this in https://chromium-review.googlesource.com/c/chromium/src/+/1125077 but I'm still not sure it's risk free.

Cc: brucedaw...@chromium.org
brucedawson, do you know if split_static_library is still needed or valuable in any way?
You are correct that split_static_library is not needed with lld because lld seems to use thin archives and therefore its .lib files are orders of magnitude smaller than those created by link.exe. This shrinks the .lib files in one configuration from 3.8 GB to 0.16 GB, total output dir size goes from ~13.5 GB to ~9.7 GB (release non-component x86).

That said, I think we should leave in support for split_static_library. It costs us very little and it gives us the option to link with VS. I made use of that option just a few days ago in order to investigate a bug in lld.

Since split static libraries are unneeded with lld then a first step would be to modify the split_static_library template to just use a regular library when lld is enabled. That would clean up the output directories slightly and would avoid unnecessary things like splitting ui.lib into five parts when the total size is less than 7 MB:

07/11/2018  04:50 PM         1,113,118 ui_0.lib
07/11/2018  04:50 PM         2,483,550 ui_1.lib
07/11/2018  04:50 PM         1,294,468 ui_2.lib
07/11/2018  04:50 PM           922,138 ui_3.lib
07/11/2018  04:50 PM           948,534 ui_4.lib
               5 File(s)      6,761,808 bytes

Fully removing split_static_library support should wait until lld has had time to bake for a few releases, or maybe never - taking away the ability to use link.exe will prevent certain types of testing and I'm not sure the benefits are great enough.

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2205cecb8d4db8f64767d4d0ec2c58c489f3ccad

commit 2205cecb8d4db8f64767d4d0ec2c58c489f3ccad
Author: Daniel Bratell <bratell@opera.com>
Date: Wed Jul 18 15:27:42 2018

Don't use split_static_library when lld is used

split_static_library is mainly a fix to avoid hitting internal
size limits in the Windows toolchain and it's not needed when
using lld because its thin archives are orders of magnitude smaller.

Bug: 857060
Change-Id: Idf101fc57d5fed8ee8644715fdebb879f7974da6
Reviewed-on: https://chromium-review.googlesource.com/1138330
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576067}
[modify] https://crrev.com/2205cecb8d4db8f64767d4d0ec2c58c489f3ccad/build/split_static_library.gni

Sign in to add a comment