Pass -no_exported_symbols by default - #3024
Conversation
Passing `-Wl,-exported_symbols_list,/dev/null` has been generally recommended to reduce app size. Since we have the `exported_symbols_list` attribute, if those are never set, we can do this by default. This does require folks export things that they actually need.
|
One compatibility concern before making I verified this on a reduced Would it make sense to retain only that symbol for app-like executables instead? On the same reduced input this changed four exports to one while leaving I put together an opt-in, product-scoped implementation with analysis tests for default-off behavior, opt-out, apps, extensions, additive custom exports, and framework exclusion: main...karim-alweheshy:rules_apple:codex/restrict-application-exports |
|
yea i think if we want to move forward with this including that symbol by default would be fine |
|
Separately, I prototyped the framework-side counterpart as a reusable A final Mach-O test covers the unrestricted negative control, the retained client-used Swift API, the removed unused Swift API, and the conservative C runtime root. I kept this independent from the application feature for focused review: main...karim-alweheshy:rules_apple:codex/derive-private-framework-exports |
Passing
-Wl,-no_exported_symbolshas been generallyrecommended to reduce app size. Since we have the
exported_symbols_listattribute, if those are never set, we can dothis by default. This does require folks export things that they
actually need.