Skip to content

Use Go attributes for static linking - #15463

Open
tamird wants to merge 1 commit into
google:masterfrom
tamird:go-static-attributes
Open

tamird wants to merge 1 commit into
google:masterfrom
tamird:go-static-attributes

Conversation

@tamird

@tamird tamird commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Use the Go rules' static attribute for tools and benchmark tests that
requested fully_static_link. rules_go discards the C toolchain's -static
flag 1 and adds it back only when its own static mode is enabled 2.
The feature alone could therefore leave race builds dynamically linked,
exposing them to the host's libc requirements despite requesting static
binaries.

Assisted-by: Codex

Use the Go rules' static attribute for tools and benchmark tests that
requested fully_static_link. rules_go discards the C toolchain's -static
flag [1] and adds it back only when its own static mode is enabled [2].
The feature alone could therefore leave race builds dynamically linked,
exposing them to the host's libc requirements despite requesting static
binaries.

[1]: https://github.com/bazel-contrib/rules_go/blob/9792f1c07/go/private/actions/link.bzl#L59
[2]: https://github.com/bazel-contrib/rules_go/blob/9792f1c07/go/private/actions/link.bzl#L103-L104

Assisted-by: Codex
@github-actions
github-actions Bot requested review from trantoji and zkoopmans October 7, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant