Skip to content

Commit

Permalink
Add -dead_strip in default opt link flags for darwin
Browse files Browse the repository at this point in the history
This is similar to the `--gc-sections` addition here. `-dead_strip` is supported on all versions of ld64 we care about.

Closes #16770.

PiperOrigin-RevId: 501557438
Change-Id: Ia5e1e94305361f10f1b20654d83edb76126b3056
  • Loading branch information
keith authored and copybara-github committed Jan 12, 2023
1 parent 8ec8743 commit 1da8a82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/cpp/unix_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1da8a82

Please sign in to comment.