clang-12 @12.0.1: error: unknown type name '__sanitizer_XDR'; did you mean '__sanitizer_tm'?
:info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/build/projects/compiler-rt/lib/sanitizer_common && /usr/bin/clang++ -DHAVE_RPC_XDR_H=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/build/projects/compiler-rt/lib/sanitizer_common -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.1.src/compiler-rt/lib/sanitizer_common -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.1.src/llvm/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.1.src/compiler-rt/lib/sanitizer_common/.. -pipe -Os -DNDEBUG -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wall -std=c++14 -Wno-unused-parameter -O3 -DNDEBUG -std=c++14 -arch arm64 -arch x86_64 -arch x86_64h -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -stdlib=libc++ -mmacosx-version-min=10.10 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -fno-builtin -fno-exceptions -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -nostdinc++ -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -DSANITIZER_SUPPORTS_WEAK_HOOKS=0 -MD -MT projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_printf.cpp.o -MF CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_printf.cpp.o.d -o CMakeFiles/RTSanitizerCommonNoHooks.osx.dir/sanitizer_printf.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.1.src/compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.1.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1233:1: error: unknown type name '__sanitizer_XDR'; did you mean '__sanitizer_™'?
Looks like the same error reported against clang-11-bootstrap in #69239. In that ticket, clang-11-bootstrap was declared too old for Sonoma. I guess the same applies to clang-12. Use a newer clang port.