Fix -Z instrument-coverage
on MSVC
Found that -C link-dead-code (which was enabled automatically under -Z instrument-coverage) was causing the linking error that resulted in segmentation faults in coverage instrumented binaries. Link dead code is now disabled under MSVC, allowing `-Z instrument-coverage` to be enabled under MSVC for the first time. More details are included in Issue #76038. (This PR was broken out from PR #75828)
This commit is contained in:
parent
85fbf49ce0
commit
ddb054aee8
6 changed files with 45 additions and 34 deletions
|
@ -86,7 +86,7 @@ impl<'tcx> MonoItem<'tcx> {
|
|||
.debugging_opts
|
||||
.inline_in_all_cgus
|
||||
.unwrap_or_else(|| tcx.sess.opts.optimize != OptLevel::No)
|
||||
&& tcx.sess.opts.cg.link_dead_code != Some(true);
|
||||
&& !tcx.sess.link_dead_code();
|
||||
|
||||
match *self {
|
||||
MonoItem::Fn(ref instance) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue