Skip to content

Commit

Permalink
link: force internal linking in pure mode (#2743)
Browse files Browse the repository at this point in the history
Fixes #2719
  • Loading branch information
Jay Conrod committed Dec 2, 2020
1 parent 0f82e40 commit bd1f492
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def emit_link(
# Using the C linker avoids that. Race and msan always require a
# a C toolchain. See #2614.
tool_args.add("-linkmode", "external")
if go.mode.pure:
# Force internal linking in pure mode. We don't have a C toolchain,
# so external linking is not possible.
tool_args.add("-linkmode", "internal")
if go.mode.static:
extldflags.append("-static")
if go.mode.link != LINKMODE_NORMAL:
Expand Down

0 comments on commit bd1f492

Please sign in to comment.