Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unix_cc_configure: detect AR instead of hardcoding it to /usr/bin/libtool #123

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cc/private/toolchain/cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ cc_autoconf = repository_rule(
environ = [
"ABI_LIBC_VERSION",
"ABI_VERSION",
"AR",
"BAZEL_COMPILER",
"BAZEL_HOST_SYSTEM",
"BAZEL_CXXOPTS",
Expand Down
5 changes: 4 additions & 1 deletion cc/private/toolchain/unix_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
darwin = cpu_value == "darwin"

cc = _find_generic(repository_ctx, "gcc", "CC", overriden_tools)
ar_tool = "libtool" if darwin else "ar"
ar = _find_generic(repository_ctx, ar_tool, "AR", overriden_tools)
overriden_tools = dict(overriden_tools)
overriden_tools["ar"] = ar
overriden_tools["gcc"] = cc
overriden_tools["gcov"] = _find_generic(
repository_ctx,
Expand All @@ -372,7 +375,7 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
)
if darwin:
overriden_tools["gcc"] = "cc_wrapper.sh"
overriden_tools["ar"] = "/usr/bin/libtool"
auto_configure_warning_maybe(repository_ctx, "AR used: " + str(ar))
auto_configure_warning_maybe(repository_ctx, "CC used: " + str(cc))
tool_paths = _get_tool_paths(repository_ctx, overriden_tools)
cc_toolchain_identifier = escape_string(get_env_var(
Expand Down