File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -303,12 +303,13 @@ where
303303 let tsan_options = env:: var ( "TSAN_OPTIONS" ) . unwrap_or_default ( ) ;
304304 let tsan_options = format ! ( "report_signal_unsafe=0:{}" , tsan_options) ;
305305
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+
306311 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 ) {
312313 "sancov-module"
313314 } else {
314315 "sancov"
@@ -377,3 +378,11 @@ where
377378 . unwrap ( ) ;
378379 process:: exit ( status. code ( ) . unwrap_or ( 1 ) ) ;
379380}
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