I have a partial fix for these issues.
The first is a group of errors that are due to Newlib v2.5.0 providing a richer Locale support than previous releases (Newlib’s ‘locale.h’), and this is turn results in conflicts for all the definitions contained in LibC++’s source ‘include/support/newlib/xlocale.h’ I have changed:
#if defined(NEWLIB) && (NEWLIB == 2) \
&& defined(NEWLIB_MINOR) && (NEWLIB_MINOR >= 5) \
&& (!defined(__POSIX_VISIBLE) || (__POSIX_VISIBLE < 200809))
I think that this is a reasonably portable resolution, though I will have to examine intermediate versions of Newlib after v2.2.0-20150423 and before v2.5.0 to see when the relevant changes occurred, so the exclusion check may need to be refined.
However, I am not sure what to do about ‘vasprintf’. I tried excluding the function ‘__libcpp_asprintf_l’ if ‘STRICT_ANSI’ is defined, but this had knock-on consequences because this function is used elsewhere in the C++ headers, so it is a more complex issue to resolve.