You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doc="The label to an explicit linker to use (e.g. `rust-lld`, `ld`, `link-ld.exe`, etc...)",
724
-
# `target` cfg is used so a linker can be chose based on the target
725
-
# platform. Linker binaries are still required to be runnable in the
726
-
# `exec` configuration.
727
-
cfg="target",
723
+
doc="The label to an explicit linker to use (e.g. rust-lld, ld, link-ld.exe, etc.). Linker binaries must be runnable in the exec configuration, so cfg = \"exec\" is used. To choose a linker based on the target platform, use a select() when providing this attribute. The select() will be evaluated against the target platform before the exec transition is applied, allowing platform-specific linker selection while ensuring the selected linker is built for the exec platform.",
724
+
cfg="exec",
728
725
allow_single_file=True,
729
726
),
730
727
"linker_preference": attr.string(
@@ -935,5 +932,22 @@ it to the `"--extra_toolchains"` flag for Bazel, and it will be used.
935
932
936
933
See `@rules_rust//rust:repositories.bzl` for examples of defining the `@rust_cpuX` repository \
937
934
with the actual binaries and libraries.
935
+
936
+
To use a platform-specific linker, you can use a `select()` in the `linker` attribute:
0 commit comments