zig
zig copied to clipboard
ReleaseSmall is much bigger that ReleaseFast in arm-v7a
Zig Version
0.11.0
Steps to Reproduce and Observed Behavior
I was experimenting with making Android apps in Zig.
Using ReleaseFast, I managed to get a 13Kb APK which is pretty small and same size as C.
So I though about using ReleaseSmall and see how small it could get. To my surprise, the APK got significantly bigger!
Inspecting the APK, I saw that the problem was specifically in the 32-bit arm shared lib.
ReleaseFast:
ReleaseSmall:
I'm pretty sure there should be some small mistake that's skipping optimizations for arm-v7a when ReleaseSmall is chosen
You can find the project here: https://github.com/tuket/bare_apk_zig
In order to build:
zig build apk -Drelease [-Darm] [-Darm64] [-Dx86] [-Dx86_64]
Change the release mode in this line of code (I couldn't figure out how to specify that from the cmd line).
You also need to install the Android SDK, NDK and so on... I think you should be able to reproduce this issue with a simpler project that doesn't require Android stuff..
Expected Behavior
ReleaseSmall should be smaller than ReleaseFast in all platforms