RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=/path/to/mold" cargo build
or persitant in your project:
.cargo/config.toml
[target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-C", "link-arg=-fuse-ld=/PATH/TO/mold"]
or persitant in your project:
.cargo/config.toml
[target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-C", "link-arg=-fuse-ld=/PATH/TO/mold"]
fuse-ld still works though.
So maybe that "--ld-path" option helps resolve ambiguity by expecting an explicit path instead of a linker name.