Skip to content

Commit 8b65325

Browse files
committed
link: remove unused if check
The enclosing check already ensured we're on an is_like_solaris path, so this inner `if` will always be false. Inlined the local variable into its only use, but preserved the comment at the top of the block because it seems like it's still relevant.
1 parent 9a77c3c commit 8b65325

File tree

1 file changed

+6
-7
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+6
-7
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1105,15 +1105,14 @@ fn link_natively(
11051105
// Many illumos systems will have both the native 'strip' utility and
11061106
// the GNU one. Use the native version explicitly and do not rely on
11071107
// what's in the path.
1108-
//
1109-
// If cross-compiling and there is not a native version, then use
1110-
// `llvm-strip` and hope.
1111-
let stripcmd = if !sess.host.is_like_solaris { "rust-objcopy" } else { "/usr/bin/strip" };
11121108
match strip {
11131109
// Always preserve the symbol table (-x).
1114-
Strip::Debuginfo => {
1115-
strip_symbols_with_external_utility(sess, stripcmd, out_filename, Some("-x"))
1116-
}
1110+
Strip::Debuginfo => strip_symbols_with_external_utility(
1111+
sess,
1112+
"/usr/bin/strip",
1113+
out_filename,
1114+
Some("-x"),
1115+
),
11171116
// Strip::Symbols is handled via the --strip-all linker option.
11181117
Strip::Symbols => {}
11191118
Strip::None => {}

0 commit comments

Comments
 (0)