The Mold high performance linker that typically outperforms the likes of LLVM lld, GNU LD, Wild, and others is being rewritten in the Rust programming language and also has an ambitious goal of being adopted as the default linker on Linux systems. Mold 2.42.1 was released today as a new patch release for this open-source linker. But most interesting in the Mold 2.42.1 announcement are the plans for Mold 3.0 to succeed it. Mold has been going through a rewrite from C++ to Rust. Now that the Rust language has matured enough over the years, Mold is planning to leverage it for its strong safety guarantees and other options that make it attractive to lead developer Rui Ueyama. This follows the Wild linker as another performance-oriented linker already written in the Rust programming language. Rui aims for Mold 3.0 in Rust to work just as well as Mold 2.xx has done for high speed linking. Beyond that, Rui is hoping to see Mold become the default linker on Linux systems: "Over the past 20 years, several fast linkers, including gold, lld, and mold, have been developed. Yet the system linker, /usr/bin/ld, on most Linux distributions is still GNU ld. As a result, link jobs that mold can finish in a few hundred milliseconds may still take several seconds, tens of seconds, or even minutes with the default linker. I think this is an unfortunate situation for the Linux community. As the original author of both lld and mold, I think I bear some responsibility for this situation. I have spent a great deal of effort making linkers faster, but not enough effort on the compatibility work needed to make a fast linker suitable as a drop-in replacement for the system linker. With mold 3.0, we intend to change that. One of the main goals of the mold 3.x series is to make mold suitable for adoption as /usr/bin/ld by Linux distributions. To achieve that, we first need to implement the missing linker script features so that mold can link not only user-space programs but also kernels and firmware. We will then conduct extensive compatibility testing and work closely with Linux distribution developers to make it practical for them to adopt mold as /usr/bin/ld. Making this happen is one of our highest priorities for mold 3.x." Mold is also looking at finally supporting incremental linking too as a feature that hasn't been supported by the linker up to this point: "That said, if we can find a simple way to add incremental linking to mold, we would be happy to do so. It could still improve some workloads significantly. We are currently exploring designs that can provide those benefits while preserving mold's simplicity and reliability." Those interested in more details on this significant shift for the Mold linker project can be found within the Mold 2.42.1 announcement.
Mold High Speed Linker Being Rewritten In Rust, Hopes To Be The Default Linker On Linux
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.