Mold (linker) 1.0 released
source link: https://lwn.net/Articles/878759/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Mold (linker) 1.0 released
mold 1.0 is the first stable and production-ready release of the high-speed linker. On Linux-based systems, it should "just work" as a faster drop-in replacement for the default GNU linker for most user-land programs. If you are building a large executable which takes a long time to link, mold is worth a try to see if it can shorten your build time.
(Log in to post comments)
Mold (linker) 1.0 released
Posted Dec 15, 2021 18:16 UTC (Wed) by donbarry (guest, #10485) [Link]
The Github LICENSE page explains why -- it's not out of a love for free software:
"I'm looking for a sponsor who wants to purchase the copyright of this work and relicense it under a more liberal license such as the MIT license. For now, mold is released under the GNU AGPL v3."
Mold (linker) 1.0 released
Posted Dec 15, 2021 18:40 UTC (Wed) by yodermk (guest, #3803) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 19:20 UTC (Wed) by donbarry (guest, #10485) [Link]
Not exactly in line with the whole ethic of the license itself.
Mold (linker) 1.0 released
Posted Dec 15, 2021 19:32 UTC (Wed) by mathstuf (subscriber, #69389) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 20:58 UTC (Wed) by atai (subscriber, #10977) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 19:40 UTC (Wed) by NYKevin (subscriber, #129325) [Link]
* I am rather skeptical that this is how the FSF feels, however, because RMS endorsed the practice of selling exceptions to the GPL all the way back in 2010: https://www.fsf.org/blogs/rms/selling-exceptions. So it may simply be that they do not agree with you, and would see nothing wrong with this practice anyway.
Mold (linker) 1.0 released
Posted Dec 15, 2021 20:16 UTC (Wed) by rvolgers (subscriber, #63218) [Link]
If anything, this is more public-spirited than that approach.
People like the GPL because it enforces giving more rights to users. But that also means people and companies may not like the GPL because it leaves fewer exclusive rights for them to sell for money.
There is nothing wrong with recognizing there are potential downsides to the GPL and that companies are willing to pay to avoid them.
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:03 UTC (Wed) by atai (subscriber, #10977) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 20:20 UTC (Wed) by cyperpunks (subscriber, #39406) [Link]
https://lld.llvm.org/
Mold (linker) 1.0 released
Posted Dec 15, 2021 20:34 UTC (Wed) by jhoblitt (subscriber, #77733) [Link]
I have never used mold and can't attest to its performance.
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:10 UTC (Wed) by syrjala (subscriber, #47399) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 22:03 UTC (Wed) by atai (subscriber, #10977) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:11 UTC (Wed) by ballombe (subscriber, #9523) [Link]
Now that would be something!
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:59 UTC (Wed) by Vipketsh (guest, #134480) [Link]
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:18 UTC (Wed) by Karellen (subscriber, #67644) [Link]
From the README.md:
It is sometimes very hard to pass an appropriate command line option to cc to specify an alternative linker. [...]
For some reason, I thought that setting the "LD" environment variable would work for most GNU build tools. But checking the GNU make Implicit Variables documentation, although there exists CC & CCFLAGS, and CXX & CXXFLAGS, and similar (but not always exact) snowclones of tool & toolFLAGS variables for AR, AS, CPP, FC, CO, LEX, YACC, PC and LINT, and there is an LDFLAGS, there is no LD equivalent!
What a bizarre inconsistency.
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:31 UTC (Wed) by Bigos (subscriber, #96807) [Link]
And these frontends had to learn alternate linkers on their own using command line parameters. This is how -fuse-ld=$LINKER came to be. Unfortunately, for whatever reason (various linkers not being completely compatible?), the $LINKER parameter, at least for gcc, is restricted to a list of linkers, mold not being one of them. Also note that $LINKER is not the executable name, it is ld.$LINKER instead (like ld.gold).
https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Link-Option...
Mold (linker) 1.0 released
Posted Dec 15, 2021 22:12 UTC (Wed) by madscientist (subscriber, #16861) [Link]
The contents of the manual are the MINIMUM set of variables that are assigned. The docs make this pretty clear where it says: Here is a table of some of the more common variables. If you want to know the full set of default variables you can ask make to show them to you:
$ make -pf/dev/null | grep ^LD make: *** No targets. Stop. LD = ld
As already mentioned, though, it's very rare that anyone actually uses ld directly. These days, unless you're trying to create a bare executable, you pretty much have to use the compiler's front end because it will add important linker options and internal (but critically important) libraries. Indeed, most of make's built-in rules don't use $(LD) they use $(CC) (or the equivalent for other languages).
Mold (linker) 1.0 released
Posted Dec 15, 2021 21:57 UTC (Wed) by Vipketsh (guest, #134480) [Link]
Program (linker output size)
Chrome 96 (1.89 GiB)
Clang 13 (3.18 GiB)
Firefox 89 libxul (1.64 GiB)
So, programs these days weigh in at multiple gigabytes. Anyone know what the breakdown of those gigabytes are ? Surely it is not all machine code...
Mold (linker) 1.0 released
Posted Dec 15, 2021 22:50 UTC (Wed) by mathstuf (subscriber, #69389) [Link]
Mold (linker) 1.0 released
Posted Dec 16, 2021 0:27 UTC (Thu) by rillian (subscriber, #11344) [Link]
These are also huge programs. According to tokei on today's main branches:
firefox 37M lines of code (3M C, 6M C++, 4M headers, 8M Javascript, 3M Rust)
chromium 36M lines (14M C++, 5M headers, 4M Javascript)
linux 32M lines (21M C, 7M headers)
Browsers are effectively an entire userspace unto themselves, so it's not surprising builds are the same size as a minimal desktop image.
Otherwise, what mathstuf said. Link times on large C++ applications can be a real bottleneck, especially for incremental development. Linux has the advantage of being in C, and more modular.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK