File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1272,6 +1272,18 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
12721272 sess. err ( "Linker plugin based LTO is not supported together with \
12731273 `-C prefer-dynamic` when targeting MSVC") ;
12741274 }
1275+
1276+ // PGO does not work reliably with panic=unwind on Windows. Let's make it
1277+ // an error to combine the two for now. It always runs into an assertions
1278+ // if LLVM is built with assertions, but without assertions it sometimes
1279+ // does not crash and will probably generate a corrupted binary.
1280+ if sess. opts . debugging_opts . pgo_gen . enabled ( ) &&
1281+ sess. target . target . options . is_like_windows &&
1282+ sess. panic_strategy ( ) == PanicStrategy :: Unwind {
1283+ sess. err ( "Profile-guided optimization does not yet work in conjunction \
1284+ with `-Cpanic=unwind` on Windows. \
1285+ See https://github.com/rust-lang/rust/issues/61002 for details.") ;
1286+ }
12751287}
12761288
12771289/// Hash value constructed out of all the `-C metadata` arguments passed to the
You can’t perform that action at this time.
0 commit comments