SDL CMake build failed in MSYS 2

Why I can’t build SDL with CMake in MSYS 2? Is this a compiler bug or a bug from SDL2 itself?

The error comes from SDL_systhread.c (see the picture)
Compiler: GCC 10.2.0

If you have a workaround for this, please let me know…