Choose the correct file extensions when cross-compiling for Windows

When building a shared lib for the host tools toolchain, use .so on
Linux, .dylib on Mac and .dll on Windows. Don't use the target's
file extension.

When building a batch file to run the rust unit tests on Windows, use
the .exe extension even if building that batch file on a Linux
machine.

R=hans@chromium.org, lukasza@chromium.org

Bug: 1271215
Change-Id: If90ea0013655a6c89e96688c9f9610b6539eb149
Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,mac-rust-x64-dbg,linux-rust-x64-dbg,linux-rust-x64-rel,win-rust-x64-dbg,win-rust-x64-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4619088
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Ɓukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1158785}
NOKEYCHECK=True
GitOrigin-RevId: 9f9c029d53ed4e8a1a0cdeff70a9e21e41f840ce
2 files changed