Mold 1.0: the first stable and production-ready release of the high-speed linker
github.com
github.com
That makes them the author of both of the two fastest linkers in existence, AFAIK. This person has a very impressive resume.
https://github.com/rui314/mold/blob/main/docs/design.md
> "Concretely speaking, I want to use the linker to link a Chromium executable (~1.8 GiB in size) just in 1 second. LLVM's lld, the fastest open-source linker which I originally created a few years ago, takes about 12 seconds to link Chromium on my machine. So the goal is 12x performance bump over lld. Compared to GNU gold, it's more than 50x."
There is good discussion as well in this prior post, and Reddit thread with the author in it a while back:https://news.ycombinator.com/item?id=26233244
https://www.reddit.com/r/cpp/comments/kxvw5c/mold_a_modern_l...
or persitant in your project:
.cargo/config.toml
[target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-C", "link-arg=-fuse-ld=/PATH/TO/mold"]
fuse-ld still works though.
So maybe that "--ld-path" option helps resolve ambiguity by expecting an explicit path instead of a linker name.
The flags are part of the cache hash, so your IDE and cli constantly invalidate the cache and compile from scratch.
But enough about writing “hello, world“ programs in Rust.
I kid.
I'm glad he's doing this as (A)GPL. It's great work and it's Free for the people. If you want the option for it to be private, feel free to step up and do the right thing.
The "A" of the AGPL expands the distribution rules of the GPL to include network access but doesn't really expand the virality or combined-works parts. It "infects" your program just as much as any GPL program would.
In fact for many years this was the only value I saw in AGPL: to provide a best possible starting point for an upsell while claiming it was all about Free Software.
It's the least restrictive for user freedom.
MIT, Apache, and BSD have none of those restrictions on users. How is APL the "least restrictive"?
This is the part where the (A)GPL constrains the rights of its users. Requiring user A to give user B more liberal licensing is constraining the rights of A for the benefit of B. Even if you think it's the "right" way, it's still a constraint.
Given the comments in the repo README about it being a drop in replacement for the GNU linker, it looks like could be useful for several other scenarios too (but I defer to those who can explain this more clearly/correctly than I!)
[0] https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573833.h...
"Note, all these extra linkers (lld, mold) will not really work properly, gcc during configuration detects various assembler and linker properties on which it then relies on and I'm sure neither lld nor mold supports those features."
All of my experience was with using clang as the driver, so I can't speak to why gcc has trouble making a similar feature work like expected.
Rui, regarding -- "a sponsor who wants to purchase the copyright of this work and relicense it under a more liberal license such as the MIT license." Would you accept sponsorship for someone who wants to relicense under LLVM(apache)? And do you have a ballpark asking price?
LTO is not necessary for development builds, or builds where the speed of the write-compile-test loop matter. This is exactly the use case that mold was designed for and it is designed well. Adding LTO support would only add bloat to the code especially since mold’s techniques to improve the efficiency of linking don’t really apply to LTO (where link time is dominated by whole program analysis). I have no issue using the compiler’s native linker when doing production LTO builds and conceptually that makes more sense to me anyway.
I would prefer it if the author avoided features when doing so benefits innovating on the core use case.
Somebody else asked the same question in an issue and the answer is yes, in principle, but it'll take a lot of work. That's not unlike how solid ELF support took a lot of work. I see in the v1.0 release notes, Windows support is nominally planned for v3.0.
Looks like a trade-off which may favor speed over reliability. If a syscall (like msync) in 2nd process will return an error there will no way to abort a build if 1st (main) process already has finished.