Hacker News new | ask | show | jobs
by squirrellous 270 days ago
Between mold and this, the linker space appears to be going through a renaissance.

Does anyone know if it’s reasonably easy to use elf2 as a standalone linker in a c/c++ toolchain? Or is it specially built just for Zig?

2 comments

Looking in the source tree, it doesn't look like it has it's own entry point. Zig is heading in the direction of a very verticall integrated compilation stack (I believe this is where most of the speed up comes from), so I'm not really sure of the utility with using it outside of the Zig world.

https://github.com/jacobly0/zig/tree/4508c2543508e04253471e1... https://github.com/jacobly0/zig/blob/4508c2543508e04253471e1...

> this is where most of the speed up comes from

I might be mistaken, but the brief look at code shows that the speed up appears to come from combination of async architecture (the selling point of Mold) and intelligent usage of PUNCH_HOLE/INSERT_RANGE fallocate() operations.

Surprisingly enough PUNCH_HOLE and friends have already matured to be production ready, with viable support from ext4 and xfs filesystem. The possibilities!

I stand corrected! It would be interesting to try and use the Zig linker for something else, would be a neat weekend project.
> Between mold and this, the linker space appears to be going through a renaissance.

No kidding. There are also https://github.com/davidlattimore/wild and https://github.com/kubkon/bold.