[libcxx-commits] [libcxxabi] b68904d - [libc++abi] NFCI: Minor refactoring of abort_message()

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 25 23:06:29 PDT 2020


On Thu, 25 Jun 2020, Louis Dionne via libcxx-commits wrote:

>
> Author: Louis Dionne
> Date: 2020-06-25T14:48:26-04:00
> New Revision: b68904d954b79e0382bdfa852758adcbd5350748
>
> URL: https://github.com/llvm/llvm-project/commit/b68904d954b79e0382bdfa852758adcbd5350748
> DIFF: https://github.com/llvm/llvm-project/commit/b68904d954b79e0382bdfa852758adcbd5350748.diff
>
> LOG: [libc++abi] NFCI: Minor refactoring of abort_message()
>
> Remove small code duplication and add comments explaining why we do things
> in a given order.

This broke the build when targeting mingw.

Previously, vasprintf() was called only when the formatted buffer was 
going to be used for something, i.e. for 
_LIBCXXABI_USE_CRASHREPORTER_CLIENT or __BIONIC__. Now vasprintf() is 
called unconditionally for any target.

On mingw-w64 (and on linux/glibc as well), vasprintf() is available, but 
only if _GNU_SOURCE was defined when including headers. In MSVC, 
vasprintf() isn't available at all - but I'm not sure if MSVC is 
considered a supported build target for libcxxabi.

So either we need to add the necessary defines to make sure vasprintf() 
really is available in any supported build configuration of libcxxabi, or 
revert parts of the commit, to ensure we only call vasprintf() when 
targeting one of the environments where we know vasprintf() is available 
(or where we know how to make it visible).

// Martin



More information about the libcxx-commits mailing list