Skip to content

Enable including probestack::__rust_probestack on no_std windows targets #402

Closed
@wumb0

Description

@wumb0

Building a no_std project on windows still will generate calls to _chkstk/__chkstk so I'd like to be able to include __rust_probestack instead of having to either re-write my code to not have functions that large OR steal chkstk code from Visual Studio.

This is currently not possible because of the following assumption and code:

// Windows already has builtins to do this.
#![cfg(not(windows))]

This assumption is only true when building with std/msvcrt.

To add this functionality without breaking existing code a feature flag like force-probestack could be added (please suggest a more suitable name). That would be a pretty minimal code change and also solve the issue:

#![cfg(any(not(windows), feature="force-probestack"))]

The existing x86/x86_64 probestack code currently marked as uefi works fine on Windows, so some changes to the cfg statements will need to be made. I have some working code if a PR would be more desirable.

I suggest the feature flag over just enabling this by default on no_std targets to keep compatibility with existing uses of the crate.

Let me know there is already a way to do this, or if this suggestion is nonsense. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions