Mingw-w64 provides this function and it has been causing issues for MSYS2 when building lldb.
+1 from me on this, I'm ok with this change. I'm a bit curious as I haven't seen any issues regarding this myself though. I wonder if it something very MSYS2-specific, or is the difference in building with gcc vs clang?
Perhaps you are building with Clang?
I don't remember the message but GCC emits error about incompatible definition and declaration of vasprintf. I can build it without the patch and paste the error if you want.
I took a look now, and I see that the mingw-w64 vasprintf only is visible if _GNU_SOURCE is defined. So apparently something is setting that in your build, but not in mine - and thus this patch would actually break my build...
With _GNU_SOURCE removed I was able to successfully build everything without this diff.
I cannot test it today but I believe this updated diff would have fixed the error.
It's up to you whether this should be considered as user error and unsupported configuration.