This matches what is done for MSVC in b8000c0ce84541c5b5535419234fb65ce77d6756. Since that commit, compiler rt sanitizer libraries aren't linked to with absolute path on windows, but using their basenames, requiring the libdirs to be passed to the linker.
This fixes undefined behaviour sanitizer on MinGW after b8000c0ce84541c5b5535419234fb65ce77d6756.
Not sure what would be a good test for this, as the lib/clang/<version>/lib/windows directory doesn't exist, it won't show up in tests...