Auto merge of #37994 - upsuper:msvc-link-opt, r=alexcrichton
Don't apply msvc link opts for non-opt build `/OPT:REF,ICF` sometimes takes lots of time. It makes no sense to apply them when doing debug build. MSVC's linker by default disables these optimizations when `/DEBUG` is specified, unless they are explicitly passed.
This commit is contained in:
commit
1842efbae4
2 changed files with 12 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ all:
|
|||
|
||||
# Should not link dead code...
|
||||
$(RUSTC) -Z print-link-args dummy.rs 2>&1 | \
|
||||
grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF,ICF'
|
||||
grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF'
|
||||
# ... unless you specifically ask to keep it
|
||||
$(RUSTC) -Z print-link-args -C link-dead-code dummy.rs 2>&1 | \
|
||||
(! grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF,ICF')
|
||||
(! grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue