File tree 1 file changed +12
-0
lines changed
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) {
1272
1272
sess. err ( "Linker plugin based LTO is not supported together with \
1273
1273
`-C prefer-dynamic` when targeting MSVC") ;
1274
1274
}
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
+ }
1275
1287
}
1276
1288
1277
1289
/// 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