After adding the right linker, I still cannot do a profile build:
lld-link: error: could not open 'C:/msys64/mingw64/lib/clang/12.0.0/lib/windows/libclang_rt.profile-x86_64.a': No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that if you want to do that, you have to build the compiler yourself from scratch:
https://stackoverflow.com/questions/29392702/missing-libclang-rt-san-x86-64-a-file-for-llvm-compiler-rtIt also fails to build with a non-profile build (config sanity check fails):
dannc@DESKTOP-426Q3JG MINGW64 /c/users/dannc/chess/stockfish-master/src
$ make build arch=x86-64-avx512 COMP=clang
Default net: nn-7756374aaed3.nnue
Already available.
Config:
debug: 'no'
sanitize: 'no'
optimize: 'yes'
arch: 'x86-64-avx512'
bits: '64'
kernel: 'MINGW64_NT-10.0-19041'
os: 'Windows_NT'
prefetch: 'yes'
popcnt: 'yes'
pext: 'no'
sse: 'yes'
mmx: 'no'
sse2: 'yes'
ssse3: 'yes'
sse41: 'yes'
avx2: 'no'
avx512: 'no'
vnni256: 'no'
vnni512: 'no'
neon: 'no'
Flags:
CXX: clang++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++17 -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -mtune=native -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto -fuse-ld=lld
LDFLAGS: -latomic -m64 -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++17 -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -mtune=native -fexperimental-new-pass-manager -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto -fuse-ld=lld
Testing config sanity. If this fails, try 'make help' ...
make: *** [Makefile:841: config-sanity] Error 1
From this I conclude that they do not test at all with clang on Windows using msys2