-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Larger binaries produced by zig-linux-x86_64-0.14.0-dev.2414+ba37a4369 #22192
Comments
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? |
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. add_library(atomic STATIC "${CMAKE_SOURCE_DIR}/ext/atomic.c")
...
$ file ../ext/atomic.c
../ext/atomic.c: empty 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. |
How interesting 🤔. This seems to be because of the PR you mentioned. |
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 But I don't know what the way forward is with this. It's strange that pulling in empty If you want to inspect the binaries they are here now: https://github.com/libriscv/godot-sandbox-programs/releases/tag/v0.5 |
Can you show the compile and link command lines that CMake generates, both before and after the issue started happening? |
Zig Version
0.14.0-dev.2414+ba37a4369
Steps to Reproduce and Observed Behavior
It looks like a change has made binaries much bigger from one nightly to the next.
$ ls -lah bin total 13M drwxrwxr-x 2 gonzo gonzo 4,0K des. 9 07:36 . drwxrwxr-x 7 gonzo gonzo 4,0K des. 9 07:36 .. -rwxrwxr-x 1 gonzo gonzo 739K des. 9 07:36 asm -rwxrwxr-x 1 gonzo gonzo 1,5M des. 9 07:36 cjit -rwxrwxr-x 1 gonzo gonzo 398K des. 9 07:36 hello_world -rwxrwxr-x 1 gonzo gonzo 929K des. 9 07:36 luajit -rwxrwxr-x 1 gonzo gonzo 1,0M des. 9 07:36 mirjit -rwxrwxr-x 1 gonzo gonzo 8,5M des. 9 07:36 robust_weight_transfer
I haven't changed anything in my build systems, other than updating Zig. Could this be related to #22167 somehow?
The build is
riscv64-linux-musl
with no-march
or-mabi
. PlainRelease
CMake build.Expected Behavior
Same incredibly small build sizes as before.
The text was updated successfully, but these errors were encountered: