Ever since mold relicensed from AGPL to MIT (as part of mold 2.0 release), the worldwide need for making another fast linker has been greatly reduced, so I wasn't expecting a project like this to appear. And definitely wasn't expecting it to already be 2x faster than mold in some cases. Will keep an eye on this project to see how it evolves, best of luck to the author.
I looked at this before, is it ready for production? I thought not based on the readme, so I'm still using mold.<p>For those on macOS, Apple released a new linker about a year or two ago (which is why the mold author stopped working on their macOS version), and if you're using it with Rust, put this in your config.toml:<p><pre><code> [target.aarch64-apple-darwin]
rustflags = [
"-C",
"link-arg=-fuse-ld=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld",
"-C",
"link-arg=-ld_new",
]</code></pre>
What would be refreshing would be a C/C++ compiler that did away with the intermediate step of linking and built the whole program as a unit. LTO doesn't even have to be a thing if the compiler can see the entire program in the first place. It would still have to save some build products so that incremental builds are possible, but not as object files, the compiler would need metadata to know of the origin and dependencies of all the generated code so it would be able to replace the right things.<p>External libs are most often linked dynamically these days, so they don't need to be built from source, so eliminating the linker doesn't pose a problem for non-open source dependencies. And if that's not enough letting the compiler also consume object files could provide for legacy use cases or edge cases where you must statically link to a binary.
There’s been a lot of interest in faster linkers spurred by the adoption and popularity of rust.<p>Even modest statically linked rust binaries can take a couple of minutes in the link stage of compilation in release mode (using mold). It’s not a rust-specific issue but an amalgam of (usually) strictly static linking, advanced link-time optimizations enabled by llvm like LTO and bolt, and a general dissatisfaction with compile times in the rust community. Rust’s (clinically) strong relationship with(read: dependency on) LLVM makes it the most popular language where LLVM link-time magic has been most heavily universally adopted; you could face these issues with C++ but it wouldn’t be chalked up to the language rather than your toolchain.<p>I’ve been eyeing wild for some time as I’m excited by the promise of an optimizing <i>incremental</i> linker, but to be frank, see zero incentive to even fiddle with it until it can actually, you know, link incrementally.
2008: Gold, a new linker, intended to be faster than Gnu LD<p>2015(?): Lld a drop in replacement linker, at least 2x as fast as Gold<p>2021: mold, a new linker, several times faster than lld<p>2025: wild, a new linker...
Related, and a good one, though old:<p>The book Linkers and Loaders by John Levine.<p>Last book in the list here:<p><a href="https://www.johnlevine.com/books.phtml" rel="nofollow">https://www.johnlevine.com/books.phtml</a><p>I had read it some years ago, and found it quite interesting.<p>It's a standard one in the field.<p>He has also written some other popular computer books (see <i>link</i> above - pun not intended, but noticed).
That looks promising. In Rust to begin with and with the goal of being fast and support incremental linking.<p>To use it with Rust, this can probbaly also work using gcc as linker driver.<p>In project's .cargo/config.toml:<p><pre><code> [target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=wild"]
</code></pre>
Side note, but why does Rust need to plug into gcc or clang for that? Some missing functionality?
I'm curious: what's the theory behind why this would be faster than mold in the non-incremental case? "Because Rust" is a fine explanation for a bunch of things, but doesn't explain expected performance benefits.<p>"Because there's low hanging concurrent fruit that Rust can help us get?" would be interesting but that's not explicitly stated or even implied.
What a coincidence. :) Just an hour ago I compared the performance of wild, mold, and (plain-old) ld on a C project I'm working on. 23 kloc and 172 files. Takes about 23.4 s of user time to compile with gcc+ld, 22.5 s with gcc+mold, and 21.8 s with gcc+wild. Which leads me to believe that link time shouldn't be that much of a problem for well-structured projects.
"These benchmark were run on David Lattimore's laptop (2020 model System76 Lemur pro), which has 4 cores (8 threads) and 42 GB of RAM."<p><a href="https://news.ycombinator.com/item?id=33330499">https://news.ycombinator.com/item?id=33330499</a><p>NB. This is not to suggest wild is bloated. The issue if any is the software being developed with it and the computers of those who might use such software.
I think the optimal approach for development would be to not produce a traditional linked executable at all, but instead just place the object files in memory, and then produce a loader executable that hooks page faults in those memory areas and on-demand mmaps the relevant object elsewhere, applies relocations to it, and then moves it in place with mremap.<p>Symbols would be resolved based on an index where only updated object files are reindexed. It could also eagerly relocate in the background, in order depending on previous usage data.<p>This would basically make a copyless lazy incremental linker.
> Mold is already very fast, however it doesn't do incremental linking and the author has stated that they don't intend to. Wild doesn't do incremental linking yet, but that is the end-goal. By writing Wild in Rust, it's hoped that the complexity of incremental linking will be achievable.<p>Can someone explain what is so special about Rust for this?