Embedded cling error with latest xcode

Hi to all,
I’m sorry for retrieve this old topic. I’m trying to compile root v6-26 on my new MacBook Pro with OSX 12.5 and Xcode 13.4.1 but at 78% of the compiling process it fails with this error:

[ 78%] Linking CXX shared library …/…/…/lib/libCling.so
While building module ‘Core’:
While building module ‘std’ imported from input_line_1:1:
While building module ‘Darwin’ imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ctype.h:38:
In file included from :1421:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ncurses.h:141:
/opt/local/include/unctrl.h:61:38: error: cannot initialize a variable of type ‘char *’ with an lvalue of type ‘char *(chtype)’ (aka ‘char *(unsigned int)’)
NCURSES_EXPORT(NCURSES_CONST char ) NCURSES_SP_NAME(unctrl) (SCREEN, chtype);
^ ~~~~~~
/opt/local/include/unctrl.h:61:61: error: expected ‘;’ after top level declarator
NCURSES_EXPORT(NCURSES_CONST char ) NCURSES_SP_NAME(unctrl) (SCREEN, chtype);
^
While building module ‘Core’:
While building module ‘std’ imported from input_line_1:1:
In file included from :2:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ctype.h:38:15: fatal error: could not build module ‘Darwin’
#include_next <ctype.h>

input_line_1:1:10: fatal error: could not build module 'std'
#include <new>
~~~~~~~~^
Warning in cling::IncrementalParser::CheckABICompatibility():
 Failed to extract C++ standard library version.
Warning in cling::IncrementalParser::CheckABICompatibility():
 Possible C++ standard library mismatch, compiled with _LIBCPP_ABI_VERSION '1'
 Extraction of runtime standard library version was: ''
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /Users/simone/root-6.26.00-build/etc/cling/Interpreter/RuntimeUniverse.h:27:
In file included from <module-includes>:1:
/Users/simone/root-6.26.00-build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'
#include <string>
~~~~~~~~^
/Users/simone/root-6.26.00-build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module 'Cling_Runtime_Extra'
#include "cling/Interpreter/Visibility.h"
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While building module 'Core':
While building module '_Builtin_intrinsics':
In file included from <module-includes>:2:
In file included from /Users/simone/root-6.26.00-build/etc/cling/lib/clang/9.0.1/include/immintrin.h:18:
In file included from /Users/simone/root-6.26.00-build/etc/cling/lib/clang/9.0.1/include/xmmintrin.h:27:
In file included from /Users/simone/root-6.26.00-build/etc/cling/lib/clang/9.0.1/include/mm_malloc.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/stdlib.h:93:
/Users/simone/root-6.26.00-build/etc/cling/lib/clang/9.0.1/include/stdlib.h:8:15: fatal error: could not build module 'Darwin'
#include_next <stdlib.h>
~~~~~~~~~~~~~^
While building module 'Core':
<<< cling interactive line includer >>>: fatal error: could not build module '_Builtin_intrinsics'
Error: Module '_Builtin_intrinsics' failed to load.
[ 78%] Built target Cling
While building module 'Core':
While building module 'ROOT_Rtypes' imported from /Users/simone/root-6.26.00-build/include/Rtypes.h:23:
In file included from <module-includes>:1:
In file included from /Users/simone/root-6.26.00-build/include/RtypesCore.h:23:
/Users/simone/root-6.26.00-build/include/ROOT/RConfig.hxx:279:13: fatal error: could not build module 'Darwin'
#   include <AvailabilityMacros.h>
   ~~~~~~~~^
While building module 'Core':
While building module 'ROOT_Rtypes' imported from /Users/simone/root-6.26.00-build/include/Rtypes.h:23:
While building module 'ROOT_Config' imported from /Users/simone/root-6.26.00-build/include/RtypesCore.h:25:
In file included from <module-includes>:1:
In file included from /Users/simone/root-6.26.00-build/include/RConfig.h:23:
/Users/simone/root-6.26.00-build/include/ROOT/RConfig.hxx:279:13: fatal error: could not build module 'Darwin'
#   include <AvailabilityMacros.h>
   ~~~~~~~~^
While building module 'Core':
While building module 'ROOT_Foundation_C' imported from /Users/simone/root-6.26.00-build/include/Rtypes.h:29:
In file included from <module-includes>:1:
In file included from /Users/simone/root-6.26.00-build/include/ThreadLocalStorage.h:57:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/stddef.h:45:15: fatal error: could not build module 'Darwin'
#include_next <stddef.h>
~~~~~~~~~~~~~^
While building module 'Core':
While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /Users/simone/root-6.26.00-build/include/Rtypes.h:195:
In file included from <module-includes>:2:
/Users/simone/root-6.26.00-build/include/ROOT/RStringView.hxx:25:10: fatal error: could not build module 'std'
#include <string_view>
~~~~~~~~^
Error: Error loading the default rootcling header files.
make[2]: *** [core/G__Core.cxx] Error 1
make[1]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2

I went through all the messages in this topic but I still not resolve the problem.
Any other idea?
Thank you very much.