TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Wild – A fast linker for Linux

383 点作者 hkalbasi4 个月前

16 条评论

pzmarzly4 个月前
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.
评论 #42815606 未加载
评论 #42819089 未加载
评论 #42819826 未加载
评论 #42815102 未加载
评论 #42816517 未加载
satvikpendem4 个月前
I looked at this before, is it ready for production? I thought not based on the readme, so I&#x27;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&#x27;re using it with Rust, put this in your config.toml:<p><pre><code> [target.aarch64-apple-darwin] rustflags = [ &quot;-C&quot;, &quot;link-arg=-fuse-ld=&#x2F;Applications&#x2F;Xcode.app&#x2F;Contents&#x2F;Developer&#x2F;Toolchains&#x2F;XcodeDefault.xctoolchain&#x2F;usr&#x2F;bin&#x2F;ld&quot;, &quot;-C&quot;, &quot;link-arg=-ld_new&quot;, ]</code></pre>
评论 #42815620 未加载
评论 #42814999 未加载
评论 #42818677 未加载
评论 #42817303 未加载
kryptiskt4 个月前
What would be refreshing would be a C&#x2F;C++ compiler that did away with the intermediate step of linking and built the whole program as a unit. LTO doesn&#x27;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&#x27;t need to be built from source, so eliminating the linker doesn&#x27;t pose a problem for non-open source dependencies. And if that&#x27;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.
评论 #42817207 未加载
评论 #42816272 未加载
ComputerGuru4 个月前
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.
评论 #42817147 未加载
评论 #42815523 未加载
ajb4 个月前
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...
评论 #42819983 未加载
评论 #42817077 未加载
评论 #42817811 未加载
评论 #42816811 未加载
fuzztester4 个月前
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:&#x2F;&#x2F;www.johnlevine.com&#x2F;books.phtml" rel="nofollow">https:&#x2F;&#x2F;www.johnlevine.com&#x2F;books.phtml</a><p>I had read it some years ago, and found it quite interesting.<p>It&#x27;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).
shmerl4 个月前
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&#x27;s .cargo&#x2F;config.toml:<p><pre><code> [target.x86_64-unknown-linux-gnu] rustflags = [&quot;-C&quot;, &quot;link-arg=-fuse-ld=wild&quot;] </code></pre> Side note, but why does Rust need to plug into gcc or clang for that? Some missing functionality?
评论 #42817056 未加载
评论 #42816486 未加载
KerrAvon4 个月前
I&#x27;m curious: what&#x27;s the theory behind why this would be faster than mold in the non-incremental case? &quot;Because Rust&quot; is a fine explanation for a bunch of things, but doesn&#x27;t explain expected performance benefits.<p>&quot;Because there&#x27;s low hanging concurrent fruit that Rust can help us get?&quot; would be interesting but that&#x27;s not explicitly stated or even implied.
评论 #42818238 未加载
bjourne4 个月前
What a coincidence. :) Just an hour ago I compared the performance of wild, mold, and (plain-old) ld on a C project I&#x27;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&#x27;t be that much of a problem for well-structured projects.
评论 #42817186 未加载
评论 #42817193 未加载
评论 #42817177 未加载
评论 #42817070 未加载
1vuio0pswjnm74 个月前
&quot;These benchmark were run on David Lattimore&#x27;s laptop (2020 model System76 Lemur pro), which has 4 cores (8 threads) and 42 GB of RAM.&quot;<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33330499">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;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.
评论 #42899207 未加载
评论 #42824061 未加载
sylware4 个月前
The real issue is actually runtime ELF (and PE) which are obsolete on modern hardware architecture.
评论 #42816474 未加载
ndesaulniers4 个月前
Can it link the Linux kernel yet? Was a useful milestone for LLD.
评论 #42818165 未加载
juujian4 个月前
Is it too late to ask what a linker is?
评论 #42818401 未加载
Mikhail_K4 个月前
I just knew it&#x27;s going to be Rust as soon as I&#x27;ve read the title.
devit4 个月前
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.
评论 #42815621 未加载
评论 #42815180 未加载
评论 #42815042 未加载
评论 #42815474 未加载
评论 #42815279 未加载
评论 #42815660 未加载
评论 #42815895 未加载
评论 #42815434 未加载
评论 #42815894 未加载
throwaway1063824 个月前
&gt; Mold is already very fast, however it doesn&#x27;t do incremental linking and the author has stated that they don&#x27;t intend to. Wild doesn&#x27;t do incremental linking yet, but that is the end-goal. By writing Wild in Rust, it&#x27;s hoped that the complexity of incremental linking will be achievable.<p>Can someone explain what is so special about Rust for this?
评论 #42814952 未加载
评论 #42814975 未加载
评论 #42815031 未加载
评论 #42814925 未加载
评论 #42816061 未加载
评论 #42815564 未加载
评论 #42816644 未加载
评论 #42814958 未加载
评论 #42815091 未加载
评论 #42814916 未加载
评论 #42815056 未加载