-
Notifications
You must be signed in to change notification settings - Fork 319
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
Fix bloated liblimbo_sqlite3.a
binary size
#714
Comments
This reduces `liblimbo_sqlite3.a` size from 37M to 20M. Refs #714
..to reduce `liblimbo_sqlite3.a` size from 37M to 20M. As it turns out, LLVM emits its bitcode into static libraries when LTO is enabled to be "more aggressive" in optimizations Refs #714
..to reduce `liblimbo_sqlite3.a` size from 37M to 20M. As it turns out, LLVM emits its bitcode into static libraries when LTO is enabled to be "more aggressive" in optimizations Refs #714
..to reduce `liblimbo_sqlite3.a` size from 37M to 20M. As it turns out, LLVM emits its bitcode into static libraries when LTO is enabled to be "more aggressive" in optimizations Refs #714
@penberg what linker are you using? I'm using the default gcc linker and I'm getting larger sizes on the main
Previously I was using |
There kind of is, since the archive has to bundle all of the dependencies, at least: List of object files in the archive
My best try so far is running: RUSTFLAGS="-Clinker=clang -Clinker-plugin-lto=true -Clink-arg=-Wl,--no-rosegment -Clink-arg=-Wl,-z,pack-relative-relocs -Clink-arg=-Wl,-O1 -Copt-level=3 -Csplit-debuginfo=packed"
cargo build --lib --profile=dist With the dist profile set to lto="fat". This allows us to do If I run This gets liblimbo_sqlite3.a in Linux to 51MB and The only way I have found to go lower size is with nightly and build-std:
RUSTFLAGS="-Zlocation-detail=none -Clink-arg=-Wl,--no-rosegment -Clink-arg=-Wl,-z,pack-relative-relocs -Clink-arg=-Wl,-O1 -Copt-level=3 -Csplit-debuginfo=packed --print=native-static-libs -Clinker-plugin-lto=true"
cargo +nightly build -Z build-std=std,panic_abort --lib --profile=dist Which gets liblimbo_sqlite3.a down to 40MB and |
There's no reason for
liblimbo_sqlite3.a
to be this big:What's odd is that the shell image size makes much more sense and it packs the same functionality...
Furthermore, the dynamic library is also fine:
The text was updated successfully, but these errors were encountered: