From 64bfcf310be6f81dac0b95c863926520dbf5467c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 14 Feb 2016 22:00:05 -0800 Subject: [PATCH] Pass SAFESEH to i686 MSVC tools --- src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 26275e2..38e38c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -407,6 +407,9 @@ impl Config { if opt_level != 0 { cmd.args.push("/O2".into()); } + if target.contains("i686") { + cmd.args.push("/SAFESEH".into()); + } } else if nvcc { cmd.args.push(format!("-O{}", opt_level).into()); } else { @@ -488,6 +491,14 @@ impl Config { cmd.arg(&format!("/D{}", key)); } } + + if target.contains("i686") { + cmd.arg("/SAFESEH"); + } + for flag in self.flags.iter() { + cmd.arg(flag); + } + (cmd, tool.to_string()) }