nativelink
nativelink copied to clipboard
Correctness issues in lre-cc when used as backing toolchain for lre-rs in cross compilation scenarios
It's a known issue that the current implementation of lre-cc doesn't support cross compilation. This was ok for most usecases since it still worked in host == exec scenarios.
Now, upstream nix has marked our practice of using the wrapped clang (customClang) as faulty because the rust context is a cross compilation context but customClang in it's current state is not a cross compiler (https://github.com/NixOS/nixpkgs/pull/323869). That is, the fact that our current implementation works should be treated as "working by chance".
To fix this we need to construct the LRE cc_toolchain properly as a cross compilation toolchain. This will also unlock arbitrary crosscompilation for C++ and Rust.