Skip to content

Commit

Permalink
Emit error when trying to use PGO in conjunction with unwinding on Wi…
Browse files Browse the repository at this point in the history
…ndows.
  • Loading branch information
michaelwoerister committed May 28, 2019
1 parent 837b72c commit 9f92668
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/librustc/session/mod.rs
Expand Up @@ -1281,6 +1281,18 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
path.display()));
}
}

// PGO does not work reliably with panic=unwind on Windows. Let's make it
// an error to combine the two for now. It always runs into an assertions
// if LLVM is built with assertions, but without assertions it sometimes
// does not crash and will probably generate a corrupted binary.
if sess.opts.debugging_opts.pgo_gen.enabled() &&
sess.target.target.options.is_like_msvc &&
sess.panic_strategy() == PanicStrategy::Unwind {
sess.err("Profile-guided optimization does not yet work in conjunction \
with `-Cpanic=unwind` on Windows when targeting MSVC. \
See https://github.com/rust-lang/rust/issues/61002 for details.");
}
}

/// Hash value constructed out of all the `-C metadata` arguments passed to the
Expand Down

0 comments on commit 9f92668

Please sign in to comment.