Skip to content

Commit

Permalink
Always use llvm-strip (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky authored Sep 1, 2023
1 parent 7fcfac0 commit 5bbef8c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 1 addition & 7 deletions toolchain/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,6 @@ def cc_toolchain_config(
## NOTE: make variables are missing here; unix_cc_toolchain_config doesn't
## pass these to `create_cc_toolchain_config_info`.

# Tool paths:
# `llvm-strip` was introduced in V7 (https://reviews.llvm.org/D46407):
llvm_version = llvm_version.split(".")
llvm_major_ver = int(llvm_version[0]) if len(llvm_version) else 0
strip_binary = (tools_path_prefix + "llvm-strip") if llvm_major_ver >= 7 else _host_tools.get_and_assert(host_tools_info, "strip")

# TODO: The command line formed on darwin does not work with llvm-ar.
ar_binary = tools_path_prefix + "llvm-ar"
if host_os == "darwin":
Expand All @@ -319,7 +313,7 @@ def cc_toolchain_config(
"nm": tools_path_prefix + "llvm-nm",
"objcopy": tools_path_prefix + "llvm-objcopy",
"objdump": tools_path_prefix + "llvm-objdump",
"strip": strip_binary,
"strip": tools_path_prefix + "llvm-strip",
}

# Start-end group linker support:
Expand Down
2 changes: 0 additions & 2 deletions toolchain/internal/configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ def llvm_register_toolchains():
for (key, tool_path) in [
# This is used for macOS hosts:
("libtool", "/usr/bin/libtool"),
# This is used with old (pre 7) LLVM versions:
("strip", "/usr/bin/strip"),
# This is used when lld doesn't support the target platform (i.e.
# Mach-O for macOS):
("ld", "/usr/bin/ld"),
Expand Down

0 comments on commit 5bbef8c

Please sign in to comment.