Add -dead_strip in default opt link flags for darwin
This is similar to the `--gc-sections` addition here. `-dead_strip` is supported on all versions of ld64 we care about.
Closes
@@ -633,7 +633,7 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
],
),
"%{opt_link_flags}": get_starlark_list(
- [] if darwin else _add_linker_option_if_supported(
+ ["-Wl,-dead_strip"] if darwin else _add_linker_option_if_supported(
repository_ctx,
cc,
"-Wl,--gc-sections",
