Using "mold" for lto instead of gcc "gold" #87

Open
opened 2021-12-31 11:59:49 +01:00 by Gontier-Julien · 4 comments

So the new linker called mold as now it second stable release.

So why replacing gcc gold for the new linker mod?
It faster, and a lots, it could reduce the time of compile time by half of more.

So the new linker called [mold](https://github.com/rui314/mold) as now it second stable release. So why replacing gcc `gold` for the new linker `mod`? It faster, and a lots, it could reduce the time of compile time by half of more.
Owner

No LTO support makes this incompatible with our use-case for now.

If LTO is added at some point, there is a good chance Arch is going to switch as well. We can reevaluate it at that point again.

[No LTO support](https://github.com/rui314/mold/issues/181) makes this incompatible with our use-case for now. If LTO is added at some point, there is a good chance Arch is going to switch as well. We can reevaluate it at that point again.
anonfunc added the
enhancement
label 2021-12-31 12:12:02 +01:00
anonfunc changed title from [ Suggestion ] Using "mold" for lto instead of gcc "gold" to Using "mold" for lto instead of gcc "gold" 2021-12-31 12:15:07 +01:00

mold 1.1 now natively supports LTO: https://github.com/rui314/mold/releases/tag/v1.1

mold 1.1 now natively supports LTO: https://github.com/rui314/mold/releases/tag/v1.1
Owner

Good news.

Reading

Native LTO (link-time optimization) support has been added. mold used to invoke ld.bfd or ld.lld if it encountered a GCC IR (intermediate representation) file or an LLVM IR file to delegate the task to the LTO-capable linkers, respectively. Now, mold handles IR files directly. This feature is implemented using the linker plugin API which is also used by GNU ld and GNU gold. Note that the LTO support has been added for completeness and not for speed. mold is only marginally faster than the other linkers for LTO builds because not linking but code optimization dominates.

does not sound promising for using mold with LTO builds.

Maybe it's still worth for non-lto builds.

Good news. Reading > Native LTO (link-time optimization) support has been added. mold used to invoke ld.bfd or ld.lld if it encountered a GCC IR (intermediate representation) file or an LLVM IR file to delegate the task to the LTO-capable linkers, respectively. Now, mold handles IR files directly. This feature is implemented using the linker plugin API which is also used by GNU ld and GNU gold. Note that the LTO support has been added for completeness and not for speed. mold is only marginally faster than the other linkers for LTO builds because not linking but code optimization dominates. does not sound promising for using mold with LTO builds. Maybe it's still worth for non-lto builds.
Owner
For reference: https://gitlab.archlinux.org/archlinux/devtools/-/merge_requests/127
Sign in to join this conversation.
No description provided.