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

GoLink action. Use -extar <ar path> if cc_toolchain provides ar path #3916

Merged
merged 1 commit into from
Apr 8, 2024
Merged
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
4 changes: 4 additions & 0 deletions go/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def emit_link(
builder_args = go.builder_args(go, "link")
tool_args = go.tool_args(go)

# use ar tool from cc toolchain if cc toolchain provides it
if go.cgo_tools and go.cgo_tools.ar_path and go.cgo_tools.ar_path.endswith("ar"):
tool_args.add_all(["-extar", go.cgo_tools.ar_path])

# Add in any mode specific behaviours
if go.mode.race:
tool_args.add("-race")
Expand Down
1 change: 1 addition & 0 deletions go/private/context.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ def _cgo_context_data_impl(ctx):
ld_static_lib_path = ld_static_lib_path,
ld_dynamic_lib_path = ld_dynamic_lib_path,
ld_dynamic_lib_options = ld_dynamic_lib_options,
ar_path = cc_toolchain.ar_executable,
),
)]

Expand Down