Open RalfJung opened 1 month ago
Compiling code with RWPI currently produces a linker error. See https://github.com/thejpster/relocatable-experiments
I was told by Arm they will send a fix to LLVM for this but it might not make the next release.
And in case anyone was wondering, they're apparently pronounced "ropey" and "rupee".
Also, AFAIK the RWPI issue still blocks TockOS from being able to execute applications written in Rust, because the run-time RW address isn’t known at compile time.
https://tockos.org/blog/2017/talking-tock-17/
https://github.com/tock/libtock-rs/issues/28
https://github.com/rust-lang/rust/issues/54431
You can see it’s been known about for a very long time and no-one has fixed LLVM yet. Well I think Arm fixed their copy of LLVM but they only use it with clang and they only support C code.
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-medium
This is based on the discussion here; I don't understand much of the underlying technical details unfortunately.
It seems like setting
-Crelocation-model=rwpi
on an ARM target compiles code in a way that it expects a particular register to be reserved for data addressing. However, the standard library is not built with that in mind and can use the register for other purposes. That's clearly unsound, we can now get arbitrary misbehavior because the same register is used in conflicting ways.