Zig 自研 ELF 链接器提速迭代
为什么值得看
Zig 0.16.0 自带的 ELF 链接器正在快速完善,近期新增对外部库和 libc 的支持。对系统编程和构建工具链的开发者来说,这意味着未来可能用单一工具替代 ld/lld,简化交叉编译链路。
编辑判断
目前系统级项目链接 ELF 基本绕不开 GNU ld 或 LLVM 的 lld,依赖重、配置复杂。Zig 的路线是把链接器内建到编译器里,用同一套代码处理所有平台的链接逻辑,这是 Go 和 Rust 都没做到的事。
不过现阶段它仍默认关闭,成熟度不及 lld,生产环境别急着切。做嵌入式、OS 开发或自己维护构建系统的团队可以跟踪进展,一旦稳定,交叉编译的复杂度会降一个数量级。
社区反馈
正面 9 条评论
核心争论:Zig 自研链接器是长期规划还是受 Bun drama 催化的应激反应
This is the promise that blew my mind the first time I heard about Zig years ago. So happy to see this become reality!
I wonder how much this work being pushed forward right now is a response to the Bun drama.
None of it, we've been working on this stuff for a long time already, scroll the devlog backwards, you will find plenty of entries on that topic. It's the opposite: people have become more receptive to communication about this work now that there's "drama" attached to it. This post I co-authored wit