This is a follow-up to
f189d7a6937 and
9d11b089ad1. While `-z ignore`
is what needs to be passed to the Solaris linker, because gcc is used as
the default linker, both that form and `-Wl,-z -Wl,ignore` (including
extra double quotes) need to be taken into account, which explains the
more complex regular expression.
# Should not link dead code...
$(RUSTC) -Z print-link-args dummy.rs 2>&1 | \
- grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF'
+ grep -e '--gc-sections' -e '-z[^ ]* [^ ]*\<ignore\>' -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')
+ (! grep -e '--gc-sections' -e '-z[^ ]* [^ ]*\<ignore\>' -e '-dead_strip' -e '/OPT:REF')