File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -303,12 +303,13 @@ where
303
303
let tsan_options = env:: var ( "TSAN_OPTIONS" ) . unwrap_or_default ( ) ;
304
304
let tsan_options = format ! ( "report_signal_unsafe=0:{}" , tsan_options) ;
305
305
306
+ // The new LLVM pass manager was not enabled in rustc 1.57 as expected:
307
+ // https://github.com/rust-lang/rust/pull/91263
308
+ // The fix for now is to pass `-C passes=sancov-module` only to nightly
309
+ // compilers for which the LLVM version is >= 13.
310
+
306
311
let version_meta = rustc_version:: version_meta ( ) . unwrap ( ) ;
307
- let passes = if version_meta. semver . minor >= 57
308
- && version_meta. llvm_version . map_or ( true , |v| v. major >= 13 )
309
- {
310
- // New LLVM pass manager is enabled when Rust 1.57+ and LLVM 13+
311
- // https://github.com/rust-lang/rust/pull/88243
312
+ let passes = if is_nightly ( ) && version_meta. llvm_version . map_or ( true , |v| v. major >= 13 ) {
312
313
"sancov-module"
313
314
} else {
314
315
"sancov"
@@ -377,3 +378,11 @@ where
377
378
. unwrap ( ) ;
378
379
process:: exit ( status. code ( ) . unwrap_or ( 1 ) ) ;
379
380
}
381
+
382
+ fn is_nightly ( ) -> bool {
383
+ Command :: new ( "rustc" )
384
+ . args ( & [ "-Z" , "help" ] )
385
+ . status ( )
386
+ . unwrap ( )
387
+ . success ( )
388
+ }
You can’t perform that action at this time.
0 commit comments