Is there anyone using https://github.com/rui314/mold as linker.
I want to use it on riscv64.
But I don't how to configure it.
linking is real slow.
My config file is clearly not ok.
[target.riscv64gc-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/home/yuyang/projects/mold/build/mold -m elf64-littleriscv"]
runner = "qemu-riscv64-static -L /usr/riscv64-linux-gnu -E RUST_LOG=trace -E CRANELIFT_TEST_BLESS=1 -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib -E WASMTIME_TEST_NO_HOG_MEMORY=1"
https://github.com/rui314/mold/issues/968
wasmtime is a quit large project,If we can use mold
will save us a lot of time. right???
I'm not sure how to use mold myself with rustc, but the Rust zulip might have more information on that.
One way to make linking faster though would be to disable debuginfo as Rust often accumulates quite a lot of it and moving it all around can take quite some time. You can do that with CARGO_PROFILE_DEV_DEBUG=0
as an environment variable I believe
Another option, if it works, is to use lld through -Zgcc-ld=lld
as a flag to the rust compiler
Your config file looks like it follows the instructions for Rust at https://github.com/rui314/mold#how-to-use except that the spaces in the use-ld linker flag probably are not good. You might try putting /home/yuyang/projects/mold/build/mold -m elf64-littleriscv
into a shell script and using the path to that shell script as the argument to -fuse-ld
. But also it looks like you're getting good suggestions in the issue that you filed.
Ok,thanks.
Last updated: Nov 22 2024 at 16:03 UTC