rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.16k stars 318 forks source link

Solaris: add stub shims so that pre-main code works #3566

Closed RalfJung closed 2 months ago

RalfJung commented 2 months ago

Currently, even an empty main fails on Solaris as we're hitting some unsupported functions in the pre-main std initialization code -- specifically, the guard page setup.

On other OSes we have some shims that don't even try to implement their proper functionality (like this), solely for the purpose of making the guard page work. We likely need something similar here.

We will probably have to extend this hack to also allow solaris, not just macos:

https://github.com/rust-lang/miri/blob/10e8bb87fe416bc190426789032594aa1aa311f2/src/shims/unix/mem.rs#L47-L49

We also need a stack_getbounds shim. It looks like stack_getbounds can just do nothing, but you're going to have to try this out. If not, this.machine.stack_addr and this.machine.stack_size are the fake values we are using elsewhere.

Cc @devnexen