Skip to content

Commit f569872

Browse files
author
Jay Conrod
committed
link: force internal linking in pure mode (#2743)
Fixes #2719
1 parent 03d5660 commit f569872

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

go/private/actions/link.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ def emit_link(
8787
# Using the C linker avoids that. Race and msan always require a
8888
# a C toolchain. See #2614.
8989
tool_args.add("-linkmode", "external")
90+
if go.mode.pure:
91+
# Force internal linking in pure mode. We don't have a C toolchain,
92+
# so external linking is not possible.
93+
tool_args.add("-linkmode", "internal")
9094
if go.mode.static:
9195
extldflags.append("-static")
9296
if go.mode.link != LINKMODE_NORMAL:

0 commit comments

Comments
 (0)