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 @@ -1281,6 +1281,18 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
1281
1281
path. display( ) ) ) ;
1282
1282
}
1283
1283
}
1284
+
1285
+ // PGO does not work reliably with panic=unwind on Windows. Let's make it
1286
+ // an error to combine the two for now. It always runs into an assertions
1287
+ // if LLVM is built with assertions, but without assertions it sometimes
1288
+ // does not crash and will probably generate a corrupted binary.
1289
+ if sess. opts . debugging_opts . pgo_gen . enabled ( ) &&
1290
+ sess. target . target . options . is_like_msvc &&
1291
+ sess. panic_strategy ( ) == PanicStrategy :: Unwind {
1292
+ sess. err ( "Profile-guided optimization does not yet work in conjunction \
1293
+ with `-Cpanic=unwind` on Windows when targeting MSVC. \
1294
+ See https://github.com/rust-lang/rust/issues/61002 for details.") ;
1295
+ }
1284
1296
}
1285
1297
1286
1298
/// 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