mold项目发布了3.0.0版本,标志着这款高速链接器的一个重要里程碑1。新版本将代码从C++完全重写为Rust,其中3.0.0是首个Rust版本,而2.42.1则是最后的C++版本1。构建系统也随之从CMake改为Cargo,编译需要Rust 1.95或更高版本1。
mold 3.0作为2.42.1的直接替代品,接受相同的命令行选项,支持相同的目标架构,产生相同的输出(除了bug修复)1。项目在Gentoo所有包的构建测试中未发现回归问题1。此次Rust重写通过添加边界检查来改进内存安全,用panic替代了C++版本在处理损坏输入文件时可能导致的内存越界读取和段错误1。同时,新版本不再依赖oneTBB库,改为静态链接mimalloc 3.5.31。
该项目旨在通过Rust改进内存安全性并修复大量兼容性问题,目标是最终成为Linux发行版的默认链接器1。mold项目通过GitHub Sponsors和OpenCollective接受社区捐赠1。
The mold project has released version 3.0.0, marking a major milestone by completely rewriting the high-speed linker from C++ into Rust.1 This release represents the final transition point: version 3.0.0 is the first Rust iteration, while version 2.42.1 stands as the last C++ version.1
The new version is designed to function as a direct replacement for 2.42.1, accepting identical command-line options, supporting the same target architectures, and producing equivalent output except for bug fixes.1 The build system has shifted from CMake to Cargo and requires Rust 1.95 or later.1 Testing across all packages in Gentoo revealed no regressions,1 providing early assurance of compatibility. The migration also brings structural improvements: the linker no longer depends on oneTBB and now statically links mimalloc 3.5.3.1
A key motivation for the Rust rewrite involves memory safety. The original C++ version could cause out-of-bounds memory reads and segmentation faults when handling corrupted input files.1 The Rust version addresses these issues by implementing boundary checks that trigger panics instead.1 The mold project continues to welcome support through GitHub Sponsors and OpenCollective.1
评论
还没有评论,欢迎留下第一条。