rustc_codegen_cranelift
rustc_codegen_cranelift copied to clipboard
Add a sandboxed mode
All memory accesses will use a Cranelift heap, just like for web assembly. In addition only explicitly allowed function calls will be allowed. This sandbox mode will not be available when using cg_clif directly as codegen backend, but only when using the jit mode (and maybe in the future aot mode) with a future api exported by librustc_codegen_cranelift.
This would be useful for a program to have plugns that can be hot-swapped safely.
This is non-trivial to implement due to libc and other crates using a lot of system api's. See miri for how much code it needs. Embedding wasm is probably more useful anyway.