bazelbuild / bazelbuild/rules_rust

Using rules_rust toolchain lld for linking Rust + C++ (cross-language LTO with older clang bitcode than Rust)?

Open
#3,709 3 comments 0 reactions 0 assignees View on GitHub
expert-needed help wanted
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Hi folks,

I'm trying to do Rust-C++ interop with cross-language ThinLTO - in our environment, clang is only at 18 but Rust is all the way current at 1.90.0. The only way I have found that I can link these things is by using clang++ as the linker front-end, but with `-fuse-ld=` but I am running into difficulty programmatically getting a label of the path to this binary so that it can be passed to the CC toolchain.

Has anyone been able to do this? It does seem to work as long as the linker is newer than all the bitcode in the objects, but I'm just kinda stuck on the bazel toolchain part, of finding a query or location or something that can be evaluated early enough in the repo/toolchain steps.

Thanks!

Simon.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.