You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Larger binaries produced by zig-linux-x86_64-0.14.0-dev.2414+ba37a4369 #22192
Right, but I don't think that PR broke anything anymore. I just think I discovered a way to reduce the sizes. The programs all seem to be working fine. Applying -flto I could reduce them even further. It's really quite something.
But I don't know what the way forward is with this. It's strange that pulling in empty atomic reduced a single program from 8.5MB down to 1.4MB. I can reproduce this without a toolchain file both locally and in CI. All I need is an empty atomic.c.
Activity
Rexicon226 commentedon Dec 9, 2024
There are no steps to reproduce your bug report, just the observed behaviour. What's the easiest way you've found to reproduce this size increase?
fwsGonzo commentedon Dec 9, 2024
After some testing I can indeed reduce it down to something very concrete. Just a stroke of luck, really:
The empty atomic library in the CMake build was all that was needed. I have the small binaries again. A bit confused why this works.
There are still a lot of atomic operations in the binaries:
The sizes are small again with this change and the new Zig nightly, just like shown in the initial post.
Not sure what to make of this. 🤷♂️
Rexicon226 commentedon Dec 9, 2024
How interesting 🤔. This seems to be because of the PR you mentioned.
cc @alexrp
fwsGonzo commentedon Dec 9, 2024
Right, but I don't think that PR broke anything anymore. I just think I discovered a way to reduce the sizes. The programs all seem to be working fine. Applying
-fltoI could reduce them even further. It's really quite something.But I don't know what the way forward is with this. It's strange that pulling in empty
atomicreduced a single program from 8.5MB down to 1.4MB. I can reproduce this without a toolchain file both locally and in CI. All I need is an emptyatomic.c.If you want to inspect the binaries they are here now: https://github.com/libriscv/godot-sandbox-programs/releases/tag/v0.5
alexrp commentedon Dec 9, 2024
Can you show the compile and link command lines that CMake generates, both before and after the issue started happening?