this seems like a simple issue of missing dependencies in a nix derivation somewhere, but i can't find any mention of the dependancies that are needed.
there is some mention of "the libstdc++ shipped with llvm", but that doesn't make sense to me, since libLLVM doesn't link to libstdc++ according to ldd
LLVM certainly does use libstdc++, but the default Rust configuration will link that statically -- you can decide whether that makes sense for you. There are further C++ wrappers for LLVM on the Rust side, but I think those are supposed to respect the static setting too.
Edit: actually the example config says that the default is [llvm] static-libstdcpp = false -- but if you use download-ci-llvm then it will use static libstdc++. I suspect you're getting a mix that way, static from the download and dynamic from Rust's local C++ bindings.
The best chance for a fix would be to link + repost this topic over at https://discourse.nixos.org/ to find someone experienced with how they set up the derivation, since it would fix the problem for everyone
i am not building rust via a nix derivation. i am building rust via x.py. this worked fine until recently, as rustc did not link to libstdc++ directly, but it does now.
getting libstdc++ from nix is trivial, the hard part is convincing the rust build system to patch rustc to use this library. stage0 automatically gets patched from .nix-deps, but stage1 does not. stage1 expects all its dependancies to be in stage1/lib, but libstdc++ does not get put there.
also:
setting static_libstdcpp is incompatible with download-ci-llvm.
setting static_libstdcpp is incompatible with download-ci-llvm.
Hmm, that's guarded here:
but I wonder if that's missing the effect that it also has on compiler/rustc_llvm bindings. That is, you probably do want to match whatever CI has, but I don't see anything trying to figure that out.