mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 11:23:03 +00:00
support no_std on Windows
This commit is contained in:
parent
245857beb7
commit
3158a8d476
@ -75,7 +75,6 @@ function run_tests_minimal {
|
||||
./miri test -- "$@"
|
||||
|
||||
# Ensure that a small smoke test of cargo-miri works.
|
||||
# Note: This doesn't work on windows because of TLS.
|
||||
cargo miri run --manifest-path test-cargo-miri/no-std-smoke/Cargo.toml
|
||||
}
|
||||
|
||||
|
@ -261,6 +261,11 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
||||
// (that would be basically https://github.com/rust-lang/miri/issues/450),
|
||||
// we specifically look up the static in libstd that we know is placed
|
||||
// in that section.
|
||||
if !this.have_module(&["std"]) {
|
||||
// Looks like we are running in a `no_std` crate.
|
||||
// That also means no TLS dtors callback to call.
|
||||
return Ok(());
|
||||
}
|
||||
let thread_callback =
|
||||
this.eval_windows("thread_local_key", "p_thread_callback")?.to_pointer(this)?;
|
||||
let thread_callback = this.get_ptr_fn(thread_callback)?.as_instance()?;
|
||||
|
@ -1,9 +1,5 @@
|
||||
#![feature(lang_items, start)]
|
||||
#![no_std]
|
||||
// windows tls dtors go through libstd right now, thus this test
|
||||
// cannot pass. When windows tls dtors go through the special magic
|
||||
// windows linker section, we can run this test on windows again.
|
||||
//@ignore-target-windows: no-std not supported on Windows
|
||||
|
||||
// Plumbing to let us use `writeln!` to host stdout:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user