Skip to content

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

Closed
@RalfJung

Description

@RalfJung

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-solarishArea: affects our Solaris/Illumos target supportC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions