macOS 27.2.1 broken development environment

Occasionally I need to build locally a latest and greatest version of the Clang compiler. I was able to do so without any issues on previous system, such as macOS 26.5.2 and 26.6.2. At that time the version of the Clang compiler was 22.1.8.

In October and November of 2026 I gradually upgraded the system to newer versions and currently it is running 'macOS 27.2.1' with 'Command Line Tools for Xcode 27.2'.

Recently I decided to build a newer version of the Clang compiler 23.1.6 and the build failed with some unexpected errors. In order to test my suspicions I tried to build an older version of Clang with the new environment and it also failed with the same errors.

I also tested the Clang 23.1.6 build on an older, intel based, machine with 'macOS 13.7.8' and 'Command Line Tools for Xcode 14.3' and it was successful without any issues.

Bottom line:
Broken development environment on macOS 27.2.1

Below is the output of 'xcrun':
$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

Here is the excerpt of build errors:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:93:5: error: <cstdlib> tried including <stdlib.h> but didn't find libc++'s <stdlib.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case.
93 | # error <cstdlib> tried including <stdlib.h> but didn't find libc++'s <stdlib.h> header.
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:134:9: error: target of using declaration conflicts with declaration already in scope
134 | using ::abs _LIBCPP_USING_IF_EXISTS;
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h:148:6: note: target of using declaration
148 | int abs(int) __pure2;
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:367:1: note: conflicting declaration
367 | using ::abs _LIBCPP_USING_IF_EXISTS;
| ^