[bazel] Improve building on/for Windows (#171761)
Few things going on here:
- I think we should be able to use the blake3 x86-64 asm on windows with
some slight adjustments (sorry it's still named *_unix.S, renaming
seemed like a bit bigger project)
- `genrule` is really evil because it bakes the path to the host bash
into the command, which fails spectacularly when running on a
non-windows remote executor. Swap to `write_file`/`run_binary` rules to
mitigate it
- The existing windows linkopts do not work correctly for clang in mingw
mode
With this set of changes (as well as another one that rewrites
`bundle_resources.py` into C) I am able to hermetically cross-build
clang/lld/etc from a windows host to a (mingw) windows target on a linux
executor, and use the resulting compilers to compile C binaries/tests
(see
https://github.com/dzbarsky/toolchains_llvm_bootstrapped/actions/runs/20121686105/job/57743214313?pr=1
and https://github.com/dzbarsky/toolchains_llvm_bootstrapped/pull/1)