Cross compiling with Clang for MSVC compatibility?

I’ve tried combining the examples from the cross compilation wiki and using clang instead of gcc:

with import <nixpkgs> {
  crossSystem = {
    config = "x86_64-w64-mingw32";
clangStdenv.mkDerivation {
  name = "clang-nix-shell";
  buildInputs = [];

But the result is a complicated error message:

/build/ccptu7HG.s: Assembler messages:
/build/ccptu7HG.s:6: Error: unknown pseudo-op: `.symver'
make[1]: *** [Makefile:2036: lib/libcrypt_la-crypt-gensalt-static.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: compile:  x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I./lib -DIN_LIBCRYPT -Wall -Wextra -Walloc-zero -Walloca -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation=1 -Wlogical-op -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wpointer-arith -Wrestrict -Wshadow -Wstrict-overflow=2 -Wstrict-prototypes -Wundef -Wvla -Wwrite-strings -Wpedantic -Werror -fno-plt -g -O2 -c lib/crypt-pbkdf1-sha1.c  -DDLL_EXPORT -DPIC -o lib/.libs/libcrypt_la-crypt-pbkdf1-sha1.o
make[1]: Leaving directory '/build/libxcrypt-4.4.30'
make: *** [Makefile:1349: all] Error 2

Is there any way to make this work?

Edit: I’m now thinking that I might actually need to use microsoft’s STL and perhaps even the windows sdk instead of MinGW’s toolchain if I want full compatibility…

Now msvc-wine seems like the way of least resistance. They do mention it is possible to use clang in msvc mode with the windows sdk without wine despite their name. That sounds promising.