Re:DARPA project for automated translation from C to Rust (2...
by pizlonator on Wednesday October 01, 2025 @11:52PM
(#45446188)
When you do that, the ABI boundary around your shared library is unsafe.
So if you rebuilt userland with Rust and had the same layout of shared libraries then you’d have a massive amount of unsafe code
Re:DARPA project for automated translation from C to Rust (2...
by woodruffw on Thursday October 02, 2025 @07:43AM
(#45448387)
> So if you rebuilt userland with Rust and had the same layout of shared libraries then you’d have a massive amount of unsafe code
Sort of, but I think that’s misleading; you’d have a massive amount of safe code, scaffolded with unsafe ABI boundaries. That’s a problem, but it’s not really the same kind of attacker or fault surface as unsafe code in the libraries themselves.
It’s also a wholly solvable problem in the sense that Rust could define a stable non-C ABI. There just hasn’t been an extraordinary need for that yet, since most people who want to build Rust code into shared objects do want a C ABI.
I don’t know about Go, but that’s certainly not true for Rust. Dynamic linking is the norm in Rust; you can run `ldd` on any stock-built binary to see that it dynamically links to glibc (or libSystem or similar).
(It’s also common for Rust libraries to be distributed as shared objects with C APIs/ABIs — to my understanding, this is how virtually every incremental adopter of Rust has chosen to adopt it.)