-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executable grew by 30mb after libdeno merge #3599
Comments
If we look at the largest symbols comparing v0.28.1 and the master branch
we see that master has some extra very large symbols:
Here |
Also worth noting that this issue is only on linux. |
Some notes from the investigation so far:
|
Over 24 hours of trial and error later, it looks like the following combination of flags reduces the size back to what it was, and the debug info that now remains in the release binary is actually more useful than it was. Note that this final attempt tried 3 flags and had cross-language LTO enabled. diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
index 2354f1b..eff3d52 100644
--- a/config/compiler/BUILD.gn
+++ b/config/compiler/BUILD.gn
@@ -588,7 +588,7 @@ config("compiler") {
cflags += [ "-flto=thin" ]
if (target_os != "chromeos") {
- cflags += [ "-fsplit-lto-unit" ]
+ cflags += [ "-fno-split-lto-unit" ]
}
if (thin_lto_enable_optimizations) {
@@ -2416,7 +2416,12 @@ config("minimal_symbols") {
# flag, so we can use use -g1 for pnacl and nacl-clang compiles.
# gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
if (!is_nacl || is_clang) {
- cflags += [ "-g1" ]
+ cflags += [
+ "-g1",
+ "-gno-inline-line-tables",
+ "-fno-force-dwarf-frame",
+ "-fdebug-types-section",
+ ]
}
ldflags = []
if (is_android && is_clang) {
|
v0.22.0:
v0.28.1:
|
This reduces the size of the Linux binary to 54MB. That's not quite as low as it can go, but to squeeze out those last megabytes we'd have to make some drastic changes (use a different linker), which is not worth the time and effort. Closes: #3599
Not sure why but there has been no fundamental change in our asset management - so this should be solvable.
The text was updated successfully, but these errors were encountered: