Hi abhi abhi,
Thank you for posting on the Q&A forum.
It's supported to run Windows executables from WSL and the Windows file systems are mounted under /mnt. Sorry I do not use msys2 but you can see if the gcc.exe can run normally from bash.
https://learn.microsoft.com/en-us/windows/wsl/filesystems
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.