New comment by flyxi121 on void-packages repository https://github.com/void-linux/void-packages/pull/32555#issuecomment-988145528 Comment: There are currently two ways that we could bundle the rust toolchain for musl: 1. We can either choose the way alpine does it and link the rust toolchain dynamically against musl. They do it by creating custom rust build targets and some other patches. Without these patches cargo assumes the default musl build target which expects to be statically linked against musl. This leads to cargo not being able to build executables for its own target. Example: For `cargo install cargo` to work, `RUSTFLAGS="-C target-feature=-crt-static"` has to be set explicitly to build a functioning executable. I am not 100% sure that it works like that (maybe some of you more experienced rusticeans might be able to lend a hand :D) but I know for a fact, that without patching, a dynamically linked rust toolchain against musl does not work. 2. A probably much easier way of doing things would be just to go with the default, link everything statically against musl but I have not looked into this yet... Edit: I should mention that with option 2 the rust toolchain would also have to be linked statically against llvm as far as I am aware, which is the reason why alpine choses to go with dynamically linking both (please correct me if I am wrong)