Emit error when trying to use PGO in conjunction with unwinding on Windows.

This commit is contained in:
Michael Woerister 2019-05-21 12:11:23 +02:00
parent 837b72c805
commit 9f92668ce1

View File

@ -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