This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Windows] Provide vasprintf only for MSVC
AbandonedPublic

Authored by mati865 on May 15 2020, 5:30 AM.

Details

Summary

Mingw-w64 provides this function and it has been causing issues for MSYS2 when building lldb.

Diff Detail

Event Timeline

mati865 created this revision.May 15 2020, 5:30 AM

+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.

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...

mati865 added a comment.EditedMay 15 2020, 11:29 AM

Indeed, I'll see if I can build all LLVM related packages without _GNU_SOURCE. Otherwise I'll guard it with #ifndef _GNU_SOURCE instead.

mati865 updated this revision to Diff 264339.EditedMay 15 2020, 2:10 PM

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.

mati865 abandoned this revision.Jun 23 2020, 10:07 AM