Skip to content

Support (almost) arbitrary foreign architectures #1198

Closed
@RalfJung

Description

@RalfJung

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsArea: affects our test suite or CIC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions