It seems this would result in duplicate definitions of mlir::registerGpuSerializeToCubinPass() on Windows.
Maybe we could use /alternatename?
I'm not sure how to handle mangled names though.
Alternatively, the above article also links to this approach, but getting bazel (and CMake) to link in a specific way might be tricky.
Yes, there would be duplicate definitions. MSVC would just pick one of them. But at least it would not result in a compilation error. Currently Tensorflow is broken because of this, although it does not even care about running the MLIR tests, so which definition is picked is not important in that use case.