Skip to content

Commit

Permalink
Add -dead_strip in default opt link flags for darwin (bazelbuild#17312)
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 bazelbuild#16770.

PiperOrigin-RevId: 501557438
Change-Id: Ia5e1e94305361f10f1b20654d83edb76126b3056

Co-authored-by: Keith Smiley <[email protected]>
  • Loading branch information
ShreeM01 and keith authored Jan 27, 2023
1 parent 17ac479 commit 0f9912b
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 @@ -617,7 +617,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 0f9912b

Please sign in to comment.