Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RalfJung opened this issue May 5, 2024 · 0 comments · Fixed by #3570
Closed

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

RalfJung opened this issue May 5, 2024 · 0 comments · Fixed by #3570
Labels
A-solarish Area: affects our Solaris/Illumos target support C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available

Comments

@RalfJung
Copy link
Member

RalfJung commented May 5, 2024

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:

if this.frame_in_std() && this.tcx.sess.target.os == "macos" && (flags & map_fixed) != 0 {
return Ok(Scalar::from_maybe_pointer(Pointer::from_addr_invalid(addr), this));
}

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

@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available A-solarish Area: affects our Solaris/Illumos target support labels May 5, 2024
@bors bors closed this as completed in 193aafe May 5, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-solarish Area: affects our Solaris/Illumos target support C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant