"We are rewriting the mold linker in Rust and adding linker script support so that mold can link essentially anything GNU ld can, including kernels and embedded programs."
Legitimate question, why not just use GNU ld? Does link time take so long that it requires a complete rewrite?
GNU ld is indeed extremely slow, it is a very old codebase that isn't designed for modern systems, and it doesn't do any real work in parallel. GNU ld can be 2-10x slower than LLVM lld on real projects, and then mold is again ~5-10x faster that lld. The creator of mold is also the original creator of LLVM lld.
Traditionally the link time was a single-threaded step at the end of compilation, and it scaled very poorly. While compilation is embarrassingly parallel and has continued to scale. So link time was becoming a significant bottleneck, especially with incremental compilation. When you want to iterate on a large project, with GNU ld you might have to wait several minutes of link time on every dev build.
"...it doesn't do any real work in parallel." I think this is the biggest selling point.
Although, "with GNU ld you might have to wait several minutes of link time on every dev build." Meh, I might prefer to wait a few minutes and stick with something I know works.
"The creator of mold is also the original creator of LLVM lld" That's cool, why not implement these features in LLVM lld? Why not implement them in GNU ld? Is it a gatekeeping thing? Parallel ld would be very useful.
No, it's not a gatekeeping thing. You're coming at this with negative assumptions, so I don't think I can try to convince you. If you hate Rust and want something conservative, then use lld. It has some parallelism, but it's fairly coarse and still has single-threaded bottlenecks. It would have needed a pretty major re-architecture to modernize it.
As for trying to do that in BFD, patches welcome. Or maybe not welcome, I'm not sure the maintainers are really looking for a major redesign of GNU ld. But either way I'm not volunteering, it's much easier to start fresh than try to carve out and replace the entire guts of this old thing.
"You're coming at this with negative assumptions" not so much negative as skeptical. Everyone is pushing Rust and full rewrites, I'm still not convinced.
"But either way I'm not volunteering, it's much easier to start fresh than try to carve out and replace the entire guts of this old thing."
Comments
"We are rewriting the mold linker in Rust and adding linker script support so that mold can link essentially anything GNU ld can, including kernels and embedded programs."
Legitimate question, why not just use GNU ld? Does link time take so long that it requires a complete rewrite?
GNU ld is indeed extremely slow, it is a very old codebase that isn't designed for modern systems, and it doesn't do any real work in parallel. GNU ld can be 2-10x slower than LLVM lld on real projects, and then mold is again ~5-10x faster that lld. The creator of mold is also the original creator of LLVM lld.
Traditionally the link time was a single-threaded step at the end of compilation, and it scaled very poorly. While compilation is embarrassingly parallel and has continued to scale. So link time was becoming a significant bottleneck, especially with incremental compilation. When you want to iterate on a large project, with GNU ld you might have to wait several minutes of link time on every dev build.
"...it doesn't do any real work in parallel." I think this is the biggest selling point.
Although, "with GNU ld you might have to wait several minutes of link time on every dev build." Meh, I might prefer to wait a few minutes and stick with something I know works.
"The creator of mold is also the original creator of LLVM lld" That's cool, why not implement these features in LLVM lld? Why not implement them in GNU ld? Is it a gatekeeping thing? Parallel ld would be very useful.
Also, why Rust?
No, it's not a gatekeeping thing. You're coming at this with negative assumptions, so I don't think I can try to convince you. If you hate Rust and want something conservative, then use lld. It has some parallelism, but it's fairly coarse and still has single-threaded bottlenecks. It would have needed a pretty major re-architecture to modernize it.
As for trying to do that in BFD, patches welcome. Or maybe not welcome, I'm not sure the maintainers are really looking for a major redesign of GNU ld. But either way I'm not volunteering, it's much easier to start fresh than try to carve out and replace the entire guts of this old thing.
"You're coming at this with negative assumptions" not so much negative as skeptical. Everyone is pushing Rust and full rewrites, I'm still not convinced.
"But either way I'm not volunteering, it's much easier to start fresh than try to carve out and replace the entire guts of this old thing."
Fair enough :D