Skip to content
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

Disable LTO; disable debug symbols in container build #728

Merged
merged 2 commits into from
Jan 5, 2022
Merged

Disable LTO; disable debug symbols in container build #728

merged 2 commits into from
Jan 5, 2022

Conversation

bgilbert
Copy link
Contributor

LTO saves us 1.5 MB (11%) in the release binary with debug symbols disabled. On the other hand it's been an enormous pain. The RHCOS package disables LTO because of problems on s390x. Quay and the Fedora armv7hl builders apparently OOM building 0.12.0 with LTO. And it's not a default option in the first place. Get rid of it.

Meanwhile, our binary size in the container is now 125 MB. Disable debug symbols there to bring it down to 13 MB. Symbols can make it easier to debug problems in production, but our bug reports don't generally take advantage of that, and the space requirement is excessive.

LTO saves us 1.5 MB (11%) in the release binary with debug symbols
disabled.  On the other hand it's been an enormous pain.  The RHCOS
package disables LTO because of problems on s390x.  Quay and the Fedora
armv7hl builders apparently OOM building 0.12.0 with LTO.  And it's not a
default option in the first place.  Get rid of it.
@dustymabe
Copy link
Member

dustymabe commented Dec 18, 2021

Meanwhile, our binary size in the container is now 125 MB. Disable debug symbols there to bring it down to 13 MB.

Wow - does that mean 112MB space savings in FCOS?

Dockerfile Outdated Show resolved Hide resolved
@dustymabe
Copy link
Member

Wow - does that mean 112MB space savings in FCOS?

I guess that depends on what our flags are in the RPM spec file there.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Debug symbols can make it easier to debug problems in production, but our
bug reports don't generally take advantage of that, and the symbols
increase the binary size from 13 MB to 125 MB.
@bgilbert
Copy link
Contributor Author

Wow - does that mean 112MB space savings in FCOS?

Nope, in RPM-land we split those symbols out to debuginfo. The container build does not.

@bgilbert bgilbert merged commit e905a6b into coreos:main Jan 5, 2022
@bgilbert bgilbert deleted the lto branch January 5, 2022 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants