this post was submitted on 26 Jul 2023
45 points (95.9% liked)

Programming

18364 readers
50 users here now

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 [email protected]



founded 2 years ago
MODERATORS
top 7 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 7 points 2 years ago

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

[โ€“] [email protected] 5 points 2 years ago

Parallelize all the things! ๐Ÿงน

[โ€“] [email protected] 3 points 2 years ago* (last edited 2 years ago) (1 children)

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

[โ€“] [email protected] 1 points 2 years ago

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

[โ€“] [email protected] 3 points 2 years ago

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.