Enable link time -Os in opt builds#348
Conversation
|
@cerisier Can you provide an example where you see an effect on binary size from using the flag? I'm using Xcode 16 and it looks to me like it is on-by-default – when I add just Additionally this breaks the build when using lld as the linker (for example when having Homebrew lld installed and using |
|
When using lld you can disable the feature. Per the PR description, passing any |
The PR description is incorrect then – passing |
|
Heads up that I'm seeing some non-hermeticity with this change: #371 |
ldstarting Xcode 15 (ld_prime) now supports this option to perform more general code de-deduplication passes which it was not doing prior.It is not documented anywhere but Xcode 15+ has this enabled by default in the default Release scheme (which has
Optimization Level = Fastest/Smallest -Osby default).I'm adding this as a separate feature so that it can be disabled but there could be an argument whether to enable this by default !
Fun note: passing any character after
-Operforms the same as-Os...