Skip to content

Commit 1da8a82

Browse files
keithcopybara-github
authored andcommitted
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 bazelbuild#16770. PiperOrigin-RevId: 501557438 Change-Id: Ia5e1e94305361f10f1b20654d83edb76126b3056
1 parent 8ec8743 commit 1da8a82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/cpp/unix_cc_configure.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
633633
],
634634
),
635635
"%{opt_link_flags}": get_starlark_list(
636-
[] if darwin else _add_linker_option_if_supported(
636+
["-Wl,-dead_strip"] if darwin else _add_linker_option_if_supported(
637637
repository_ctx,
638638
cc,
639639
"-Wl,--gc-sections",

0 commit comments

Comments
 (0)