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

support win7 target #428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhangli-pear
Copy link

Add support for *-win7-windows-msvc.

@Fenex
Copy link

Fenex commented Jan 22, 2025

I've tried to compile a modern rustc as host compiler for running on win7 and facing with the same error.

However I think its will be better to skip checks for target_components()[1] (known as target_vendor) at all due vendors can be various, but this all is msvc actually. Before we have "pc" only, right now we want to add "win7". Perhaps, in the future we need to add something else. At least for now there is a "rust9x" target vendor to compile for Windows Vista and older (down to 9x/ME).

tldr, my proposal to use this function:

fn is_windows_msvc() -> bool {
    // Some targets are only two components long, so check in steps.
    target_components().len() > 2
        && target_components()[2] == "windows"
        && target_components()[3] == "msvc"
}

or maybe even (it's required to deeper research for correctness):

fn is_windows_msvc() -> bool {
    // Some targets are only two components long, so check for length before access to ABI target component.
    target_components().len() == 4 && target_components()[3] == "msvc"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants