- LLD="$(which ${LLD_PFX}lld-$RUSTC_LLVM_V || echo ${LLD_PFX}lld)"
- LLD_LLVM_V="$($LLD --version | awk '{ print $2; }')"
- if [ "$LLD_LLVM_V" = "LLD" ]; then # eg if the output is "Debian LLD ..."
- LLD_LLVM_V="$(${LLD_PFX}lld-$RUSTC_LLVM_V --version | awk '{ print substr($3, 0, 2); }')"
- else
- LLD_LLVM_V="$(${LLD_PFX}lld-$RUSTC_LLVM_V --version | awk '{ print substr($2, 0, 2); }')"
- fi
+ LLD="$(which lld-$RUSTC_LLVM_V || echo lld)"
+ LLD_LLVM_V="$(ld.$LLD --version | awk '{ print substr($2, 0, 2); }')"