GitHub - rui314/mold: Mold: A Modern Linker 🦠
github.com
external-link
Mold: A Modern Linker 🦠. Contribute to rui314/mold development by creating an account on GitHub.
@verstra@programming.dev
link
fedilink
English
3
edit-2
1Y

Cool. Any idea how would i use this with rustc?

From their repo (https://github.com/rui314/mold#how-to-use)

Create .cargo/config.toml in your project directory with the following:

[target.x86_64-unknown-linux-gnu] linker = “clang” rustflags = [“-C”, “link-arg=-fuse-ld=/path/to/mold”] where /path/to/mold is an absolute path to the mold executable. In the example above, we use clang as a linker driver since it always accepts the -fuse-ld option. If your GCC is recent enough to recognize the option, you may be able to remove the linker = “clang” line.

[target.x86_64-unknown-linux-gnu] rustflags = [“-C”, “link-arg=-fuse-ld=/path/to/mold”] If you want to use mold for all projects, add the above snippet to ~/.cargo/config.toml

I read the design notes and found them pretty interesting even though I haven’t really been pining for a faster linker: https://github.com/rui314/mold/blob/main/docs/design.md

Jamie
link
fedilink
English
31Y

I remember reading about Mold years ago and being impressed, even though most of my programs that I compile don’t really benefit in any way. I appreciate that it kept going.

@fubo@lemmy.world
link
fedilink
English
51Y

Parallelize all the things! 🧹

@rmam@programming.dev
link
fedilink
English
31Y

The performance gains are impressive in relative terms, but I don’t think I would ever switch the default linker if the potential gains are like shaving off 5 seconds when linking a 3GB bundle of binaries.

@ugo@feddit.it
link
fedilink
English
31Y

At work we use lld as opposed ld. With ld, the project I work on links in 60-something seconds, with lld it links in less than 6.

Mold is faster than lld. It is absolutely worth it

Create a post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



  • 1 user online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1 user / 6 months
  • 1 subscriber
  • 1.21K Posts
  • 17.8K Comments
  • Modlog