Repository: rust
Issue: Rust does not build with `llvm-unwind`
Labels: T-bootstrap,O-NixOS

Related issue: https://github.com/NixOS/nixpkgs/issues/311930

Related PR: https://github.com/NixOS/nixpkgs/pull/320432

In Nixpkgs, rust is often used for things like mesa. We're looking to allow for building systems under LLVM and this is a blocker for mesa. Our problem is the `llvm-libunwind` option does not seem to work. We continue to get errors with linking with `libgcc_s`. We're building with these flags (outputted from a nix eval with JSON):
```json
[
  "--sysconfdir=/1rz4g4znpzjwh1xymhjpm42vipw92pr73vdgl6xs1hycac8kf2n9/etc",
  "--release-channel=stable",
  "--set=build.rustc=/nix/store/rbsfq954vg4xxr5wz958ygpdi313wms2-aarch64-unknown-linux-gnu-rustc-wrapper-1.78.0/bin/rustc",
  "--set=build.cargo=/nix/store/kd2rzgd1yaqf0cgl61mqj54nqzg01chi-aarch64-unknown-linux-gnu-cargo-1.78.0/bin/cargo",
  "--tools=rustc,rustdoc,rust-analyzer-proc-macro-srv",
  "--enable-rpath",
  "--enable-vendor",
  "--build=aarch64-unknown-linux-gnu",
  "--host=aarch64-unknown-linux-gnu",
  "--target=aarch64-unknown-linux-gnu,wasm32-unknown-unknown,aarch64-unknown-linux-gnu",
  "--set=target.aarch64-unknown-linux-gnu.cc=/nix/store/a11996pij79myrp43myn4zycdlzh9jsw-gcc-wrapper-13.3.0/bin/cc",
  "--set=target.aarch64-unknown-linux-gnu.cc=/nix/store/pjq4j90az01m6hgf7fd3jiilnp7f0cb6-aarch64-unknown-linux-gnu-clang-wrapper-17.0.6/bin/aarch64-unknown-linux-gnu-clang",
  "--set=target.aarch64-unknown-linux-gnu.cc=/nix/store/pjq4j90az01m6hgf7fd3jiilnp7f0cb6-aarch64-unknown-linux-gnu-clang-wrapper-17.0.6/bin/aarch64-unknown-linux-gnu-clang",
  "--set=target.aarch64-unknown-linux-gnu.linker=/nix/store/a11996pij79myrp43myn4zycdlzh9jsw-gcc-wrapper-13.3.0/bin/cc",
  "--set=target.aarch64-unknown-linux-gnu.linker=/nix/store/pjq4j90az01m6hgf7fd3jiilnp7f0cb6-aarch64-unknown-linux-gnu-clang-wrapper-17.0.6/bin/aarch64-unknown-linux-gnu-clang",
  "--set=target.aarch64-unknown-linux-gnu.linker=/nix/store/pjq4j90az01m6hgf7fd3jiilnp7f0cb6-aarch64-unknown-linux-gnu-clang-wrapper-17.0.6/bin/aarch64-unknown-linux-gnu-clang",
  "--set=target.aarch64-unknown-linux-gnu.cxx=/nix/store/a11996pij79myrp43myn4zycdlzh9jsw-gcc-wrapper-13.3.0/bin/c++",
  "--set=target.aarch64-unknown-linux-gnu.cxx=/nix/store/pjq4j90az01m6hgf7fd3jiilnp7f0cb6-aarch64-unknown-linux-gnu-clang-wrapper-17.0.6/bin/aarch64-unknown-linux-gnu-clang++",
  "--set=target.aarch64-unknown-linux-gnu.cxx=/nix/store/pjq4j90az01m6hgf7fd3jiilnp7f0cb6-aarch64-unknown-linux-gnu-clang-wrapper-17.0.6/bin/aarch64-unknown-linux-gnu-clang++",
  "--set=target.aarch64-unknown-linux-gnu.crt-static=false",
  "--set=target.aarch64-unknown-linux-gnu.crt-static=false",
  "--set=target.aarch64-unknown-linux-gnu.crt-static=false",
  "--enable-llvm-link-shared",
  "--set=target.aarch64-unknown-linux-gnu.llvm-config=/nix/store/bzgbd6wr5x73nx41y4gilvvppmxjknjc-llvm-18.1.7-dev/bin/llvm-config",
  "--set=target.aarch64-unknown-linux-gnu.llvm-config=/nix/store/xxlgyd2nj8dr32jhkriixzjy1pag1j84-llvm-18.1.7-dev/bin/llvm-config",
  "--set=target.aarch64-unknown-linux-gnu.llvm-config=/nix/store/xxlgyd2nj8dr32jhkriixzjy1pag1j84-llvm-18.1.7-dev/bin/llvm-config",
  "--enable-profiler",
  "--llvm-libunwind=system"
]
```