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 (almost) arbitrary foreign architectures #1198

Closed
3 tasks done
RalfJung opened this issue Mar 1, 2020 · 2 comments · Fixed by #1261
Closed
3 tasks done

Support (almost) arbitrary foreign architectures #1198

RalfJung opened this issue Mar 1, 2020 · 2 comments · Fixed by #1261
Labels
A-tests Area: affects our test suite or CI C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@RalfJung
Copy link
Member

RalfJung commented Mar 1, 2020

Since Miri is just an interpreter, there's really no reason that a Linux host shouldn't be able to emulate e.g. a rust lib compiled for a Windows target.

And we are almost there! With #1057 fixed, rust-lang/rust#56443 is no longer a problem -- a check-only libstd build does not need a target toolchain, no object files are created. The only barrier left is rust-lang/backtrace-rs#253, and I just submitted a fix for that. For some targets we also need a small xargo tweak.

With those patches applied, I tried a bunch of things on my Linux host, and they all behave as expected -- pretty amazing. :)

./miri run-debug tests/run-pass/hello.rs --target x86_64-apple-darwin
./miri run-debug tests/run-pass/hello.rs --target i686-apple-darwin
./miri run-debug tests/run-pass/hello.rs --target x86_64-pc-windows-gnu
./miri run-debug tests/run-pass/hello.rs --target x86_64-pc-windows-msvc
./miri run-debug tests/run-pass/hello.rs --target i686-pc-windows-gnu
./miri run-debug tests/run-pass/hello.rs --target i686-pc-windows-msvc

Once the patches all land, we should start testing some of these combinations on CI.

@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-tests Area: affects our test suite or CI labels Mar 1, 2020
@RalfJung
Copy link
Member Author

RalfJung commented Mar 2, 2020

The backtrace PR landed. Now it just needs to land in a release so we can bump the crate in rustc. :)

@RalfJung RalfJung mentioned this issue Mar 7, 2020
@RalfJung
Copy link
Member Author

RalfJung commented Mar 7, 2020

The rustc PR to use the fixed backtrace is in the bors queue: rust-lang/rust#69729

When this works, we might even re-land rust-lang/rust#60156 as this time there should be no linking issues... then HashMap would work on macOS even when isolation is enabled. :)

EDIT: But also note rust-lang/rust#70179

bors added a commit that referenced this issue Mar 22, 2020
Cross-test targets

We should now be able to run Linux targets on macOS hosts and vice versa.
Cc #1198
bors added a commit that referenced this issue Mar 25, 2020
cross-running windows-gnu should now also work

Fixes #1198
@bors bors closed this as completed in c6e8838 Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tests Area: affects our test suite or CI C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant