rustc_driver: get rid of extra thread on Windows
This commit is contained in:
parent
e85c9227c2
commit
1bb89f1b3c
|
@ -1488,7 +1488,11 @@ pub fn in_rustc_thread<F, R>(f: F) -> Result<R, Box<Any + Send>>
|
|||
}
|
||||
};
|
||||
|
||||
#[cfg(not(unix))]
|
||||
// We set the stack size at link time. See src/rustc/rustc.rs.
|
||||
#[cfg(windows)]
|
||||
let spawn_thread = false;
|
||||
|
||||
#[cfg(not(any(windows,unix)))]
|
||||
let spawn_thread = true;
|
||||
|
||||
// The or condition is added from backward compatibility.
|
||||
|
|
|
@ -9,6 +9,15 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![feature(rustc_private)]
|
||||
#![feature(link_args)]
|
||||
|
||||
// Set the stack size at link time on Windows. See rustc_driver::in_rustc_thread
|
||||
// for the rationale.
|
||||
#[cfg_attr(all(windows, target_env = "msvc"), link_args = "/STACK:16777216")]
|
||||
// We only build for msvc and gnu now, but we use a exhaustive condition here
|
||||
// so we can expect either the stack size to be set or the build fails.
|
||||
#[cfg_attr(all(windows, not(target_env = "msvc")), link_args = "-Wl,--stack,16777216")]
|
||||
extern {}
|
||||
|
||||
extern crate rustc_driver;
|
||||
|
||||
|
|
Loading…
Reference in New Issue