From 203a8076734902385047a353cfb373a10899433c Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 13 Jul 2018 22:36:42 -0700 Subject: [PATCH] Fix stack overflow on windows. Fixes #838 --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 644c3568a3d..cb4e8ccf201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,13 @@ #![warn(clippy)] #![allow(cyclomatic_complexity, needless_pass_by_value, too_many_arguments)] +// See rustc/rustc.rs in rust repo for explanation of stack adjustments. +#![feature(link_args)] +#[allow(unused_attributes)] +#[cfg_attr(all(windows, target_env = "msvc"), link_args = "/STACK:16777216")] +#[cfg_attr(all(windows, not(target_env = "msvc")), link_args = "-Wl,--stack,16777216")] +extern {} + extern crate cargo; extern crate cargo_metadata; extern crate env_logger;