pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

import llvm 16.0.1 update.



Module Name:	pkgsrc-wip
Committed By:	nikita <nikita%NetBSD.org@localhost>
Pushed By:	nikita
Date:		Sat Apr 29 12:11:58 2023 +0200
Changeset:	b38171866384a24d2b79130ddb18815bfc0cc15d

Added Files:
	clang-tools-extra/DESCR
	clang-tools-extra/Makefile
	clang-tools-extra/PLIST
	clang-tools-extra/PLIST.Darwin
	clang-tools-extra/distinfo
	clang/DESCR
	clang/Makefile
	clang/Makefile.common
	clang/PLIST
	clang/PLIST.Darwin
	clang/buildlink3.mk
	clang/distinfo
	clang/patches/patch-lib_Basic_Targets_OSTargets.h
	clang/patches/patch-lib_Driver_ToolChain.cpp
	clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp
	clang/patches/patch-lib_Driver_ToolChains_Solaris.h
	clang/patches/patch-lib_Interpreter_IncrementalParser.cpp
	clang/patches/patch-lib_Lex_InitHeaderSearch.cpp
	clang/patches/patch-tools_clang-shlib_CMakeLists.txt
	clang/patches/patch-tools_libclang_CMakeLists.txt
	compiler-rt/DESCR
	compiler-rt/Makefile
	compiler-rt/buildlink3.mk
	compiler-rt/distinfo
	compiler-rt/patches/patch-cmake_config-ix.cmake
	compiler-rt/patches/patch-lib_asan_CMakeLists.txt
	compiler-rt/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cpp
	include-what-you-use/DESCR
	include-what-you-use/Makefile
	include-what-you-use/PLIST
	include-what-you-use/distinfo
	libcxx/DESCR
	libcxx/Makefile
	libcxx/PLIST
	libcxx/buildlink3.mk
	libcxx/distinfo
	libcxx/patches/patch-include_____locale
	libcxx/patches/patch-include_____support_solaris_xlocale.h
	libcxx/patches/patch-src_charconv.cpp
	libcxx/patches/patch-src_filesystem_filesystem__common.h
	libcxx/patches/patch-src_include_to__chars__floating__point.h
	libcxx/patches/patch-src_support_solaris_xlocale.cpp
	libcxxabi/DESCR
	libcxxabi/Makefile
	libcxxabi/PLIST
	libcxxabi/buildlink3.mk
	libcxxabi/distinfo
	libcxxabi/patches/patch-src_CMakeLists.txt
	libcxxabi/patches/patch-src_demangle_Utility.h
	libunwind/DESCR
	libunwind/Makefile
	libunwind/PLIST
	libunwind/buildlink3.mk
	libunwind/distinfo
	libunwind/patches/patch-src_CMakeLists.txt
	lld/DESCR
	lld/Makefile
	lld/PLIST
	lld/buildlink3.mk
	lld/distinfo
	lld/options.mk
	lld/patches/patch-CMakeLists.txt
	lld/patches/patch-ELF_Config.h
	lld/patches/patch-ELF_Options.td
	lldb/DESCR
	lldb/Makefile
	lldb/PLIST
	lldb/PLIST.Darwin
	lldb/PLIST.Linux
	lldb/buildlink3.mk
	lldb/distinfo
	lldb/patches/patch-cmake_modules_LLDBStandalone.cmake
	lldb/patches/patch-source_API_CMakeLists.txt
	lldb/patches/patch-source_Host_netbsd_HostNetBSD.cpp
	lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
	lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
	openmp/DESCR
	openmp/Makefile
	openmp/PLIST
	openmp/buildlink3.mk
	openmp/distinfo
	openmp/patches/patch-runtime_src_kmp__runtime.cpp
	polly/DESCR
	polly/Makefile
	polly/PLIST
	polly/buildlink3.mk
	polly/distinfo
	polly/patches/patch-CMakeLists.txt
	wasi-compiler-rt/DESCR
	wasi-compiler-rt/Makefile
	wasi-compiler-rt/buildlink3.mk
	wasi-libc/DESCR
	wasi-libc/Makefile
	wasi-libc/PLIST
	wasi-libc/buildlink3.mk
	wasi-libc/distinfo
	wasi-libc/patches/patch-Makefile
	wasi-libcxx/DESCR
	wasi-libcxx/Makefile
	wasi-libcxx/PLIST
	wasi-libcxx/buildlink3.mk
	wasi-libcxx/distinfo
	wasi-libcxx/patches/patch-libcxx_include_CMakeLists.txt
	wasi-libcxx/patches/patch-libcxxabi_src_CMakeLists.txt

Log Message:
import llvm 16.0.1 update.

failing packages: lldb, libcxxabi, polly. since libcxx needs libcxxabi
it is failing as well.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b38171866384a24d2b79130ddb18815bfc0cc15d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 clang-tools-extra/DESCR                            |    1 +
 clang-tools-extra/Makefile                         |   32 +
 clang-tools-extra/PLIST                            |  416 ++++++++
 clang-tools-extra/PLIST.Darwin                     |    5 +
 clang-tools-extra/distinfo                         |   11 +
 clang/DESCR                                        |   22 +
 clang/Makefile                                     |   21 +
 clang/Makefile.common                              |  176 ++++
 clang/PLIST                                        | 1021 ++++++++++++++++++++
 clang/PLIST.Darwin                                 |    2 +
 clang/buildlink3.mk                                |   44 +
 clang/distinfo                                     |   16 +
 clang/patches/patch-lib_Basic_Targets_OSTargets.h  |   60 ++
 clang/patches/patch-lib_Driver_ToolChain.cpp       |   16 +
 .../patch-lib_Driver_ToolChains_Solaris.cpp        |  243 +++++
 .../patches/patch-lib_Driver_ToolChains_Solaris.h  |   24 +
 .../patch-lib_Interpreter_IncrementalParser.cpp    |   17 +
 clang/patches/patch-lib_Lex_InitHeaderSearch.cpp   |   15 +
 .../patches/patch-tools_clang-shlib_CMakeLists.txt |   14 +
 clang/patches/patch-tools_libclang_CMakeLists.txt  |   34 +
 compiler-rt/DESCR                                  |   23 +
 compiler-rt/Makefile                               |   52 +
 compiler-rt/buildlink3.mk                          |   14 +
 compiler-rt/distinfo                               |   11 +
 compiler-rt/patches/patch-cmake_config-ix.cmake    |   42 +
 compiler-rt/patches/patch-lib_asan_CMakeLists.txt  |   16 +
 ..._common_sanitizer__platform__limits__netbsd.cpp |   75 ++
 include-what-you-use/DESCR                         |   11 +
 include-what-you-use/Makefile                      |   23 +
 include-what-you-use/PLIST                         |   24 +
 include-what-you-use/distinfo                      |    5 +
 libcxx/DESCR                                       |   11 +
 libcxx/Makefile                                    |   56 ++
 libcxx/PLIST                                       |  796 +++++++++++++++
 libcxx/buildlink3.mk                               |   13 +
 libcxx/distinfo                                    |   17 +
 libcxx/patches/patch-include_____locale            |   15 +
 .../patch-include_____support_solaris_xlocale.h    |   32 +
 libcxx/patches/patch-src_charconv.cpp              |   21 +
 .../patch-src_filesystem_filesystem__common.h      |   28 +
 .../patch-src_include_to__chars__floating__point.h |   60 ++
 .../patches/patch-src_support_solaris_xlocale.cpp  |   18 +
 libcxxabi/DESCR                                    |    7 +
 libcxxabi/Makefile                                 |   52 +
 libcxxabi/PLIST                                    |    7 +
 libcxxabi/buildlink3.mk                            |   15 +
 libcxxabi/distinfo                                 |   13 +
 libcxxabi/patches/patch-src_CMakeLists.txt         |   30 +
 libcxxabi/patches/patch-src_demangle_Utility.h     |   15 +
 libunwind/DESCR                                    |    1 +
 libunwind/Makefile                                 |   39 +
 libunwind/PLIST                                    |   14 +
 libunwind/buildlink3.mk                            |   13 +
 libunwind/distinfo                                 |   12 +
 libunwind/patches/patch-src_CMakeLists.txt         |   29 +
 lld/DESCR                                          |   11 +
 lld/Makefile                                       |   34 +
 lld/PLIST                                          |   31 +
 lld/buildlink3.mk                                  |   14 +
 lld/distinfo                                       |   11 +
 lld/options.mk                                     |   20 +
 lld/patches/patch-CMakeLists.txt                   |   16 +
 lld/patches/patch-ELF_Config.h                     |   14 +
 lld/patches/patch-ELF_Options.td                   |   16 +
 lldb/DESCR                                         |    1 +
 lldb/Makefile                                      |   97 ++
 lldb/PLIST                                         |  543 +++++++++++
 lldb/PLIST.Darwin                                  |   12 +
 lldb/PLIST.Linux                                   |    3 +
 lldb/buildlink3.mk                                 |   18 +
 lldb/distinfo                                      |   13 +
 .../patch-cmake_modules_LLDBStandalone.cmake       |   12 +
 lldb/patches/patch-source_API_CMakeLists.txt       |   17 +
 .../patch-source_Host_netbsd_HostNetBSD.cpp        |   15 +
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp |   54 ++
 ...ce_Plugins_Process_NetBSD_NativeProcessNetBSD.h |   14 +
 openmp/DESCR                                       |    5 +
 openmp/Makefile                                    |   32 +
 openmp/PLIST                                       |    7 +
 openmp/buildlink3.mk                               |   13 +
 openmp/distinfo                                    |    9 +
 openmp/patches/patch-runtime_src_kmp__runtime.cpp  |   15 +
 polly/DESCR                                        |   12 +
 polly/Makefile                                     |   31 +
 polly/PLIST                                        |  120 +++
 polly/buildlink3.mk                                |   14 +
 polly/distinfo                                     |    9 +
 polly/patches/patch-CMakeLists.txt                 |   17 +
 wasi-compiler-rt/DESCR                             |    1 +
 wasi-compiler-rt/Makefile                          |   84 ++
 wasi-compiler-rt/buildlink3.mk                     |   17 +
 wasi-libc/DESCR                                    |    9 +
 wasi-libc/Makefile                                 |   58 ++
 wasi-libc/PLIST                                    |  219 +++++
 wasi-libc/buildlink3.mk                            |   15 +
 wasi-libc/distinfo                                 |    9 +
 wasi-libc/patches/patch-Makefile                   |   19 +
 wasi-libcxx/DESCR                                  |    1 +
 wasi-libcxx/Makefile                               |  182 ++++
 wasi-libcxx/PLIST                                  |  878 +++++++++++++++++
 wasi-libcxx/buildlink3.mk                          |   15 +
 wasi-libcxx/distinfo                               |   13 +
 .../patches/patch-libcxx_include_CMakeLists.txt    |   19 +
 .../patches/patch-libcxxabi_src_CMakeLists.txt     |   14 +
 104 files changed, 6603 insertions(+)

diffs:
diff --git a/clang-tools-extra/DESCR b/clang-tools-extra/DESCR
new file mode 100644
index 0000000000..094dbcf1f2
--- /dev/null
+++ b/clang-tools-extra/DESCR
@@ -0,0 +1 @@
+Extra tools built using Clang's tooling APIs.
diff --git a/clang-tools-extra/Makefile b/clang-tools-extra/Makefile
new file mode 100644
index 0000000000..c98f1ad95c
--- /dev/null
+++ b/clang-tools-extra/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile,v 1.24 2023/04/19 08:10:34 adam Exp $
+
+.include "../../wip/clang/Makefile.common"
+
+PKGNAME=	${DISTNAME:S/clang/clang-tools-extra/:S/.src//}
+
+COMMENT=	Extra Clang tools
+
+DEPENDS+=	clang>=${LLVM_VERSION}:../../wip/clang
+
+CLANG_TOOLS_EXTRA=	clang-tools-extra-${LLVM_VERSION}.src
+EXTRA_DIST+=		${CLANG_TOOLS_EXTRA}${EXTRACT_SUFX}
+SITES.${CLANG_TOOLS_EXTRA}${EXTRACT_SUFX}= \
+	${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+
+BUILD_TARGET=	clang-change-namespace clang-apply-replacements clang-doc
+BUILD_TARGET+=	clang-include-fixer clang-move clang-query clang-reorder-fields
+BUILD_TARGET+=	clang-tidy clangd modularize pp-trace tool-template
+INSTALL_DIRS=	build/tools/extra
+
+REPLACE_PYTHON+=	tools/extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+REPLACE_PYTHON+=	tools/extra/clang-tidy/tool/clang-tidy-diff.py
+REPLACE_PYTHON+=	tools/extra/clang-tidy/tool/run-clang-tidy.py
+
+BUILDLINK_TRANSFORM.SunOS+=	rm:-Wl,-Bsymbolic-functions
+
+.PHONY: inject-clang-tools
+post-extract: inject-clang-tools
+inject-clang-tools:
+	${MV} ${WRKDIR}/${DISTNAME:S/clang/clang-tools-extra/} ${WRKSRC}/tools/extra
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/clang-tools-extra/PLIST b/clang-tools-extra/PLIST
new file mode 100644
index 0000000000..1b0d5c5bae
--- /dev/null
+++ b/clang-tools-extra/PLIST
@@ -0,0 +1,416 @@
+@comment $NetBSD: PLIST,v 1.7 2022/11/14 18:44:05 adam Exp $
+bin/clang-apply-replacements
+bin/clang-change-namespace
+bin/clang-doc
+bin/clang-include-cleaner
+bin/clang-include-fixer
+bin/clang-move
+bin/clang-pseudo
+bin/clang-query
+bin/clang-reorder-fields
+bin/clang-tidy
+bin/clangd
+bin/find-all-symbols
+bin/modularize
+bin/pp-trace
+bin/run-clang-tidy
+include/clang-tidy/ClangTidy.h
+include/clang-tidy/ClangTidyCheck.h
+include/clang-tidy/ClangTidyDiagnosticConsumer.h
+include/clang-tidy/ClangTidyForceLinker.h
+include/clang-tidy/ClangTidyModule.h
+include/clang-tidy/ClangTidyModuleRegistry.h
+include/clang-tidy/ClangTidyOptions.h
+include/clang-tidy/ClangTidyProfiling.h
+include/clang-tidy/ExpandModularHeadersPPCallbacks.h
+include/clang-tidy/GlobList.h
+include/clang-tidy/NoLintDirectiveHandler.h
+include/clang-tidy/abseil/AbseilMatcher.h
+include/clang-tidy/abseil/CleanupCtadCheck.h
+include/clang-tidy/abseil/DurationAdditionCheck.h
+include/clang-tidy/abseil/DurationComparisonCheck.h
+include/clang-tidy/abseil/DurationConversionCastCheck.h
+include/clang-tidy/abseil/DurationDivisionCheck.h
+include/clang-tidy/abseil/DurationFactoryFloatCheck.h
+include/clang-tidy/abseil/DurationFactoryScaleCheck.h
+include/clang-tidy/abseil/DurationRewriter.h
+include/clang-tidy/abseil/DurationSubtractionCheck.h
+include/clang-tidy/abseil/DurationUnnecessaryConversionCheck.h
+include/clang-tidy/abseil/FasterStrsplitDelimiterCheck.h
+include/clang-tidy/abseil/NoInternalDependenciesCheck.h
+include/clang-tidy/abseil/NoNamespaceCheck.h
+include/clang-tidy/abseil/RedundantStrcatCallsCheck.h
+include/clang-tidy/abseil/StrCatAppendCheck.h
+include/clang-tidy/abseil/StringFindStartswithCheck.h
+include/clang-tidy/abseil/StringFindStrContainsCheck.h
+include/clang-tidy/abseil/TimeComparisonCheck.h
+include/clang-tidy/abseil/TimeSubtractionCheck.h
+include/clang-tidy/abseil/UpgradeDurationConversionsCheck.h
+include/clang-tidy/altera/IdDependentBackwardBranchCheck.h
+include/clang-tidy/altera/KernelNameRestrictionCheck.h
+include/clang-tidy/altera/SingleWorkItemBarrierCheck.h
+include/clang-tidy/altera/StructPackAlignCheck.h
+include/clang-tidy/altera/UnrollLoopsCheck.h
+include/clang-tidy/android/CloexecAccept4Check.h
+include/clang-tidy/android/CloexecAcceptCheck.h
+include/clang-tidy/android/CloexecCheck.h
+include/clang-tidy/android/CloexecCreatCheck.h
+include/clang-tidy/android/CloexecDupCheck.h
+include/clang-tidy/android/CloexecEpollCreate1Check.h
+include/clang-tidy/android/CloexecEpollCreateCheck.h
+include/clang-tidy/android/CloexecFopenCheck.h
+include/clang-tidy/android/CloexecInotifyInit1Check.h
+include/clang-tidy/android/CloexecInotifyInitCheck.h
+include/clang-tidy/android/CloexecMemfdCreateCheck.h
+include/clang-tidy/android/CloexecOpenCheck.h
+include/clang-tidy/android/CloexecPipe2Check.h
+include/clang-tidy/android/CloexecPipeCheck.h
+include/clang-tidy/android/CloexecSocketCheck.h
+include/clang-tidy/android/ComparisonInTempFailureRetryCheck.h
+include/clang-tidy/boost/UseToStringCheck.h
+include/clang-tidy/bugprone/ArgumentCommentCheck.h
+include/clang-tidy/bugprone/AssertSideEffectCheck.h
+include/clang-tidy/bugprone/AssignmentInIfConditionCheck.h
+include/clang-tidy/bugprone/BadSignalToKillThreadCheck.h
+include/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.h
+include/clang-tidy/bugprone/BranchCloneCheck.h
+include/clang-tidy/bugprone/CopyConstructorInitCheck.h
+include/clang-tidy/bugprone/DanglingHandleCheck.h
+include/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
+include/clang-tidy/bugprone/EasilySwappableParametersCheck.h
+include/clang-tidy/bugprone/ExceptionEscapeCheck.h
+include/clang-tidy/bugprone/FoldInitTypeCheck.h
+include/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.h
+include/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.h
+include/clang-tidy/bugprone/ImplicitWideningOfMultiplicationResultCheck.h
+include/clang-tidy/bugprone/InaccurateEraseCheck.h
+include/clang-tidy/bugprone/IncorrectRoundingsCheck.h
+include/clang-tidy/bugprone/InfiniteLoopCheck.h
+include/clang-tidy/bugprone/IntegerDivisionCheck.h
+include/clang-tidy/bugprone/LambdaFunctionNameCheck.h
+include/clang-tidy/bugprone/MacroParenthesesCheck.h
+include/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.h
+include/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
+include/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.h
+include/clang-tidy/bugprone/MisplacedWideningCastCheck.h
+include/clang-tidy/bugprone/MoveForwardingReferenceCheck.h
+include/clang-tidy/bugprone/MultipleStatementMacroCheck.h
+include/clang-tidy/bugprone/NoEscapeCheck.h
+include/clang-tidy/bugprone/NotNullTerminatedResultCheck.h
+include/clang-tidy/bugprone/ParentVirtualCallCheck.h
+include/clang-tidy/bugprone/PosixReturnCheck.h
+include/clang-tidy/bugprone/RedundantBranchConditionCheck.h
+include/clang-tidy/bugprone/ReservedIdentifierCheck.h
+include/clang-tidy/bugprone/SharedPtrArrayMismatchCheck.h
+include/clang-tidy/bugprone/SignalHandlerCheck.h
+include/clang-tidy/bugprone/SignedCharMisuseCheck.h
+include/clang-tidy/bugprone/SizeofContainerCheck.h
+include/clang-tidy/bugprone/SizeofExpressionCheck.h
+include/clang-tidy/bugprone/SmartPtrArrayMismatchCheck.h
+include/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
+include/clang-tidy/bugprone/StandaloneEmptyCheck.h
+include/clang-tidy/bugprone/StringConstructorCheck.h
+include/clang-tidy/bugprone/StringIntegerAssignmentCheck.h
+include/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.h
+include/clang-tidy/bugprone/StringviewNullptrCheck.h
+include/clang-tidy/bugprone/SuspiciousEnumUsageCheck.h
+include/clang-tidy/bugprone/SuspiciousIncludeCheck.h
+include/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.h
+include/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.h
+include/clang-tidy/bugprone/SuspiciousMissingCommaCheck.h
+include/clang-tidy/bugprone/SuspiciousReallocUsageCheck.h
+include/clang-tidy/bugprone/SuspiciousSemicolonCheck.h
+include/clang-tidy/bugprone/SuspiciousStringCompareCheck.h
+include/clang-tidy/bugprone/SwappedArgumentsCheck.h
+include/clang-tidy/bugprone/TerminatingContinueCheck.h
+include/clang-tidy/bugprone/ThrowKeywordMissingCheck.h
+include/clang-tidy/bugprone/TooSmallLoopVariableCheck.h
+include/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h
+include/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.h
+include/clang-tidy/bugprone/UndelegatedConstructorCheck.h
+include/clang-tidy/bugprone/UnhandledExceptionAtNewCheck.h
+include/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.h
+include/clang-tidy/bugprone/UnusedRaiiCheck.h
+include/clang-tidy/bugprone/UnusedReturnValueCheck.h
+include/clang-tidy/bugprone/UseAfterMoveCheck.h
+include/clang-tidy/bugprone/VirtualNearMissCheck.h
+include/clang-tidy/cert/CommandProcessorCheck.h
+include/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h
+include/clang-tidy/cert/DontModifyStdNamespaceCheck.h
+include/clang-tidy/cert/FloatLoopCounter.h
+include/clang-tidy/cert/LimitedRandomnessCheck.h
+include/clang-tidy/cert/MutatingCopyCheck.h
+include/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.h
+include/clang-tidy/cert/PostfixOperatorCheck.h
+include/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.h
+include/clang-tidy/cert/SetLongJmpCheck.h
+include/clang-tidy/cert/StaticObjectExceptionCheck.h
+include/clang-tidy/cert/StrToNumCheck.h
+include/clang-tidy/cert/ThrownExceptionTypeCheck.h
+include/clang-tidy/cert/VariadicFunctionDefCheck.h
+include/clang-tidy/concurrency/MtUnsafeCheck.h
+include/clang-tidy/concurrency/ThreadCanceltypeAsynchronousCheck.h
+include/clang-tidy/cppcoreguidelines/AvoidConstOrRefDataMembersCheck.h
+include/clang-tidy/cppcoreguidelines/AvoidDoWhileCheck.h
+include/clang-tidy/cppcoreguidelines/AvoidGotoCheck.h
+include/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.h
+include/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.h
+include/clang-tidy/cppcoreguidelines/InitVariablesCheck.h
+include/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.h
+include/clang-tidy/cppcoreguidelines/MacroUsageCheck.h
+include/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h
+include/clang-tidy/cppcoreguidelines/NoMallocCheck.h
+include/clang-tidy/cppcoreguidelines/OwningMemoryCheck.h
+include/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.h
+include/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
+include/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h
+include/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
+include/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h
+include/clang-tidy/cppcoreguidelines/SlicingCheck.h
+include/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
+include/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.h
+include/clang-tidy/darwin/AvoidSpinlockCheck.h
+include/clang-tidy/darwin/DispatchOnceNonstaticCheck.h
+include/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
+include/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
+include/clang-tidy/fuchsia/MultipleInheritanceCheck.h
+include/clang-tidy/fuchsia/OverloadedOperatorCheck.h
+include/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h
+include/clang-tidy/fuchsia/TrailingReturnCheck.h
+include/clang-tidy/fuchsia/VirtualInheritanceCheck.h
+include/clang-tidy/google/AvoidCStyleCastsCheck.h
+include/clang-tidy/google/AvoidNSObjectNewCheck.h
+include/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h
+include/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.h
+include/clang-tidy/google/DefaultArgumentsCheck.h
+include/clang-tidy/google/ExplicitConstructorCheck.h
+include/clang-tidy/google/ExplicitMakePairCheck.h
+include/clang-tidy/google/FunctionNamingCheck.h
+include/clang-tidy/google/GlobalNamesInHeadersCheck.h
+include/clang-tidy/google/GlobalVariableDeclarationCheck.h
+include/clang-tidy/google/IntegerTypesCheck.h
+include/clang-tidy/google/OverloadedUnaryAndCheck.h
+include/clang-tidy/google/TodoCommentCheck.h
+include/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
+include/clang-tidy/google/UpgradeGoogletestCaseCheck.h
+include/clang-tidy/google/UsingNamespaceDirectiveCheck.h
+include/clang-tidy/hicpp/ExceptionBaseclassCheck.h
+include/clang-tidy/hicpp/MultiwayPathsCoveredCheck.h
+include/clang-tidy/hicpp/NoAssemblerCheck.h
+include/clang-tidy/hicpp/SignedBitwiseCheck.h
+include/clang-tidy/linuxkernel/MustCheckErrsCheck.h
+include/clang-tidy/llvm/HeaderGuardCheck.h
+include/clang-tidy/llvm/IncludeOrderCheck.h
+include/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.h
+include/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.h
+include/clang-tidy/llvm/TwineLocalCheck.h
+include/clang-tidy/llvmlibc/CalleeNamespaceCheck.h
+include/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.h
+include/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.h
+include/clang-tidy/misc/ConfusableIdentifierCheck.h
+include/clang-tidy/misc/ConstCorrectnessCheck.h
+include/clang-tidy/misc/DefinitionsInHeadersCheck.h
+include/clang-tidy/misc/MisleadingBidirectional.h
+include/clang-tidy/misc/MisleadingIdentifier.h
+include/clang-tidy/misc/MisplacedConstCheck.h
+include/clang-tidy/misc/NewDeleteOverloadsCheck.h
+include/clang-tidy/misc/NoRecursionCheck.h
+include/clang-tidy/misc/NonCopyableObjects.h
+include/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h
+include/clang-tidy/misc/RedundantExpressionCheck.h
+include/clang-tidy/misc/StaticAssertCheck.h
+include/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
+include/clang-tidy/misc/UnconventionalAssignOperatorCheck.h
+include/clang-tidy/misc/UniqueptrResetReleaseCheck.h
+include/clang-tidy/misc/UnusedAliasDeclsCheck.h
+include/clang-tidy/misc/UnusedParametersCheck.h
+include/clang-tidy/misc/UnusedUsingDeclsCheck.h
+include/clang-tidy/misc/UseAnonymousNamespaceCheck.h
+include/clang-tidy/modernize/AvoidBindCheck.h
+include/clang-tidy/modernize/AvoidCArraysCheck.h
+include/clang-tidy/modernize/ConcatNestedNamespacesCheck.h
+include/clang-tidy/modernize/DeprecatedHeadersCheck.h
+include/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h
+include/clang-tidy/modernize/IntegralLiteralExpressionMatcher.h
+include/clang-tidy/modernize/LoopConvertCheck.h
+include/clang-tidy/modernize/LoopConvertUtils.h
+include/clang-tidy/modernize/MacroToEnumCheck.h
+include/clang-tidy/modernize/MakeSharedCheck.h
+include/clang-tidy/modernize/MakeSmartPtrCheck.h
+include/clang-tidy/modernize/MakeUniqueCheck.h
+include/clang-tidy/modernize/PassByValueCheck.h
+include/clang-tidy/modernize/RawStringLiteralCheck.h
+include/clang-tidy/modernize/RedundantVoidArgCheck.h
+include/clang-tidy/modernize/ReplaceAutoPtrCheck.h
+include/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h
+include/clang-tidy/modernize/ReplaceRandomShuffleCheck.h
+include/clang-tidy/modernize/ReturnBracedInitListCheck.h
+include/clang-tidy/modernize/ShrinkToFitCheck.h
+include/clang-tidy/modernize/UnaryStaticAssertCheck.h
+include/clang-tidy/modernize/UseAutoCheck.h
+include/clang-tidy/modernize/UseBoolLiteralsCheck.h
+include/clang-tidy/modernize/UseDefaultMemberInitCheck.h
+include/clang-tidy/modernize/UseEmplaceCheck.h
+include/clang-tidy/modernize/UseEqualsDefaultCheck.h
+include/clang-tidy/modernize/UseEqualsDeleteCheck.h
+include/clang-tidy/modernize/UseNodiscardCheck.h
+include/clang-tidy/modernize/UseNoexceptCheck.h
+include/clang-tidy/modernize/UseNullptrCheck.h
+include/clang-tidy/modernize/UseOverrideCheck.h
+include/clang-tidy/modernize/UseTrailingReturnTypeCheck.h
+include/clang-tidy/modernize/UseTransparentFunctorsCheck.h
+include/clang-tidy/modernize/UseUncaughtExceptionsCheck.h
+include/clang-tidy/modernize/UseUsingCheck.h
+include/clang-tidy/mpi/BufferDerefCheck.h
+include/clang-tidy/mpi/TypeMismatchCheck.h
+include/clang-tidy/objc/AssertEquals.h
+include/clang-tidy/objc/AvoidNSErrorInitCheck.h
+include/clang-tidy/objc/DeallocInCategoryCheck.h
+include/clang-tidy/objc/ForbiddenSubclassingCheck.h
+include/clang-tidy/objc/MissingHashCheck.h
+include/clang-tidy/objc/NSDateFormatterCheck.h
+include/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.h
+include/clang-tidy/objc/PropertyDeclarationCheck.h
+include/clang-tidy/objc/SuperSelfCheck.h
+include/clang-tidy/openmp/ExceptionEscapeCheck.h
+include/clang-tidy/openmp/UseDefaultNoneCheck.h
+include/clang-tidy/performance/FasterStringFindCheck.h
+include/clang-tidy/performance/ForRangeCopyCheck.h
+include/clang-tidy/performance/ImplicitConversionInLoopCheck.h
+include/clang-tidy/performance/InefficientAlgorithmCheck.h
+include/clang-tidy/performance/InefficientStringConcatenationCheck.h
+include/clang-tidy/performance/InefficientVectorOperationCheck.h
+include/clang-tidy/performance/MoveConstArgCheck.h
+include/clang-tidy/performance/MoveConstructorInitCheck.h
+include/clang-tidy/performance/NoAutomaticMoveCheck.h
+include/clang-tidy/performance/NoIntToPtrCheck.h
+include/clang-tidy/performance/NoexceptMoveConstructorCheck.h
+include/clang-tidy/performance/TriviallyDestructibleCheck.h
+include/clang-tidy/performance/TypePromotionInMathFnCheck.h
+include/clang-tidy/performance/UnnecessaryCopyInitialization.h
+include/clang-tidy/performance/UnnecessaryValueParamCheck.h
+@pkgdir include/clang-tidy/plugin
+include/clang-tidy/portability/RestrictSystemIncludesCheck.h
+include/clang-tidy/portability/SIMDIntrinsicsCheck.h
+include/clang-tidy/portability/StdAllocatorConstCheck.h
+include/clang-tidy/readability/AvoidConstParamsInDecls.h
+include/clang-tidy/readability/BracesAroundStatementsCheck.h
+include/clang-tidy/readability/ConstReturnTypeCheck.h
+include/clang-tidy/readability/ContainerContainsCheck.h
+include/clang-tidy/readability/ContainerDataPointerCheck.h
+include/clang-tidy/readability/ContainerSizeEmptyCheck.h
+include/clang-tidy/readability/ConvertMemberFunctionsToStatic.h
+include/clang-tidy/readability/DeleteNullPointerCheck.h
+include/clang-tidy/readability/DuplicateIncludeCheck.h
+include/clang-tidy/readability/ElseAfterReturnCheck.h
+include/clang-tidy/readability/FunctionCognitiveComplexityCheck.h
+include/clang-tidy/readability/FunctionSizeCheck.h
+include/clang-tidy/readability/IdentifierLengthCheck.h
+include/clang-tidy/readability/IdentifierNamingCheck.h
+include/clang-tidy/readability/ImplicitBoolConversionCheck.h
+include/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.h
+include/clang-tidy/readability/IsolateDeclarationCheck.h
+include/clang-tidy/readability/MagicNumbersCheck.h
+include/clang-tidy/readability/MakeMemberFunctionConstCheck.h
+include/clang-tidy/readability/MisleadingIndentationCheck.h
+include/clang-tidy/readability/MisplacedArrayIndexCheck.h
+include/clang-tidy/readability/NamedParameterCheck.h
+include/clang-tidy/readability/NamespaceCommentCheck.h
+include/clang-tidy/readability/NonConstParameterCheck.h
+include/clang-tidy/readability/QualifiedAutoCheck.h
+include/clang-tidy/readability/RedundantAccessSpecifiersCheck.h
+include/clang-tidy/readability/RedundantControlFlowCheck.h
+include/clang-tidy/readability/RedundantDeclarationCheck.h
+include/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
+include/clang-tidy/readability/RedundantMemberInitCheck.h
+include/clang-tidy/readability/RedundantPreprocessorCheck.h
+include/clang-tidy/readability/RedundantSmartptrGetCheck.h
+include/clang-tidy/readability/RedundantStringCStrCheck.h
+include/clang-tidy/readability/RedundantStringInitCheck.h
+include/clang-tidy/readability/SimplifyBooleanExprCheck.h
+include/clang-tidy/readability/SimplifySubscriptExprCheck.h
+include/clang-tidy/readability/StaticAccessedThroughInstanceCheck.h
+include/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.h
+include/clang-tidy/readability/StringCompareCheck.h
+include/clang-tidy/readability/SuspiciousCallArgumentCheck.h
+include/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h
+include/clang-tidy/readability/UppercaseLiteralSuffixCheck.h
+include/clang-tidy/readability/UseAnyOfAllOfCheck.h
+include/clang-tidy/tool/ClangTidyMain.h
+include/clang-tidy/utils/ASTUtils.h
+include/clang-tidy/utils/Aliasing.h
+include/clang-tidy/utils/DeclRefExprUtils.h
+include/clang-tidy/utils/ExceptionAnalyzer.h
+include/clang-tidy/utils/ExprSequence.h
+include/clang-tidy/utils/FileExtensionsUtils.h
+include/clang-tidy/utils/FixItHintUtils.h
+include/clang-tidy/utils/HeaderGuard.h
+include/clang-tidy/utils/IncludeInserter.h
+include/clang-tidy/utils/IncludeSorter.h
+include/clang-tidy/utils/LexerUtils.h
+include/clang-tidy/utils/Matchers.h
+include/clang-tidy/utils/NamespaceAliaser.h
+include/clang-tidy/utils/OptionsUtils.h
+include/clang-tidy/utils/RenamerClangTidyCheck.h
+include/clang-tidy/utils/TransformerClangTidyCheck.h
+include/clang-tidy/utils/TypeTraits.h
+include/clang-tidy/utils/UsingInserter.h
+include/clang-tidy/zircon/TemporaryObjectsCheck.h
+lib/libclangApplyReplacements.a
+lib/libclangChangeNamespace.a
+lib/libclangDaemon.a
+lib/libclangDaemonTweaks.a
+lib/libclangDoc.a
+lib/libclangIncludeCleaner.a
+lib/libclangIncludeFixer.a
+lib/libclangIncludeFixerPlugin.a
+lib/libclangMove.a
+lib/libclangPseudo.a
+lib/libclangPseudoCLI.a
+lib/libclangPseudoCXX.a
+lib/libclangPseudoGrammar.a
+lib/libclangQuery.a
+lib/libclangReorderFields.a
+lib/libclangTidy.a
+lib/libclangTidyAbseilModule.a
+lib/libclangTidyAlteraModule.a
+lib/libclangTidyAndroidModule.a
+lib/libclangTidyBoostModule.a
+lib/libclangTidyBugproneModule.a
+lib/libclangTidyCERTModule.a
+lib/libclangTidyConcurrencyModule.a
+lib/libclangTidyCppCoreGuidelinesModule.a
+lib/libclangTidyDarwinModule.a
+lib/libclangTidyFuchsiaModule.a
+lib/libclangTidyGoogleModule.a
+lib/libclangTidyHICPPModule.a
+lib/libclangTidyLLVMLibcModule.a
+lib/libclangTidyLLVMModule.a
+lib/libclangTidyLinuxKernelModule.a
+lib/libclangTidyMPIModule.a
+lib/libclangTidyMain.a
+lib/libclangTidyMiscModule.a
+lib/libclangTidyModernizeModule.a
+lib/libclangTidyObjCModule.a
+lib/libclangTidyOpenMPModule.a
+lib/libclangTidyPerformanceModule.a
+lib/libclangTidyPlugin.a
+lib/libclangTidyPortabilityModule.a
+lib/libclangTidyReadabilityModule.a
+lib/libclangTidyUtils.a
+lib/libclangTidyZirconModule.a
+lib/libclangdRemoteIndex.a
+lib/libclangdSupport.a
+lib/libfindAllSymbols.a
+share/clang/clang-doc-default-stylesheet.css
+share/clang/clang-include-fixer.el
+share/clang/clang-include-fixer.py
+share/clang/clang-tidy-diff.py
+share/clang/index.js
+share/clang/run-find-all-symbols.py
diff --git a/clang-tools-extra/PLIST.Darwin b/clang-tools-extra/PLIST.Darwin
new file mode 100644
index 0000000000..1a7cc04a5e
--- /dev/null
+++ b/clang-tools-extra/PLIST.Darwin
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST.Darwin,v 1.1 2019/06/02 08:41:18 adam Exp $
+bin/clangd-xpc-test-client
+lib/libClangdXPCLib.so
+lib/libclangdXpcJsonConversions.a
+lib/libclangdXpcTransport.a
diff --git a/clang-tools-extra/distinfo b/clang-tools-extra/distinfo
new file mode 100644
index 0000000000..f52ebc8847
--- /dev/null
+++ b/clang-tools-extra/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.17 2023/01/12 19:32:53 adam Exp $
+
+BLAKE2s (clang-16.0.1.src.tar.xz) = 3517e431d8fd2f85264397e3f32b753bde963d153fd0bbc3d2598000397ceef4
+SHA512 (clang-16.0.1.src.tar.xz) = c7ef4c386471850f30e194d0a8afe95fdd366c9182b1cdd7653342dcbf72a2b90970c0c4cc900314a26ba131163adec234eec00816207266fbe9c2259d01b61a
+Size (clang-16.0.1.src.tar.xz) = 20355152 bytes
+BLAKE2s (clang-tools-extra-16.0.1.src.tar.xz) = 226ba582ef089eef181badb46e3ef1d1e73853dd5a6e55803416e797d6257eb6
+SHA512 (clang-tools-extra-16.0.1.src.tar.xz) = eb3a5656526db559fa331e4020305b6070a33e9c4e7a082f0ebe2b307ac43d542c989585e99c660fc749041774ff80dbad089678456318b40415e340654424c8
+Size (clang-tools-extra-16.0.1.src.tar.xz) = 3152108 bytes
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
diff --git a/clang/DESCR b/clang/DESCR
new file mode 100644
index 0000000000..f00fcdbf80
--- /dev/null
+++ b/clang/DESCR
@@ -0,0 +1,22 @@
+Low Level Virtual Machine (LLVM) is:
+
+A compilation strategy designed to enable effective program optimization across
+the entire lifetime of a program. LLVM supports effective optimization at
+compile time, link-time (particularly interprocedural), run-time and offline
+(i.e., after software is installed), while remaining transparent to developers
+and maintaining compatibility with existing build scripts.
+
+A virtual instruction set - LLVM is a low-level object code representation that
+uses simple RISC-like instructions, but provides rich, language-independent,
+type information and dataflow (SSA) information about operands. This combination
+enables sophisticated transformations on object code, while remaining
+light-weight enough to be attached to the executable. This combination is key to
+allowing link-time, run-time, and offline transformations.
+
+A compiler infrastructure - LLVM is also a collection of source code that
+implements the language and compilation strategy. The primary components of the
+LLVM infrastructure are the C & C++ front-end, a link-time optimization
+framework with a growing set of global and interprocedural analyses and
+transformations, static back-ends for the X86, X86-64, PowerPC 32/64, ARM,
+Thumb, IA-64 and SPARC architectures, a back-end which emits portable C
+code, and a Just-In-Time compiler for X86, X86-64, PowerPC 32/64 processors.
diff --git a/clang/Makefile b/clang/Makefile
new file mode 100644
index 0000000000..1ff633fb23
--- /dev/null
+++ b/clang/Makefile
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.80 2023/04/19 08:08:27 adam Exp $
+
+.include "Makefile.common"
+
+PKGNAME=	${DISTNAME:S/.src//}
+
+USE_TOOLS+=	perl:run
+
+PLIST_VARS+=	RISCV
+.if ${PKG_BUILD_OPTIONS.llvm:Mllvm-target-riscv}
+PLIST.RISCV=	yes
+.endif
+
+PLIST_VARS+=	ARM
+.if	${PKG_BUILD_OPTIONS.llvm:Mllvm-target-arm} ||	\
+	${PKG_BUILD_OPTIONS.llvm:Mllvm-target-aarch64}
+PLIST.ARM=	yes
+.endif
+
+.include "../../mk/atomic64.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/clang/Makefile.common b/clang/Makefile.common
new file mode 100644
index 0000000000..60c389ee17
--- /dev/null
+++ b/clang/Makefile.common
@@ -0,0 +1,176 @@
+# $NetBSD: Makefile.common,v 1.54 2023/01/25 16:45:40 wiz Exp $
+# used by lang/clang/Makefile
+# used by lang/clang-tools-extra/Makefile
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	clang-${LLVM_VERSION}.src
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://clang.llvm.org/
+COMMENT=	C language family frontend for LLVM
+LICENSE=	apache-2.0
+
+CONFIGURE_DIRS=		build
+CMAKE_ARG_PATH=		${WRKSRC}
+
+USE_LANGUAGES=		c c++14
+USE_CMAKE=		yes
+GCC_REQD+=		7
+
+CMAKE_ARGS+=	-DLLVM_CONFIG=${LLVM_CONFIG_PATH:Q}
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${CC:Q}
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${CXX:Q}
+
+.include "../../mk/compiler.mk"
+
+CMAKE_ARGS.Darwin+=	-DCMAKE_LIBTOOL=/usr/bin/libtool
+.if defined(OSX_SDK_PATH)
+CMAKE_ARGS.Darwin+=	-DDEFAULT_SYSROOT=${OSX_SDK_PATH:Q}
+.endif
+
+# NetBSD < 10 did not provide ENOTRECOVERABLE
+# https://bugs.llvm.org/show_bug.cgi?id=52587
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099949
+CXXFLAGS+=	-D_GLIBCXX_HAVE_ENOTRECOVERABLE=1
+CXXFLAGS+=	-DENOTRECOVERABLE=98
+.endif
+
+REPLACE_PERL+=		test/make_test_dirs.pl
+REPLACE_PERL+=		tools/scan-build/bin/scan-build
+REPLACE_PERL+=		tools/scan-build/libexec/c++-analyzer
+REPLACE_PERL+=		tools/scan-build/libexec/ccc-analyzer
+REPLACE_PERL+=		utils/TestUtils/pch-test.pl
+REPLACE_PERL+=		utils/analyzer/reducer.pl
+REPLACE_PERL+=		utils/analyzer/update_plist_test.pl
+REPLACE_PERL+=		www/demo/index.cgi
+
+REPLACE_PYTHON+=	bindings/python/examples/cindex/cindex-dump.py
+REPLACE_PYTHON+=	bindings/python/examples/cindex/cindex-includes.py
+REPLACE_PYTHON+=	docs/tools/dump_ast_matchers.py
+REPLACE_PYTHON+=	docs/tools/dump_format_style.py
+REPLACE_PYTHON+=	docs/tools/generate_formatted_state.py
+REPLACE_PYTHON+=	lib/Tooling/DumpTool/generate_cxx_src_locs.py
+REPLACE_PYTHON+=	test/AST/gen_ast_dump_json_test.py
+REPLACE_PYTHON+=	test/Analysis/check-analyzer-fixit.py
+REPLACE_PYTHON+=	test/Driver/check-time-trace-sections.py
+REPLACE_PYTHON+=	tools/clang-format/clang-format-diff.py
+REPLACE_PYTHON+=	tools/clang-format/git-clang-format
+REPLACE_PYTHON+=	tools/scan-build-py/bin/analyze-build
+REPLACE_PYTHON+=	tools/scan-build-py/bin/intercept-build
+REPLACE_PYTHON+=	tools/scan-build-py/bin/scan-build
+REPLACE_PYTHON+=	tools/scan-build-py/libexec/analyze-c++
+REPLACE_PYTHON+=	tools/scan-build-py/libexec/analyze-cc
+REPLACE_PYTHON+=	tools/scan-build-py/libexec/intercept-c++
+REPLACE_PYTHON+=	tools/scan-build-py/libexec/intercept-cc
+REPLACE_PYTHON+=	tools/scan-build/bin/set-xcode-analyzer
+REPLACE_PYTHON+=	tools/scan-view/bin/scan-view
+REPLACE_PYTHON+=	tools/scan-view/share/Reporter.py
+REPLACE_PYTHON+=	tools/scan-view/share/startfile.py
+REPLACE_PYTHON+=	utils/ABITest/ABITestGen.py
+REPLACE_PYTHON+=	utils/CIndex/completion_logger_server.py
+REPLACE_PYTHON+=	utils/CaptureCmd
+REPLACE_PYTHON+=	utils/CmpDriver
+REPLACE_PYTHON+=	utils/FindSpecRefs
+REPLACE_PYTHON+=	utils/FuzzTest
+REPLACE_PYTHON+=	utils/TestUtils/deep-stack.py
+REPLACE_PYTHON+=	utils/analyzer/CmpRuns.py
+REPLACE_PYTHON+=	utils/analyzer/SATest.py
+REPLACE_PYTHON+=	utils/analyzer/SATestAdd.py
+REPLACE_PYTHON+=	utils/analyzer/SATestBuild.py
+REPLACE_PYTHON+=	utils/analyzer/SATestUpdateDiffs.py
+REPLACE_PYTHON+=	utils/analyzer/SumTimerInfo.py
+REPLACE_PYTHON+=	utils/analyzer/exploded-graph-rewriter.py
+REPLACE_PYTHON+=	utils/check_cfc/check_cfc.py
+REPLACE_PYTHON+=	utils/check_cfc/obj_diff.py
+REPLACE_PYTHON+=	utils/check_cfc/test_check_cfc.py
+REPLACE_PYTHON+=	utils/clangdiag.py
+REPLACE_PYTHON+=	utils/convert_arm_neon.py
+REPLACE_PYTHON+=	utils/creduce-clang-crash.py
+REPLACE_PYTHON+=	utils/hmaptool/hmaptool
+REPLACE_PYTHON+=	utils/modfuzz.py
+REPLACE_PYTHON+=	utils/module-deps-to-rsp.py
+REPLACE_PYTHON+=	utils/token-delta.py
+REPLACE_PYTHON+=	www/builtins.py
+REPLACE_PYTHON+=	www/make_cxx_dr_status
+
+.if ${OPSYS} == "NetBSD" && ${PKGSRC_COMPILER:Mclang}
+# command to check if clang is using libc++ or libstdc++
+LIBCPP_CHECK!=	\
+	printf '%s\n' \
+		'\#include <ciso646>' \
+		'\#ifdef _LIBCPP_VERSION' \
+		'YES' \
+		'\#endif' \
+	| ${CLANGBASE}/bin/clang++ -x c++ -E - 2>&1 \
+	| grep YES || true
+.else
+LIBCPP_CHECK=	NO
+.endif
+
+.if ${OPSYS} == "NetBSD" && ${LIBCPP_CHECK} != YES
+CMAKE_ARGS+=			-DCLANG_DEFAULT_CXX_STDLIB:STRING="libstdc++"
+.endif
+
+# Enable full LLVM suite on SunOS
+.if ${OPSYS} == "SunOS"
+.include "../../wip/compiler-rt/buildlink3.mk"
+.include "../../wip/libcxx/buildlink3.mk"
+.include "../../wip/libcxxabi/buildlink3.mk"
+.include "../../wip/libunwind/buildlink3.mk"
+CMAKE_ARGS+=    -DCLANG_DEFAULT_RTLIB:STRING="compiler-rt"
+CMAKE_ARGS+=    -DCLANG_DEFAULT_CXX_STDLIB:STRING="libc++"
+.endif
+
+# 3.8.0 -> 3.8
+LLVM_MAJOR=	${PKGVERSION_NOREV:C/^([0-9]+\.[0-9]+)\..*$/\1/}
+PLIST_SUBST+=	LLVM_MAJOR=${LLVM_MAJOR}
+
+PKGVERSION_MAJOR=	16
+PLIST_SUBST+=		PKGVERSION_MAJOR=${PKGVERSION_MAJOR}
+
+PLIST_VARS+=	notdylib
+.if ${SHLIB_TYPE} == "dylib"
+SOEXT=		dylib
+.else
+SOEXT=		so
+PLIST.notdylib=	yes
+.endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.clang
+PKG_SUPPORTED_OPTIONS=	tests z3
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mtests)
+CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=ON
+CMAKE_ARGS+=		-DCLANG_INCLUDE_TESTS=ON
+TEST_TARGET=		clang-test
+TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
+.  include "../../devel/googletest/buildlink3.mk"
+.else
+CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=OFF
+CMAKE_ARGS+=		-DCLANG_INCLUDE_TESTS=OFF
+.endif
+
+.include "../../wip/llvm/buildlink3.mk"
+
+.if !empty(PKG_OPTIONS:Mz3)
+.  if empty(PKG_BUILD_OPTIONS.llvm:Mz3)
+PKG_FAIL_REASON+=	"z3 PKG_OPTION must be enabled in lang/llvm"
+.  endif
+.  include "../../math/z3/buildlink3.mk"
+CMAKE_ARGS+=		-DLLVM_ENABLE_Z3_SOLVER=ON
+.endif
+
+post-extract:
+	${MKDIR} ${WRKSRC}/build
+
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.include "../../lang/python/tool.mk"
+DEPENDS+=	llvm-${PKGVERSION_NOREV}{,nb*}:../../wip/llvm
diff --git a/clang/PLIST b/clang/PLIST
new file mode 100644
index 0000000000..7f5ab09263
--- /dev/null
+++ b/clang/PLIST
@@ -0,0 +1,1021 @@
+@comment $NetBSD: PLIST,v 1.37 2022/11/14 18:44:05 adam Exp $
+bin/amdgpu-arch
+bin/analyze-build
+bin/c-index-test
+bin/clang
+bin/clang++
+bin/clang-${PKGVERSION_MAJOR}
+bin/clang-check
+bin/clang-cl
+bin/clang-cpp
+bin/clang-extdef-mapping
+bin/clang-format
+bin/clang-linker-wrapper
+bin/clang-offload-bundler
+bin/clang-offload-packager
+bin/clang-refactor
+bin/clang-rename
+bin/clang-repl
+bin/clang-scan-deps
+bin/diagtool
+bin/git-clang-format
+bin/hmaptool
+bin/intercept-build
+bin/nvptx-arch
+bin/scan-build
+bin/scan-build-py
+bin/scan-view
+include/clang-c/BuildSystem.h
+include/clang-c/CXCompilationDatabase.h
+include/clang-c/CXDiagnostic.h
+include/clang-c/CXErrorCode.h
+include/clang-c/CXFile.h
+include/clang-c/CXSourceLocation.h
+include/clang-c/CXString.h
+include/clang-c/Documentation.h
+include/clang-c/ExternC.h
+include/clang-c/FatalErrorHandler.h
+include/clang-c/Index.h
+include/clang-c/Platform.h
+include/clang-c/Rewrite.h
+include/clang/APINotes/APINotesYAMLCompiler.h
+include/clang/APINotes/Types.h
+include/clang/ARCMigrate/ARCMT.h
+include/clang/ARCMigrate/ARCMTActions.h
+include/clang/ARCMigrate/FileRemapper.h
+include/clang/AST/APValue.h
+include/clang/AST/AST.h
+include/clang/AST/ASTConcept.h
+include/clang/AST/ASTConsumer.h
+include/clang/AST/ASTContext.h
+include/clang/AST/ASTContextAllocate.h
+include/clang/AST/ASTDiagnostic.h
+include/clang/AST/ASTDumper.h
+include/clang/AST/ASTDumperUtils.h
+include/clang/AST/ASTFwd.h
+include/clang/AST/ASTImportError.h
+include/clang/AST/ASTImporter.h
+include/clang/AST/ASTImporterLookupTable.h
+include/clang/AST/ASTImporterSharedState.h
+include/clang/AST/ASTLambda.h
+include/clang/AST/ASTMutationListener.h
+include/clang/AST/ASTNodeTraverser.h
+include/clang/AST/ASTStructuralEquivalence.h
+include/clang/AST/ASTTypeTraits.h
+include/clang/AST/ASTUnresolvedSet.h
+include/clang/AST/ASTVector.h
+include/clang/AST/AbstractBasicReader.h
+include/clang/AST/AbstractBasicReader.inc
+include/clang/AST/AbstractBasicWriter.h
+include/clang/AST/AbstractBasicWriter.inc
+include/clang/AST/AbstractTypeReader.h
+include/clang/AST/AbstractTypeReader.inc
+include/clang/AST/AbstractTypeWriter.h
+include/clang/AST/AbstractTypeWriter.inc
+include/clang/AST/Attr.h
+include/clang/AST/AttrImpl.inc
+include/clang/AST/AttrIterator.h
+include/clang/AST/AttrNodeTraverse.inc
+include/clang/AST/AttrTextNodeDump.inc
+include/clang/AST/AttrVisitor.h
+include/clang/AST/AttrVisitor.inc
+include/clang/AST/Attrs.inc
+include/clang/AST/Availability.h
+include/clang/AST/BaseSubobject.h
+include/clang/AST/BuiltinTypes.def
+include/clang/AST/CXXInheritance.h
+include/clang/AST/CXXRecordDeclDefinitionBits.def
+include/clang/AST/CanonicalType.h
+include/clang/AST/CharUnits.h
+include/clang/AST/Comment.h
+include/clang/AST/CommentBriefParser.h
+include/clang/AST/CommentCommandInfo.inc
+include/clang/AST/CommentCommandList.inc
+include/clang/AST/CommentCommandTraits.h
+include/clang/AST/CommentDiagnostic.h
+include/clang/AST/CommentHTMLNamedCharacterReferences.inc
+include/clang/AST/CommentHTMLTags.inc
+include/clang/AST/CommentHTMLTagsProperties.inc
+include/clang/AST/CommentLexer.h
+include/clang/AST/CommentNodes.inc
+include/clang/AST/CommentParser.h
+include/clang/AST/CommentSema.h
+include/clang/AST/CommentVisitor.h
+include/clang/AST/ComparisonCategories.h
+include/clang/AST/ComputeDependence.h
+include/clang/AST/CurrentSourceLocExprScope.h
+include/clang/AST/DataCollection.h
+include/clang/AST/Decl.h
+include/clang/AST/DeclAccessPair.h
+include/clang/AST/DeclBase.h
+include/clang/AST/DeclCXX.h
+include/clang/AST/DeclContextInternals.h
+include/clang/AST/DeclFriend.h
+include/clang/AST/DeclGroup.h
+include/clang/AST/DeclLookups.h
+include/clang/AST/DeclNodes.inc
+include/clang/AST/DeclObjC.h
+include/clang/AST/DeclObjCCommon.h
+include/clang/AST/DeclOpenMP.h
+include/clang/AST/DeclTemplate.h
+include/clang/AST/DeclVisitor.h
+include/clang/AST/DeclarationName.h
+include/clang/AST/DependenceFlags.h
+include/clang/AST/DependentDiagnostic.h
+include/clang/AST/EvaluatedExprVisitor.h
+include/clang/AST/Expr.h
+include/clang/AST/ExprCXX.h
+include/clang/AST/ExprConcepts.h
+include/clang/AST/ExprObjC.h
+include/clang/AST/ExprOpenMP.h
+include/clang/AST/ExternalASTMerger.h
+include/clang/AST/ExternalASTSource.h
+include/clang/AST/FormatString.h
+include/clang/AST/GlobalDecl.h
+include/clang/AST/IgnoreExpr.h
+include/clang/AST/JSONNodeDumper.h
+include/clang/AST/LambdaCapture.h
+include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h
+include/clang/AST/LocInfoType.h
+include/clang/AST/Mangle.h
+include/clang/AST/MangleNumberingContext.h
+include/clang/AST/NSAPI.h
+include/clang/AST/NestedNameSpecifier.h
+include/clang/AST/NonTrivialTypeVisitor.h
+include/clang/AST/ODRDiagsEmitter.h
+include/clang/AST/ODRHash.h
+include/clang/AST/OSLog.h
+include/clang/AST/OpenMPClause.h
+include/clang/AST/OperationKinds.def
+include/clang/AST/OperationKinds.h
+include/clang/AST/OptionalDiagnostic.h
+include/clang/AST/ParentMap.h
+include/clang/AST/ParentMapContext.h
+include/clang/AST/PrettyDeclStackTrace.h
+include/clang/AST/PrettyPrinter.h
+include/clang/AST/QualTypeNames.h
+include/clang/AST/Randstruct.h
+include/clang/AST/RawCommentList.h
+include/clang/AST/RecordLayout.h
+include/clang/AST/RecursiveASTVisitor.h
+include/clang/AST/Redeclarable.h
+include/clang/AST/SelectorLocationsKind.h
+include/clang/AST/Stmt.h
+include/clang/AST/StmtCXX.h
+include/clang/AST/StmtDataCollectors.inc
+include/clang/AST/StmtGraphTraits.h
+include/clang/AST/StmtIterator.h
+include/clang/AST/StmtNodes.inc
+include/clang/AST/StmtObjC.h
+include/clang/AST/StmtOpenMP.h
+include/clang/AST/StmtVisitor.h
+include/clang/AST/TemplateArgumentVisitor.h
+include/clang/AST/TemplateBase.h
+include/clang/AST/TemplateName.h
+include/clang/AST/TextNodeDumper.h
+include/clang/AST/Type.h
+include/clang/AST/TypeLoc.h
+include/clang/AST/TypeLocNodes.def
+include/clang/AST/TypeLocVisitor.h
+include/clang/AST/TypeNodes.inc
+include/clang/AST/TypeOrdering.h
+include/clang/AST/TypeVisitor.h
+include/clang/AST/UnresolvedSet.h
+include/clang/AST/VTTBuilder.h
+include/clang/AST/VTableBuilder.h
+include/clang/ASTMatchers/ASTMatchFinder.h
+include/clang/ASTMatchers/ASTMatchers.h
+include/clang/ASTMatchers/ASTMatchersInternal.h
+include/clang/ASTMatchers/ASTMatchersMacros.h
+include/clang/ASTMatchers/Dynamic/Diagnostics.h
+include/clang/ASTMatchers/Dynamic/Parser.h
+include/clang/ASTMatchers/Dynamic/Registry.h
+include/clang/ASTMatchers/Dynamic/VariantValue.h
+include/clang/ASTMatchers/GtestMatchers.h
+include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
+include/clang/Analysis/Analyses/CalledOnceCheck.h
+include/clang/Analysis/Analyses/Consumed.h
+include/clang/Analysis/Analyses/Dominators.h
+include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
+include/clang/Analysis/Analyses/LiveVariables.h
+include/clang/Analysis/Analyses/PostOrderCFGView.h
+include/clang/Analysis/Analyses/ReachableCode.h
+include/clang/Analysis/Analyses/ThreadSafety.h
+include/clang/Analysis/Analyses/ThreadSafetyCommon.h
+include/clang/Analysis/Analyses/ThreadSafetyLogical.h
+include/clang/Analysis/Analyses/ThreadSafetyOps.def
+include/clang/Analysis/Analyses/ThreadSafetyTIL.h
+include/clang/Analysis/Analyses/ThreadSafetyTraverse.h
+include/clang/Analysis/Analyses/ThreadSafetyUtil.h
+include/clang/Analysis/Analyses/UninitializedValues.h
+include/clang/Analysis/Analyses/UnsafeBufferUsage.h
+include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def
+include/clang/Analysis/AnalysisDeclContext.h
+include/clang/Analysis/AnyCall.h
+include/clang/Analysis/BodyFarm.h
+include/clang/Analysis/CFG.h
+include/clang/Analysis/CFGStmtMap.h
+include/clang/Analysis/CallGraph.h
+include/clang/Analysis/CloneDetection.h
+include/clang/Analysis/CodeInjector.h
+include/clang/Analysis/ConstructionContext.h
+include/clang/Analysis/DomainSpecific/CocoaConventions.h
+include/clang/Analysis/DomainSpecific/ObjCNoReturn.h
+include/clang/Analysis/FlowSensitive/CFGMatchSwitch.h
+include/clang/Analysis/FlowSensitive/ControlFlowContext.h
+include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
+include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
+include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
+include/clang/Analysis/FlowSensitive/DataflowLattice.h
+include/clang/Analysis/FlowSensitive/DataflowValues.h
+include/clang/Analysis/FlowSensitive/DataflowWorklist.h
+include/clang/Analysis/FlowSensitive/DebugSupport.h
+include/clang/Analysis/FlowSensitive/MapLattice.h
+include/clang/Analysis/FlowSensitive/MatchSwitch.h
+include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h
+include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h
+include/clang/Analysis/FlowSensitive/NoopAnalysis.h
+include/clang/Analysis/FlowSensitive/NoopLattice.h
+include/clang/Analysis/FlowSensitive/Solver.h
+include/clang/Analysis/FlowSensitive/StorageLocation.h
+include/clang/Analysis/FlowSensitive/Transfer.h
+include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h
+include/clang/Analysis/FlowSensitive/Value.h
+include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h
+include/clang/Analysis/IssueHash.h
+include/clang/Analysis/MacroExpansionContext.h
+include/clang/Analysis/PathDiagnostic.h
+include/clang/Analysis/ProgramPoint.h
+include/clang/Analysis/RetainSummaryManager.h
+include/clang/Analysis/SelectorExtras.h
+include/clang/Analysis/Support/BumpVector.h
+include/clang/Basic/AArch64SVEACLETypes.def
+include/clang/Basic/ABI.h
+include/clang/Basic/AddressSpaces.h
+include/clang/Basic/AlignedAllocation.h
+include/clang/Basic/AllDiagnostics.h
+include/clang/Basic/AttrHasAttributeImpl.inc
+include/clang/Basic/AttrKinds.h
+include/clang/Basic/AttrList.inc
+include/clang/Basic/AttrSubMatchRulesList.inc
+include/clang/Basic/AttrSubjectMatchRules.h
+include/clang/Basic/AttributeCommonInfo.h
+include/clang/Basic/Attributes.h
+include/clang/Basic/BitmaskEnum.h
+include/clang/Basic/BuiltinHeaders.def
+include/clang/Basic/Builtins.def
+include/clang/Basic/Builtins.h
+include/clang/Basic/BuiltinsAArch64.def
+include/clang/Basic/BuiltinsAArch64NeonSVEBridge.def
+include/clang/Basic/BuiltinsAArch64NeonSVEBridge_cg.def
+include/clang/Basic/BuiltinsAMDGPU.def
+include/clang/Basic/BuiltinsARM.def
+include/clang/Basic/BuiltinsBPF.def
+include/clang/Basic/BuiltinsHexagon.def
+include/clang/Basic/BuiltinsHexagonDep.def
+include/clang/Basic/BuiltinsHexagonMapCustomDep.def
+include/clang/Basic/BuiltinsLoongArch.def
+include/clang/Basic/BuiltinsMips.def
+include/clang/Basic/BuiltinsNEON.def
+include/clang/Basic/BuiltinsNVPTX.def
+include/clang/Basic/BuiltinsPPC.def
+include/clang/Basic/BuiltinsRISCV.def
+include/clang/Basic/BuiltinsRISCVVector.def
+include/clang/Basic/BuiltinsSVE.def
+include/clang/Basic/BuiltinsSystemZ.def
+include/clang/Basic/BuiltinsVE.def
+include/clang/Basic/BuiltinsVEVL.gen.def
+include/clang/Basic/BuiltinsWebAssembly.def
+include/clang/Basic/BuiltinsX86.def
+include/clang/Basic/BuiltinsX86_64.def
+include/clang/Basic/BuiltinsXCore.def
+include/clang/Basic/CLWarnings.h
+include/clang/Basic/CapturedStmt.h
+include/clang/Basic/CharInfo.h
+include/clang/Basic/CodeGenOptions.def
+include/clang/Basic/CodeGenOptions.h
+include/clang/Basic/CommentOptions.h
+include/clang/Basic/Cuda.h
+include/clang/Basic/CustomizableOptional.h
+include/clang/Basic/DarwinSDKInfo.h
+include/clang/Basic/DebugInfoOptions.h
+include/clang/Basic/Diagnostic.h
+include/clang/Basic/DiagnosticAST.h
+include/clang/Basic/DiagnosticASTKinds.inc
+include/clang/Basic/DiagnosticAnalysis.h
+include/clang/Basic/DiagnosticAnalysisKinds.inc
+include/clang/Basic/DiagnosticCategories.h
+include/clang/Basic/DiagnosticComment.h
+include/clang/Basic/DiagnosticCommentKinds.inc
+include/clang/Basic/DiagnosticCommonKinds.inc
+include/clang/Basic/DiagnosticCrossTU.h
+include/clang/Basic/DiagnosticCrossTUKinds.inc
+include/clang/Basic/DiagnosticDriver.h
+include/clang/Basic/DiagnosticDriverKinds.inc
+include/clang/Basic/DiagnosticError.h
+include/clang/Basic/DiagnosticFrontend.h
+include/clang/Basic/DiagnosticFrontendKinds.inc
+include/clang/Basic/DiagnosticGroups.inc
+include/clang/Basic/DiagnosticIDs.h
+include/clang/Basic/DiagnosticIndexName.inc
+include/clang/Basic/DiagnosticLex.h
+include/clang/Basic/DiagnosticLexKinds.inc
+include/clang/Basic/DiagnosticOptions.def
+include/clang/Basic/DiagnosticOptions.h
+include/clang/Basic/DiagnosticParse.h
+include/clang/Basic/DiagnosticParseKinds.inc
+include/clang/Basic/DiagnosticRefactoring.h
+include/clang/Basic/DiagnosticRefactoringKinds.inc
+include/clang/Basic/DiagnosticSema.h
+include/clang/Basic/DiagnosticSemaKinds.inc
+include/clang/Basic/DiagnosticSerialization.h
+include/clang/Basic/DiagnosticSerializationKinds.inc
+include/clang/Basic/DirectoryEntry.h
+include/clang/Basic/ExceptionSpecificationType.h
+include/clang/Basic/ExpressionTraits.h
+include/clang/Basic/FPOptions.def
+include/clang/Basic/Features.def
+include/clang/Basic/FileEntry.h
+include/clang/Basic/FileManager.h
+include/clang/Basic/FileSystemOptions.h
+include/clang/Basic/FileSystemStatCache.h
+include/clang/Basic/HLSLRuntime.h
+include/clang/Basic/HeaderInclude.h
+include/clang/Basic/IdentifierTable.h
+include/clang/Basic/JsonSupport.h
+include/clang/Basic/LLVM.h
+include/clang/Basic/Lambda.h
+include/clang/Basic/LangOptions.def
+include/clang/Basic/LangOptions.h
+include/clang/Basic/LangStandard.h
+include/clang/Basic/LangStandards.def
+include/clang/Basic/Linkage.h
+include/clang/Basic/MSP430Target.def
+include/clang/Basic/MacroBuilder.h
+include/clang/Basic/MakeSupport.h
+include/clang/Basic/Module.h
+include/clang/Basic/NoSanitizeList.h
+include/clang/Basic/ObjCRuntime.h
+include/clang/Basic/OpenCLExtensionTypes.def
+include/clang/Basic/OpenCLExtensions.def
+include/clang/Basic/OpenCLImageTypes.def
+include/clang/Basic/OpenCLOptions.h
+include/clang/Basic/OpenMPKinds.def
+include/clang/Basic/OpenMPKinds.h
+include/clang/Basic/OperatorKinds.def
+include/clang/Basic/OperatorKinds.h
+include/clang/Basic/OperatorPrecedence.h
+include/clang/Basic/PPCTypes.def
+include/clang/Basic/PartialDiagnostic.h
+include/clang/Basic/PlistSupport.h
+include/clang/Basic/PragmaKinds.h
+include/clang/Basic/PrettyStackTrace.h
+include/clang/Basic/ProfileList.h
+include/clang/Basic/RISCVVTypes.def
+include/clang/Basic/SanitizerSpecialCaseList.h
+include/clang/Basic/Sanitizers.def
+include/clang/Basic/Sanitizers.h
+include/clang/Basic/Sarif.h
+include/clang/Basic/SourceLocation.h
+include/clang/Basic/SourceManager.h
+include/clang/Basic/SourceManagerInternals.h
+include/clang/Basic/Specifiers.h
+include/clang/Basic/Stack.h
+include/clang/Basic/SyncScope.h
+include/clang/Basic/TargetBuiltins.h
+include/clang/Basic/TargetCXXABI.def
+include/clang/Basic/TargetCXXABI.h
+include/clang/Basic/TargetID.h
+include/clang/Basic/TargetInfo.h
+include/clang/Basic/TargetOptions.h
+include/clang/Basic/TemplateKinds.h
+include/clang/Basic/Thunk.h
+include/clang/Basic/TokenKinds.def
+include/clang/Basic/TokenKinds.h
+include/clang/Basic/TransformTypeTraits.def
+include/clang/Basic/TypeTraits.h
+include/clang/Basic/Version.h
+include/clang/Basic/Version.inc
+include/clang/Basic/Visibility.h
+include/clang/Basic/XRayInstr.h
+include/clang/Basic/XRayLists.h
+include/clang/Basic/arm_cde_builtin_aliases.inc
+include/clang/Basic/arm_cde_builtin_cg.inc
+include/clang/Basic/arm_cde_builtin_sema.inc
+include/clang/Basic/arm_cde_builtins.inc
+include/clang/Basic/arm_fp16.inc
+include/clang/Basic/arm_mve_builtin_aliases.inc
+include/clang/Basic/arm_mve_builtin_cg.inc
+include/clang/Basic/arm_mve_builtin_sema.inc
+include/clang/Basic/arm_mve_builtins.inc
+include/clang/Basic/arm_neon.inc
+include/clang/Basic/arm_sve_builtin_cg.inc
+include/clang/Basic/arm_sve_builtins.inc
+include/clang/Basic/arm_sve_sema_rangechecks.inc
+include/clang/Basic/arm_sve_typeflags.inc
+include/clang/Basic/riscv_vector_builtin_cg.inc
+include/clang/Basic/riscv_vector_builtin_sema.inc
+include/clang/Basic/riscv_vector_builtins.inc
+include/clang/CodeGen/BackendUtil.h
+include/clang/CodeGen/CGFunctionInfo.h
+include/clang/CodeGen/CodeGenABITypes.h
+include/clang/CodeGen/CodeGenAction.h
+include/clang/CodeGen/ConstantInitBuilder.h
+include/clang/CodeGen/ConstantInitFuture.h
+include/clang/CodeGen/ModuleBuilder.h
+include/clang/CodeGen/ObjectFilePCHContainerOperations.h
+include/clang/CodeGen/SwiftCallingConv.h
+include/clang/Config/config.h
+include/clang/CrossTU/CrossTUDiagnostic.h
+include/clang/CrossTU/CrossTranslationUnit.h
+include/clang/DirectoryWatcher/DirectoryWatcher.h
+include/clang/Driver/Action.h
+include/clang/Driver/Compilation.h
+include/clang/Driver/Distro.h
+include/clang/Driver/Driver.h
+include/clang/Driver/DriverDiagnostic.h
+include/clang/Driver/InputInfo.h
+include/clang/Driver/Job.h
+include/clang/Driver/Multilib.h
+include/clang/Driver/OffloadBundler.h
+include/clang/Driver/OptionUtils.h
+include/clang/Driver/Options.h
+include/clang/Driver/Options.inc
+include/clang/Driver/Phases.h
+include/clang/Driver/SanitizerArgs.h
+include/clang/Driver/Tool.h
+include/clang/Driver/ToolChain.h
+include/clang/Driver/Types.def
+include/clang/Driver/Types.h
+include/clang/Driver/Util.h
+include/clang/Driver/XRayArgs.h
+include/clang/Edit/Commit.h
+include/clang/Edit/EditedSource.h
+include/clang/Edit/EditsReceiver.h
+include/clang/Edit/FileOffset.h
+include/clang/Edit/Rewriters.h
+include/clang/ExtractAPI/API.h
+include/clang/ExtractAPI/APIIgnoresList.h
+include/clang/ExtractAPI/AvailabilityInfo.h
+include/clang/ExtractAPI/DeclarationFragments.h
+include/clang/ExtractAPI/ExtractAPIVisitor.h
+include/clang/ExtractAPI/FrontendActions.h
+include/clang/ExtractAPI/Serialization/SerializerBase.h
+include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h
+include/clang/Format/Format.h
+include/clang/Frontend/ASTConsumers.h
+include/clang/Frontend/ASTUnit.h
+include/clang/Frontend/ChainedDiagnosticConsumer.h
+include/clang/Frontend/CommandLineSourceLoc.h
+include/clang/Frontend/CompilerInstance.h
+include/clang/Frontend/CompilerInvocation.h
+include/clang/Frontend/DependencyOutputOptions.h
+include/clang/Frontend/DiagnosticRenderer.h
+include/clang/Frontend/FrontendAction.h
+include/clang/Frontend/FrontendActions.h
+include/clang/Frontend/FrontendDiagnostic.h
+include/clang/Frontend/FrontendOptions.h
+include/clang/Frontend/FrontendPluginRegistry.h
+include/clang/Frontend/LayoutOverrideSource.h
+include/clang/Frontend/LogDiagnosticPrinter.h
+include/clang/Frontend/MigratorOptions.h
+include/clang/Frontend/MultiplexConsumer.h
+include/clang/Frontend/PCHContainerOperations.h
+include/clang/Frontend/PrecompiledPreamble.h
+include/clang/Frontend/PreprocessorOutputOptions.h
+include/clang/Frontend/SARIFDiagnostic.h
+include/clang/Frontend/SARIFDiagnosticPrinter.h
+include/clang/Frontend/SerializedDiagnosticPrinter.h
+include/clang/Frontend/SerializedDiagnosticReader.h
+include/clang/Frontend/SerializedDiagnostics.h
+include/clang/Frontend/TextDiagnostic.h
+include/clang/Frontend/TextDiagnosticBuffer.h
+include/clang/Frontend/TextDiagnosticPrinter.h
+include/clang/Frontend/Utils.h
+include/clang/Frontend/VerifyDiagnosticConsumer.h
+include/clang/FrontendTool/Utils.h
+include/clang/Index/CommentToXML.h
+include/clang/Index/DeclOccurrence.h
+include/clang/Index/IndexDataConsumer.h
+include/clang/Index/IndexSymbol.h
+include/clang/Index/IndexingAction.h
+include/clang/Index/IndexingOptions.h
+include/clang/Index/USRGeneration.h
+include/clang/IndexSerialization/SerializablePathCollection.h
+include/clang/Interpreter/Interpreter.h
+include/clang/Interpreter/PartialTranslationUnit.h
+include/clang/Lex/CodeCompletionHandler.h
+include/clang/Lex/DependencyDirectivesScanner.h
+include/clang/Lex/DirectoryLookup.h
+include/clang/Lex/ExternalPreprocessorSource.h
+include/clang/Lex/HeaderMap.h
+include/clang/Lex/HeaderMapTypes.h
+include/clang/Lex/HeaderSearch.h
+include/clang/Lex/HeaderSearchOptions.h
+include/clang/Lex/LexDiagnostic.h
+include/clang/Lex/Lexer.h
+include/clang/Lex/LiteralSupport.h
+include/clang/Lex/MacroArgs.h
+include/clang/Lex/MacroInfo.h
+include/clang/Lex/ModuleLoader.h
+include/clang/Lex/ModuleMap.h
+include/clang/Lex/MultipleIncludeOpt.h
+include/clang/Lex/PPCallbacks.h
+include/clang/Lex/PPConditionalDirectiveRecord.h
+include/clang/Lex/Pragma.h
+include/clang/Lex/PreprocessingRecord.h
+include/clang/Lex/Preprocessor.h
+include/clang/Lex/PreprocessorLexer.h
+include/clang/Lex/PreprocessorOptions.h
+include/clang/Lex/ScratchBuffer.h
+include/clang/Lex/Token.h
+include/clang/Lex/TokenConcatenation.h
+include/clang/Lex/TokenLexer.h
+include/clang/Lex/VariadicMacroSupport.h
+include/clang/Parse/AttrParserStringSwitches.inc
+include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc
+include/clang/Parse/LoopHint.h
+include/clang/Parse/ParseAST.h
+include/clang/Parse/ParseDiagnostic.h
+include/clang/Parse/Parser.h
+include/clang/Parse/RAIIObjectsForParser.h
+include/clang/Rewrite/Core/DeltaTree.h
+include/clang/Rewrite/Core/HTMLRewrite.h
+include/clang/Rewrite/Core/RewriteBuffer.h
+include/clang/Rewrite/Core/RewriteRope.h
+include/clang/Rewrite/Core/Rewriter.h
+include/clang/Rewrite/Core/TokenRewriter.h
+include/clang/Rewrite/Frontend/ASTConsumers.h
+include/clang/Rewrite/Frontend/FixItRewriter.h
+include/clang/Rewrite/Frontend/FrontendActions.h
+include/clang/Rewrite/Frontend/Rewriters.h
+include/clang/Sema/AnalysisBasedWarnings.h
+include/clang/Sema/AttrParsedAttrImpl.inc
+include/clang/Sema/AttrParsedAttrKinds.inc
+include/clang/Sema/AttrParsedAttrList.inc
+include/clang/Sema/AttrSpellingListIndex.inc
+include/clang/Sema/AttrTemplateInstantiate.inc
+include/clang/Sema/CXXFieldCollector.h
+include/clang/Sema/CleanupInfo.h
+include/clang/Sema/CodeCompleteConsumer.h
+include/clang/Sema/CodeCompleteOptions.h
+include/clang/Sema/DeclSpec.h
+include/clang/Sema/DelayedDiagnostic.h
+include/clang/Sema/Designator.h
+include/clang/Sema/ExternalSemaSource.h
+include/clang/Sema/HLSLExternalSemaSource.h
+include/clang/Sema/IdentifierResolver.h
+include/clang/Sema/Initialization.h
+include/clang/Sema/Lookup.h
+include/clang/Sema/MultiplexExternalSemaSource.h
+include/clang/Sema/ObjCMethodList.h
+include/clang/Sema/Overload.h
+include/clang/Sema/Ownership.h
+include/clang/Sema/ParsedAttr.h
+include/clang/Sema/ParsedTemplate.h
+include/clang/Sema/RISCVIntrinsicManager.h
+include/clang/Sema/Scope.h
+include/clang/Sema/ScopeInfo.h
+include/clang/Sema/Sema.h
+include/clang/Sema/SemaConcept.h
+include/clang/Sema/SemaConsumer.h
+include/clang/Sema/SemaDiagnostic.h
+include/clang/Sema/SemaFixItUtils.h
+include/clang/Sema/SemaInternal.h
+include/clang/Sema/SemaLambda.h
+include/clang/Sema/Template.h
+include/clang/Sema/TemplateDeduction.h
+include/clang/Sema/TemplateInstCallback.h
+include/clang/Sema/TypoCorrection.h
+include/clang/Sema/Weak.h
+include/clang/Serialization/ASTBitCodes.h
+include/clang/Serialization/ASTDeserializationListener.h
+include/clang/Serialization/ASTReader.h
+include/clang/Serialization/ASTRecordReader.h
+include/clang/Serialization/ASTRecordWriter.h
+include/clang/Serialization/ASTWriter.h
+include/clang/Serialization/AttrPCHRead.inc
+include/clang/Serialization/AttrPCHWrite.inc
+include/clang/Serialization/ContinuousRangeMap.h
+include/clang/Serialization/GlobalModuleIndex.h
+include/clang/Serialization/InMemoryModuleCache.h
+include/clang/Serialization/ModuleFile.h
+include/clang/Serialization/ModuleFileExtension.h
+include/clang/Serialization/ModuleManager.h
+include/clang/Serialization/PCHContainerOperations.h
+include/clang/Serialization/SerializationDiagnostic.h
+include/clang/Serialization/SourceLocationEncoding.h
+include/clang/Serialization/TypeBitCodes.def
+include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
+include/clang/StaticAnalyzer/Checkers/Checkers.inc
+include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h
+include/clang/StaticAnalyzer/Checkers/SValExplainer.h
+include/clang/StaticAnalyzer/Checkers/Taint.h
+include/clang/StaticAnalyzer/Core/Analyses.def
+include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
+include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
+include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
+include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
+include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h
+include/clang/StaticAnalyzer/Core/Checker.h
+include/clang/StaticAnalyzer/Core/CheckerManager.h
+include/clang/StaticAnalyzer/Core/CheckerRegistryData.h
+include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
+include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h
+include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
+include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h
+include/clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h
+include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h
+include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
+include/clang/StaticAnalyzer/Core/PathSensitive/DynamicCastInfo.h
+include/clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h
+include/clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h
+include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h
+include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h
+include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
+include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
+include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h
+include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h
+include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
+include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
+include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
+include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h
+include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SVals.def
+include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
+include/clang/StaticAnalyzer/Core/PathSensitive/StoreRef.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SummaryManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/Symbols.def
+include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h
+include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
+include/clang/StaticAnalyzer/Frontend/AnalyzerHelpFlags.h
+include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
+include/clang/StaticAnalyzer/Frontend/FrontendActions.h
+include/clang/StaticAnalyzer/Frontend/ModelConsumer.h
+include/clang/Support/RISCVVIntrinsicUtils.h
+include/clang/Testing/CommandLineArgs.h
+include/clang/Testing/TestAST.h
+include/clang/Testing/TestClangConfig.h
+include/clang/Tooling/ASTDiff/ASTDiff.h
+include/clang/Tooling/ASTDiff/ASTDiffInternal.h
+include/clang/Tooling/AllTUsExecution.h
+include/clang/Tooling/ArgumentsAdjusters.h
+include/clang/Tooling/CommonOptionsParser.h
+include/clang/Tooling/CompilationDatabase.h
+include/clang/Tooling/CompilationDatabasePluginRegistry.h
+include/clang/Tooling/Core/Diagnostic.h
+include/clang/Tooling/Core/Replacement.h
+include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
+include/clang/Tooling/DependencyScanning/DependencyScanningService.h
+include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
+include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h
+include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
+include/clang/Tooling/DiagnosticsYaml.h
+include/clang/Tooling/Execution.h
+include/clang/Tooling/FileMatchTrie.h
+include/clang/Tooling/FixIt.h
+include/clang/Tooling/Inclusions/HeaderAnalysis.h
+include/clang/Tooling/Inclusions/HeaderIncludes.h
+include/clang/Tooling/Inclusions/IncludeStyle.h
+include/clang/Tooling/Inclusions/StandardLibrary.h
+include/clang/Tooling/JSONCompilationDatabase.h
+include/clang/Tooling/NodeIntrospection.h
+include/clang/Tooling/NodeIntrospection.inc
+include/clang/Tooling/Refactoring.h
+include/clang/Tooling/Refactoring/ASTSelection.h
+include/clang/Tooling/Refactoring/AtomicChange.h
+include/clang/Tooling/Refactoring/Extract/Extract.h
+include/clang/Tooling/Refactoring/Extract/SourceExtraction.h
+include/clang/Tooling/Refactoring/Lookup.h
+include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h
+include/clang/Tooling/Refactoring/RefactoringAction.h
+include/clang/Tooling/Refactoring/RefactoringActionRule.h
+include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h
+include/clang/Tooling/Refactoring/RefactoringActionRules.h
+include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h
+include/clang/Tooling/Refactoring/RefactoringDiagnostic.h
+include/clang/Tooling/Refactoring/RefactoringOption.h
+include/clang/Tooling/Refactoring/RefactoringOptionVisitor.h
+include/clang/Tooling/Refactoring/RefactoringOptions.h
+include/clang/Tooling/Refactoring/RefactoringResultConsumer.h
+include/clang/Tooling/Refactoring/RefactoringRuleContext.h
+include/clang/Tooling/Refactoring/Rename/RenamingAction.h
+include/clang/Tooling/Refactoring/Rename/SymbolName.h
+include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h
+include/clang/Tooling/Refactoring/Rename/USRFinder.h
+include/clang/Tooling/Refactoring/Rename/USRFindingAction.h
+include/clang/Tooling/Refactoring/Rename/USRLocFinder.h
+include/clang/Tooling/RefactoringCallbacks.h
+include/clang/Tooling/ReplacementsYaml.h
+include/clang/Tooling/StandaloneExecution.h
+include/clang/Tooling/Syntax/BuildTree.h
+include/clang/Tooling/Syntax/Mutations.h
+include/clang/Tooling/Syntax/NodeClasses.inc
+include/clang/Tooling/Syntax/Nodes.h
+include/clang/Tooling/Syntax/Nodes.inc
+include/clang/Tooling/Syntax/TokenBufferTokenManager.h
+include/clang/Tooling/Syntax/TokenManager.h
+include/clang/Tooling/Syntax/Tokens.h
+include/clang/Tooling/Syntax/Tree.h
+include/clang/Tooling/ToolExecutorPluginRegistry.h
+include/clang/Tooling/Tooling.h
+include/clang/Tooling/Transformer/MatchConsumer.h
+include/clang/Tooling/Transformer/Parsing.h
+include/clang/Tooling/Transformer/RangeSelector.h
+include/clang/Tooling/Transformer/RewriteRule.h
+include/clang/Tooling/Transformer/SourceCode.h
+include/clang/Tooling/Transformer/SourceCodeBuilders.h
+include/clang/Tooling/Transformer/Stencil.h
+include/clang/Tooling/Transformer/Transformer.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_builtin_vars.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_cmath.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_complex_builtins.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_device_functions.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_intrinsics.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_libdevice_declares.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_math.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_math_forward_declares.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_runtime_wrapper.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_cuda_texture_intrinsics.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_hip_cmath.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_hip_libdevice_declares.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_hip_math.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_hip_runtime_wrapper.h
+lib/clang/${PKGVERSION_MAJOR}/include/__clang_hip_stdlib.h
+lib/clang/${PKGVERSION_MAJOR}/include/__stddef_max_align_t.h
+lib/clang/${PKGVERSION_MAJOR}/include/__wmmintrin_aes.h
+lib/clang/${PKGVERSION_MAJOR}/include/__wmmintrin_pclmul.h
+lib/clang/${PKGVERSION_MAJOR}/include/adxintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/altivec.h
+lib/clang/${PKGVERSION_MAJOR}/include/ammintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/amxfp16intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/amxintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/arm64intr.h
+lib/clang/${PKGVERSION_MAJOR}/include/arm_acle.h
+${PLIST.ARM}lib/clang/${PKGVERSION_MAJOR}/include/arm_bf16.h
+${PLIST.ARM}lib/clang/${PKGVERSION_MAJOR}/include/arm_cde.h
+lib/clang/${PKGVERSION_MAJOR}/include/arm_cmse.h
+${PLIST.ARM}lib/clang/${PKGVERSION_MAJOR}/include/arm_fp16.h
+${PLIST.ARM}lib/clang/${PKGVERSION_MAJOR}/include/arm_mve.h
+${PLIST.ARM}lib/clang/${PKGVERSION_MAJOR}/include/arm_neon.h
+lib/clang/${PKGVERSION_MAJOR}/include/arm_neon_sve_bridge.h
+${PLIST.ARM}lib/clang/${PKGVERSION_MAJOR}/include/arm_sve.h
+lib/clang/${PKGVERSION_MAJOR}/include/armintr.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx2intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512bf16intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512bitalgintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512bwintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512cdintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512dqintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512erintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512fintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512fp16intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512ifmaintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512ifmavlintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512pfintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vbmi2intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vbmiintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vbmivlintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlbf16intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlbitalgintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlbwintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlcdintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vldqintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlfp16intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlvbmi2intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlvnniintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vlvp2intersectintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vnniintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vp2intersectintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vpopcntdqintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avx512vpopcntdqvlintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avxifmaintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avxintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avxneconvertintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avxvnniintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/avxvnniint8intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/bmi2intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/bmiintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/builtins.h
+lib/clang/${PKGVERSION_MAJOR}/include/cet.h
+lib/clang/${PKGVERSION_MAJOR}/include/cetintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/cldemoteintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/clflushoptintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/clwbintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/clzerointrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/cmpccxaddintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/cpuid.h
+lib/clang/${PKGVERSION_MAJOR}/include/crc32intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/cuda_wrappers/algorithm
+lib/clang/${PKGVERSION_MAJOR}/include/cuda_wrappers/complex
+lib/clang/${PKGVERSION_MAJOR}/include/cuda_wrappers/cmath
+lib/clang/${PKGVERSION_MAJOR}/include/cuda_wrappers/new
+lib/clang/${PKGVERSION_MAJOR}/include/emmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/enqcmdintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/f16cintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/float.h
+lib/clang/${PKGVERSION_MAJOR}/include/fma4intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/fmaintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/fxsrintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/gfniintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/hexagon_circ_brev_intrinsics.h
+lib/clang/${PKGVERSION_MAJOR}/include/hexagon_protos.h
+lib/clang/${PKGVERSION_MAJOR}/include/hexagon_types.h
+lib/clang/${PKGVERSION_MAJOR}/include/hresetintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/htmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/htmxlintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/hvx_hexagon_protos.h
+lib/clang/${PKGVERSION_MAJOR}/include/ia32intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/immintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/inttypes.h
+lib/clang/${PKGVERSION_MAJOR}/include/invpcidintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/iso646.h
+lib/clang/${PKGVERSION_MAJOR}/include/keylockerintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/larchintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/limits.h
+lib/clang/${PKGVERSION_MAJOR}/include/lwpintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/lzcntintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/mm3dnow.h
+lib/clang/${PKGVERSION_MAJOR}/include/mm_malloc.h
+lib/clang/${PKGVERSION_MAJOR}/include/mmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/module.modulemap
+lib/clang/${PKGVERSION_MAJOR}/include/movdirintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/msa.h
+lib/clang/${PKGVERSION_MAJOR}/include/mwaitxintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/nmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/opencl-c-base.h
+lib/clang/${PKGVERSION_MAJOR}/include/opencl-c.h
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/__clang_openmp_device_functions.h
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/cmath
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/complex
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/complex.h
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/complex_cmath.h
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/math.h
+lib/clang/${PKGVERSION_MAJOR}/include/openmp_wrappers/new
+lib/clang/${PKGVERSION_MAJOR}/include/pconfigintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/pkuintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/pmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/popcntintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/bmi2intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/bmiintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/emmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/immintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/mm_malloc.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/mmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/pmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/smmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/tmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/x86gprintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/x86intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ppc_wrappers/xmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/prfchiintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/prfchwintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/ptwriteintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/raointintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/rdpruintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/rdseedintrin.h
+${PLIST.RISCV}lib/clang/${PKGVERSION_MAJOR}/include/riscv_vector.h
+lib/clang/${PKGVERSION_MAJOR}/include/rtmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/s390intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/serializeintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/sgxintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/shaintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/smmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/stdalign.h
+lib/clang/${PKGVERSION_MAJOR}/include/stdarg.h
+lib/clang/${PKGVERSION_MAJOR}/include/stdatomic.h
+lib/clang/${PKGVERSION_MAJOR}/include/stdbool.h
+lib/clang/${PKGVERSION_MAJOR}/include/stddef.h
+lib/clang/${PKGVERSION_MAJOR}/include/stdint.h
+lib/clang/${PKGVERSION_MAJOR}/include/stdnoreturn.h
+lib/clang/${PKGVERSION_MAJOR}/include/tbmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/tgmath.h
+lib/clang/${PKGVERSION_MAJOR}/include/tmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/tsxldtrkintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/uintrintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/unwind.h
+lib/clang/${PKGVERSION_MAJOR}/include/vadefs.h
+lib/clang/${PKGVERSION_MAJOR}/include/vaesintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/varargs.h
+lib/clang/${PKGVERSION_MAJOR}/include/vecintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/velintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/velintrin_approx.h
+lib/clang/${PKGVERSION_MAJOR}/include/velintrin_gen.h
+lib/clang/${PKGVERSION_MAJOR}/include/vpclmulqdqintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/waitpkgintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/wasm_simd128.h
+lib/clang/${PKGVERSION_MAJOR}/include/wbnoinvdintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/wmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/x86gprintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/x86intrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xmmintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xopintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xsavecintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xsaveintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xsaveoptintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xsavesintrin.h
+lib/clang/${PKGVERSION_MAJOR}/include/xtestintrin.h
+lib/cmake/clang/AddClang.cmake
+lib/cmake/clang/ClangConfig.cmake
+lib/cmake/clang/ClangConfigVersion.cmake
+lib/cmake/clang/ClangTargets-release.cmake
+lib/cmake/clang/ClangTargets.cmake
+lib/libclang-cpp.${SOEXT}
+${PLIST.notdylib}lib/libclang-cpp.so.${PKGVERSION_MAJOR}
+lib/libclang.${SOEXT}
+${PLIST.notdylib}lib/libclang.${SOEXT}.${PKGVERSION}
+${PLIST.notdylib}lib/libclang.${SOEXT}.${PKGVERSION_MAJOR}
+lib/libclangAPINotes.a
+lib/libclangARCMigrate.a
+lib/libclangAST.a
+lib/libclangASTMatchers.a
+lib/libclangAnalysis.a
+lib/libclangAnalysisFlowSensitive.a
+lib/libclangAnalysisFlowSensitiveModels.a
+lib/libclangBasic.a
+lib/libclangCodeGen.a
+lib/libclangCrossTU.a
+lib/libclangDependencyScanning.a
+lib/libclangDirectoryWatcher.a
+lib/libclangDriver.a
+lib/libclangDynamicASTMatchers.a
+lib/libclangEdit.a
+lib/libclangExtractAPI.a
+lib/libclangFormat.a
+lib/libclangFrontend.a
+lib/libclangFrontendTool.a
+lib/libclangHandleCXX.a
+lib/libclangHandleLLVM.a
+lib/libclangIndex.a
+lib/libclangIndexSerialization.a
+lib/libclangInterpreter.a
+lib/libclangLex.a
+lib/libclangParse.a
+lib/libclangRewrite.a
+lib/libclangRewriteFrontend.a
+lib/libclangSema.a
+lib/libclangSerialization.a
+lib/libclangStaticAnalyzerCheckers.a
+lib/libclangStaticAnalyzerCore.a
+lib/libclangStaticAnalyzerFrontend.a
+lib/libclangSupport.a
+lib/libclangTooling.a
+lib/libclangToolingASTDiff.a
+lib/libclangToolingCore.a
+lib/libclangToolingInclusions.a
+lib/libclangToolingInclusionsStdlib.a
+lib/libclangToolingRefactoring.a
+lib/libclangToolingSyntax.a
+lib/libclangTransformer.a
+lib/libear/__init__.py
+lib/libear/config.h.in
+lib/libear/ear.c
+lib/libscanbuild/__init__.py
+lib/libscanbuild/analyze.py
+lib/libscanbuild/arguments.py
+lib/libscanbuild/clang.py
+lib/libscanbuild/compilation.py
+lib/libscanbuild/intercept.py
+lib/libscanbuild/report.py
+lib/libscanbuild/resources/scanview.css
+lib/libscanbuild/resources/selectable.js
+lib/libscanbuild/resources/sorttable.js
+lib/libscanbuild/shell.py
+libexec/analyze-c++
+libexec/analyze-cc
+libexec/c++-analyzer
+libexec/ccc-analyzer
+libexec/intercept-c++
+libexec/intercept-cc
+man/man1/scan-build.1
+share/clang/bash-autocomplete.sh
+share/clang/clang-format-bbedit.applescript
+share/clang/clang-format-diff.py
+share/clang/clang-format-sublime.py
+share/clang/clang-format.el
+share/clang/clang-format.py
+share/clang/clang-rename.el
+share/clang/clang-rename.py
+share/scan-build/scanview.css
+share/scan-build/sorttable.js
+share/scan-view/Reporter.py
+share/scan-view/ScanView.py
+share/scan-view/bugcatcher.ico
+share/scan-view/startfile.py
diff --git a/clang/PLIST.Darwin b/clang/PLIST.Darwin
new file mode 100644
index 0000000000..73b4f29499
--- /dev/null
+++ b/clang/PLIST.Darwin
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.Darwin,v 1.5 2020/07/01 14:46:37 adam Exp $
+bin/set-xcode-analyzer
diff --git a/clang/buildlink3.mk b/clang/buildlink3.mk
new file mode 100644
index 0000000000..6ca4f079ba
--- /dev/null
+++ b/clang/buildlink3.mk
@@ -0,0 +1,44 @@
+# $NetBSD: buildlink3.mk,v 1.22 2023/04/19 08:08:27 adam Exp $
+
+BUILDLINK_TREE+=	clang
+
+.if !defined(CLANG_BUILDLINK3_MK)
+CLANG_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.clang+=	clang>=14.0
+BUILDLINK_ABI_DEPENDS.clang?=	clang>=15.0.7nb1
+BUILDLINK_PKGSRCDIR.clang?=	../../wip/clang
+
+BUILDLINK_FILES.clang+=		bin/amdgpu-arch
+BUILDLINK_FILES.clang+=		bin/analyze-build
+BUILDLINK_FILES.clang+=		bin/c-index-test
+BUILDLINK_FILES.clang+=		bin/clang
+BUILDLINK_FILES.clang+=		bin/clang++
+BUILDLINK_FILES.clang+=		bin/clang-16
+BUILDLINK_FILES.clang+=		bin/clang-check
+BUILDLINK_FILES.clang+=		bin/clang-cl
+BUILDLINK_FILES.clang+=		bin/clang-cpp
+BUILDLINK_FILES.clang+=		bin/clang-extdef-mapping
+BUILDLINK_FILES.clang+=		bin/clang-format
+BUILDLINK_FILES.clang+=		bin/clang-linker-wrapper
+BUILDLINK_FILES.clang+=		bin/clang-offload-bundler
+BUILDLINK_FILES.clang+=		bin/clang-offload-packager
+BUILDLINK_FILES.clang+=		bin/clang-refactor
+BUILDLINK_FILES.clang+=		bin/clang-rename
+BUILDLINK_FILES.clang+=		bin/clang-repl
+BUILDLINK_FILES.clang+=		bin/clang-scan-deps
+BUILDLINK_FILES.clang+=		bin/diagtool
+BUILDLINK_FILES.clang+=		bin/git-clang-format
+BUILDLINK_FILES.clang+=		bin/hmaptool
+BUILDLINK_FILES.clang+=		bin/intercept-build
+BUILDLINK_FILES.clang+=		bin/nvptx-arch
+BUILDLINK_FILES.clang+=		bin/scan-build
+BUILDLINK_FILES.clang+=		bin/scan-build-py
+BUILDLINK_FILES.clang+=		bin/scan-view
+
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.endif	# CLANG_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-clang
diff --git a/clang/distinfo b/clang/distinfo
new file mode 100644
index 0000000000..a74c78bd45
--- /dev/null
+++ b/clang/distinfo
@@ -0,0 +1,16 @@
+$NetBSD: distinfo,v 1.80 2023/01/12 19:32:53 adam Exp $
+
+BLAKE2s (clang-16.0.1.src.tar.xz) = 3517e431d8fd2f85264397e3f32b753bde963d153fd0bbc3d2598000397ceef4
+SHA512 (clang-16.0.1.src.tar.xz) = c7ef4c386471850f30e194d0a8afe95fdd366c9182b1cdd7653342dcbf72a2b90970c0c4cc900314a26ba131163adec234eec00816207266fbe9c2259d01b61a
+Size (clang-16.0.1.src.tar.xz) = 20355152 bytes
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+SHA1 (patch-lib_Basic_Targets_OSTargets.h) = 02533d1de2c92a431d9c5d4567f348deff056b99
+SHA1 (patch-lib_Driver_ToolChain.cpp) = 33a8e346a72893140fde42245e4b108f3a9b9e3e
+SHA1 (patch-lib_Driver_ToolChains_Solaris.cpp) = 39d72a7f6cb9d0780c9fb79de6d032f320cccce3
+SHA1 (patch-lib_Driver_ToolChains_Solaris.h) = 22d1ddef34b8df3cc29c4632108d45904797aff3
+SHA1 (patch-lib_Interpreter_IncrementalParser.cpp) = c5ace959ce566478316447b1621e9bfd9a537cc5
+SHA1 (patch-lib_Lex_InitHeaderSearch.cpp) = 4f0164da57d66f42c86a812e9b6703712ef7391c
+SHA1 (patch-tools_clang-shlib_CMakeLists.txt) = 2dce9cfc1e114a79fab457211eea1ee93c2198f4
+SHA1 (patch-tools_libclang_CMakeLists.txt) = 7e5655fc753ef20c8b08d1de438b26dcd3434525
diff --git a/clang/patches/patch-lib_Basic_Targets_OSTargets.h b/clang/patches/patch-lib_Basic_Targets_OSTargets.h
new file mode 100644
index 0000000000..97a06a1fdc
--- /dev/null
+++ b/clang/patches/patch-lib_Basic_Targets_OSTargets.h
@@ -0,0 +1,60 @@
+$NetBSD: patch-lib_Basic_Targets_OSTargets.h,v 1.4 2019/10/19 13:54:29 adam Exp $
+
+Sync SunOS default defines with a working reality.
+NetBSD __float128, needed to build anything with base libstdc++
+which assumes __float128.
+
+--- lib/Basic/Targets/OSTargets.h.orig	2019-08-01 08:49:35.000000000 +0000
++++ lib/Basic/Targets/OSTargets.h
+@@ -436,12 +436,22 @@ protected:
+     Builder.defineMacro("__ELF__");
+     if (Opts.POSIXThreads)
+       Builder.defineMacro("_REENTRANT");
++    if (this->HasFloat128)
++      Builder.defineMacro("__FLOAT128__");
+   }
+ 
+ public:
+   NetBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+       : OSTargetInfo<Target>(Triple, Opts) {
+     this->MCountName = "__mcount";
++    switch (Triple.getArch()) {
++    default:
++      break;
++    case llvm::Triple::x86:
++    case llvm::Triple::x86_64:
++      this->HasFloat128 = true;
++      break;
++    }
+   }
+ };
+ 
+@@ -610,22 +620,15 @@ protected:
+     Builder.defineMacro("__ELF__");
+     Builder.defineMacro("__svr4__");
+     Builder.defineMacro("__SVR4");
+-    // Solaris headers require _XOPEN_SOURCE to be set to 600 for C99 and
+-    // newer, but to 500 for everything else.  feature_test.h has a check to
+-    // ensure that you are not using C99 with an old version of X/Open or C89
+-    // with a new version.
+-    if (Opts.C99)
+-      Builder.defineMacro("_XOPEN_SOURCE", "600");
+-    else
+-      Builder.defineMacro("_XOPEN_SOURCE", "500");
++    // Compatibility with GCC to satisfy <sys/feature_tests.h> requirements.
+     if (Opts.CPlusPlus) {
+-      Builder.defineMacro("__C99FEATURES__");
++      Builder.defineMacro("__STDC_VERSION__", "199901L");
++      Builder.defineMacro("_XOPEN_SOURCE", "600");
+       Builder.defineMacro("_FILE_OFFSET_BITS", "64");
++      Builder.defineMacro("_LARGEFILE_SOURCE");
++      Builder.defineMacro("_LARGEFILE64_SOURCE");
++      Builder.defineMacro("__EXTENSIONS__");
+     }
+-    // GCC restricts the next two to C++.
+-    Builder.defineMacro("_LARGEFILE_SOURCE");
+-    Builder.defineMacro("_LARGEFILE64_SOURCE");
+-    Builder.defineMacro("__EXTENSIONS__");
+     if (Opts.POSIXThreads)
+       Builder.defineMacro("_REENTRANT");
+     if (this->HasFloat128)
diff --git a/clang/patches/patch-lib_Driver_ToolChain.cpp b/clang/patches/patch-lib_Driver_ToolChain.cpp
new file mode 100644
index 0000000000..c18216f5d1
--- /dev/null
+++ b/clang/patches/patch-lib_Driver_ToolChain.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_Driver_ToolChain.cpp,v 1.2 2021/07/12 18:42:06 adam Exp $
+
+[LLD] Add NetBSD support as a new flavor of LLD (nb.lld)
+https://reviews.llvm.org/D70048
+
+--- lib/Driver/ToolChain.cpp.orig	2019-07-11 19:06:38.000000000 +0000
++++ lib/Driver/ToolChain.cpp
+@@ -506,6 +506,8 @@ std::string ToolChain::GetLinkerPath() c
+     llvm::SmallString<8> LinkerName;
+     if (Triple.isOSDarwin())
+       LinkerName.append("ld64.");
++    else if (Triple.isOSNetBSD())
++      LinkerName.append("nb.");
+     else
+       LinkerName.append("ld.");
+     LinkerName.append(UseLinker);
diff --git a/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp b/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp
new file mode 100644
index 0000000000..0d91733697
--- /dev/null
+++ b/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp
@@ -0,0 +1,243 @@
+$NetBSD: patch-lib_Driver_ToolChains_Solaris.cpp,v 1.10 2022/11/14 18:44:05 adam Exp $
+
+Use compiler-rt instead of libgcc.
+Pull in libcxx correctly.
+Specify paths to system objects explicitly.
+Don't specify --dynamic-linker, makes it impossible for the user to use -Wl,-r
+Ensure we reset to -zdefaultextract prior to adding compiler-rt.
+Test removing -Bdynamic for golang.
+
+--- lib/Driver/ToolChains/Solaris.cpp.orig	2023-04-05 05:36:38.000000000 +0200
++++ lib/Driver/ToolChains/Solaris.cpp	2023-04-29 00:04:57.086200010 +0200
+@@ -52,8 +52,28 @@
+                                    const InputInfoList &Inputs,
+                                    const ArgList &Args,
+                                    const char *LinkingOutput) const {
++  const Driver &D = getToolChain().getDriver();
+   ArgStringList CmdArgs;
+ 
++  // XXX: assumes pkgsrc layout
++  std::string LibPath = llvm::sys::path::parent_path(D.getInstalledDir()).str();
++  LibPath += "/lib/";
++
++  std::string SysPath = "/usr/lib/";
++  switch (getToolChain().getArch()) {
++  case llvm::Triple::x86:
++  case llvm::Triple::sparc:
++    break;
++  case llvm::Triple::x86_64:
++    SysPath += "amd64/";
++    break;
++  case llvm::Triple::sparcv9:
++    SysPath += "sparcv9/";
++    break;
++  default:
++    llvm_unreachable("Unsupported architecture");
++  }
++
+   // Demangle C++ names in errors
+   CmdArgs.push_back("-C");
+ 
+@@ -66,7 +86,6 @@
+     CmdArgs.push_back("-Bstatic");
+     CmdArgs.push_back("-dn");
+   } else {
+-    CmdArgs.push_back("-Bdynamic");
+     if (Args.hasArg(options::OPT_shared)) {
+       CmdArgs.push_back("-shared");
+     }
+@@ -88,9 +107,9 @@
+                    options::OPT_r)) {
+     if (!Args.hasArg(options::OPT_shared))
+       CmdArgs.push_back(
+-          Args.MakeArgString(getToolChain().GetFilePath("crt1.o")));
++          Args.MakeArgString(SysPath + "crt1.o"));
+ 
+-    CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
++    CmdArgs.push_back(Args.MakeArgString(SysPath + "crti.o"));
+ 
+     const Arg *Std = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi);
+     bool HaveAnsi = false;
+@@ -105,16 +124,14 @@
+     // Use values-Xc.o for -ansi, -std=c*, -std=iso9899:199409.
+     if (HaveAnsi || (LangStd && !LangStd->isGNUMode()))
+       values_X = "values-Xc.o";
+-    CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(values_X)));
++    CmdArgs.push_back(Args.MakeArgString(SysPath + values_X));
+ 
+     const char *values_xpg = "values-xpg6.o";
+     // Use values-xpg4.o for -std=c90, -std=gnu90, -std=iso9899:199409.
+     if (LangStd && LangStd->getLanguage() == Language::C && !LangStd->isC99())
+       values_xpg = "values-xpg4.o";
+     CmdArgs.push_back(
+-        Args.MakeArgString(getToolChain().GetFilePath(values_xpg)));
+-    CmdArgs.push_back(
+-        Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
++        Args.MakeArgString(SysPath + values_xpg));
+     // Add crtfastmath.o if available and fast math is enabled.
+     getToolChain().addFastMathRuntimeIfAvailable(Args, CmdArgs);
+   }
+@@ -129,15 +146,6 @@
+ 
+   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
+                    options::OPT_r)) {
+-    if (getToolChain().ShouldLinkCXXStdlib(Args))
+-      getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
+-    if (Args.hasArg(options::OPT_fstack_protector) ||
+-        Args.hasArg(options::OPT_fstack_protector_strong) ||
+-        Args.hasArg(options::OPT_fstack_protector_all)) {
+-      // Explicitly link ssp libraries, not folded into Solaris libc.
+-      CmdArgs.push_back("-lssp_nonshared");
+-      CmdArgs.push_back("-lssp");
+-    }
+     // LLVM support for atomics on 32-bit SPARC V8+ is incomplete, so
+     // forcibly link with libatomic as a workaround.
+     if (getToolChain().getTriple().getArch() == llvm::Triple::sparc) {
+@@ -145,12 +153,18 @@
+       CmdArgs.push_back("-latomic");
+       CmdArgs.push_back(getAsNeededOption(getToolChain(), false));
+     }
+-    CmdArgs.push_back("-lgcc_s");
+-    CmdArgs.push_back("-lc");
+-    if (!Args.hasArg(options::OPT_shared)) {
+-      CmdArgs.push_back("-lgcc");
++    // This specifically uses -Wl to avoid CMake parsing it and trying to
++    // feed "-zdefaultextract" back into clang, which doesn't support the
++    // non-space version.
++    CmdArgs.push_back("-Wl,-zdefaultextract");
++    AddRunTimeLibs(getToolChain(), D, CmdArgs, Args);
++    CmdArgs.push_back(Args.MakeArgString(LibPath + "libunwind.a"));
++    if (D.CCCIsCXX()) {
++      if (getToolChain().ShouldLinkCXXStdlib(Args))
++        getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
+       CmdArgs.push_back("-lm");
+     }
++    CmdArgs.push_back("-lc");
+     if (NeedsSanitizerDeps) {
+       linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
+ 
+@@ -165,13 +179,7 @@
+     }
+   }
+ 
+-  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
+-                   options::OPT_r)) {
+-    CmdArgs.push_back(
+-        Args.MakeArgString(getToolChain().GetFilePath("crtend.o")));
+-    CmdArgs.push_back(
+-        Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
+-  }
++  CmdArgs.push_back(Args.MakeArgString(SysPath + "crtn.o"));
+ 
+   getToolChain().addProfileRTLibs(Args, CmdArgs);
+ 
+@@ -201,26 +209,9 @@
+                  const ArgList &Args)
+     : Generic_ELF(D, Triple, Args) {
+ 
+-  GCCInstallation.init(Triple, Args);
+-
+-  StringRef LibSuffix = getSolarisLibSuffix(Triple);
+-  path_list &Paths = getFilePaths();
+-  if (GCCInstallation.isValid()) {
+-    // On Solaris gcc uses both an architecture-specific path with triple in it
+-    // as well as a more generic lib path (+arch suffix).
+-    addPathIfExists(D,
+-                    GCCInstallation.getInstallPath() +
+-                        GCCInstallation.getMultilib().gccSuffix(),
+-                    Paths);
+-    addPathIfExists(D, GCCInstallation.getParentLibPath() + LibSuffix, Paths);
+-  }
+-
+-  // If we are currently running Clang inside of the requested system root,
+-  // add its parent library path to those searched.
+-  if (StringRef(D.Dir).startswith(D.SysRoot))
+-    addPathIfExists(D, D.Dir + "/../lib", Paths);
+-
+-  addPathIfExists(D, D.SysRoot + "/usr/lib" + LibSuffix, Paths);
++  // No special handling, the C runtime files are found directly above
++  // and crle handles adding the default system library paths if they
++  // are necessary.
+ }
+ 
+ SanitizerMask Solaris::getSupportedSanitizers() const {
+@@ -245,6 +236,31 @@
+ 
+ Tool *Solaris::buildLinker() const { return new tools::solaris::Linker(*this); }
+ 
++void Solaris::AddCXXStdlibLibArgs(const ArgList &Args,
++                                  ArgStringList &CmdArgs) const {
++  CXXStdlibType Type = GetCXXStdlibType(Args);
++
++  // Currently assumes pkgsrc layout where libcxx and libcxxabi are installed
++  // in the same prefixed directory that we are.
++  std::string LibPath = llvm::sys::path::parent_path(getDriver().getInstalledDir()).str();
++  LibPath += "/lib";
++
++  switch (Type) {
++  case ToolChain::CST_Libcxx:
++    CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
++    CmdArgs.push_back(Args.MakeArgString(StringRef("-R") + LibPath));
++    CmdArgs.push_back("-lc++");
++    CmdArgs.push_back("-lc++abi");
++    break;
++
++  // XXX: This won't work without being told exactly where libstdc++ is, but
++  // that changes based on distribution.  Maybe return ENOTSUP here?
++  case ToolChain::CST_Libstdcxx:
++    CmdArgs.push_back("-lstdc++");
++    break;
++  }
++}
++
+ void Solaris::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
+                                         ArgStringList &CC1Args) const {
+   const Driver &D = getDriver();
+@@ -277,38 +293,20 @@
+     return;
+   }
+ 
+-  // Add include directories specific to the selected multilib set and multilib.
+-  if (GCCInstallation.isValid()) {
+-    const MultilibSet::IncludeDirsFunc &Callback =
+-        Multilibs.includeDirsCallback();
+-    if (Callback) {
+-      for (const auto &Path : Callback(GCCInstallation.getMultilib()))
+-        addExternCSystemIncludeIfExists(
+-            DriverArgs, CC1Args, GCCInstallation.getInstallPath() + Path);
+-    }
+-  }
+-
+   addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
+ }
+ 
+ void Solaris::addLibStdCxxIncludePaths(
+     const llvm::opt::ArgList &DriverArgs,
+     llvm::opt::ArgStringList &CC1Args) const {
+-  // We need a detected GCC installation on Solaris (similar to Linux)
+-  // to provide libstdc++'s headers.
+-  if (!GCCInstallation.isValid())
+-    return;
++  // Location of GCC includes is not reliable so do not support it.
++  return;
++}
+ 
+-  // By default, look for the C++ headers in an include directory adjacent to
+-  // the lib directory of the GCC installation.
+-  // On Solaris this usually looks like /usr/gcc/X.Y/include/c++/X.Y.Z
+-  StringRef LibDir = GCCInstallation.getParentLibPath();
+-  StringRef TripleStr = GCCInstallation.getTriple().str();
+-  const Multilib &Multilib = GCCInstallation.getMultilib();
+-  const GCCVersion &Version = GCCInstallation.getVersion();
+-
+-  // The primary search for libstdc++ supports multiarch variants.
+-  addLibStdCXXIncludePaths(LibDir.str() + "/../include/c++/" + Version.Text,
+-                           TripleStr, Multilib.includeSuffix(), DriverArgs,
+-                           CC1Args);
++void Solaris::addLibCxxIncludePaths(
++     const llvm::opt::ArgList &DriverArgs,
++     llvm::opt::ArgStringList &CC1Args) const {
++  addSystemInclude(DriverArgs, CC1Args,
++                   llvm::sys::path::parent_path(getDriver().getInstalledDir())
++                   + "/include/c++/v1");
+ }
diff --git a/clang/patches/patch-lib_Driver_ToolChains_Solaris.h b/clang/patches/patch-lib_Driver_ToolChains_Solaris.h
new file mode 100644
index 0000000000..80f57c36ca
--- /dev/null
+++ b/clang/patches/patch-lib_Driver_ToolChains_Solaris.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_Driver_ToolChains_Solaris.h,v 1.4 2021/07/12 18:42:06 adam Exp $
+
+Override AddCXXStdlibLibArgs().
+
+--- lib/Driver/ToolChains/Solaris.h.orig	2021-04-06 16:38:18.000000000 +0000
++++ lib/Driver/ToolChains/Solaris.h
+@@ -59,11 +59,17 @@ public:
+                             llvm::opt::ArgStringList &CC1Args) const override;
+ 
+   void
++  addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
++                        llvm::opt::ArgStringList &CC1Args) const override;
++  void
+   addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+                            llvm::opt::ArgStringList &CC1Args) const override;
+ 
+   SanitizerMask getSupportedSanitizers() const override;
+   unsigned GetDefaultDwarfVersion() const override { return 2; }
++  void AddCXXStdlibLibArgs(
++     const llvm::opt::ArgList &Args,
++     llvm::opt::ArgStringList &CmdArgs) const override;
+ 
+   const char *getDefaultLinker() const override {
+     // clang currently uses Solaris ld-only options.
diff --git a/clang/patches/patch-lib_Interpreter_IncrementalParser.cpp b/clang/patches/patch-lib_Interpreter_IncrementalParser.cpp
new file mode 100644
index 0000000000..438da5f15c
--- /dev/null
+++ b/clang/patches/patch-lib_Interpreter_IncrementalParser.cpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_Interpreter_IncrementalParser.cpp,v 1.1 2022/12/27 10:49:42 he Exp $
+
+NetBSD doesn't have ENOTRECOVERABLE, so doesn't have
+std::errc::state_not_recoverable either.  Use
+std::errc::operation_not_supported instead.
+
+--- lib/Interpreter/IncrementalParser.cpp.orig	2022-11-16 06:28:29.000000000 +0000
++++ lib/Interpreter/IncrementalParser.cpp
+@@ -53,7 +53,7 @@ public:
+           switch (CI.getFrontendOpts().ProgramAction) {
+           default:
+             Err = llvm::createStringError(
+-                std::errc::state_not_recoverable,
++                std::errc::operation_not_supported,
+                 "Driver initialization failed. "
+                 "Incremental mode for action %d is not supported",
+                 CI.getFrontendOpts().ProgramAction);
diff --git a/clang/patches/patch-lib_Lex_InitHeaderSearch.cpp b/clang/patches/patch-lib_Lex_InitHeaderSearch.cpp
new file mode 100644
index 0000000000..6d28a4ca49
--- /dev/null
+++ b/clang/patches/patch-lib_Lex_InitHeaderSearch.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_Lex_InitHeaderSearch.cpp,v 1.2 2022/11/14 18:44:05 adam Exp $
+
+Don't add /usr/local/include by default on Solaris.
+was: patch-lib_Frontend_InitHeaderSearch.cpp
+
+--- lib/Lex/InitHeaderSearch.cpp.orig	2023-04-05 05:36:38.000000000 +0200
++++ lib/Lex/InitHeaderSearch.cpp	2023-04-28 23:52:32.313523683 +0200
+@@ -236,6 +236,7 @@
+     case llvm::Triple::PS4:
+     case llvm::Triple::PS5:
+     case llvm::Triple::ELFIAMCU:
++    case llvm::Triple::Solaris:
+       break;
+     case llvm::Triple::Win32:
+       if (triple.getEnvironment() != llvm::Triple::Cygnus)
diff --git a/clang/patches/patch-tools_clang-shlib_CMakeLists.txt b/clang/patches/patch-tools_clang-shlib_CMakeLists.txt
new file mode 100644
index 0000000000..6c9700de3e
--- /dev/null
+++ b/clang/patches/patch-tools_clang-shlib_CMakeLists.txt
@@ -0,0 +1,14 @@
+$NetBSD: patch-tools_clang-shlib_CMakeLists.txt,v 1.2 2022/01/14 08:58:48 tm Exp $
+
+-B flag symbolic-functions is not supported on Solaris before 11.4
+
+--- tools/clang-shlib/CMakeLists.txt.orig	2021-09-24 16:18:10.000000000 +0000
++++ tools/clang-shlib/CMakeLists.txt
+@@ -50,6 +50,6 @@ add_clang_library(clang-cpp
+                   ${_DEPS})
+ # Optimize function calls for default visibility definitions to avoid PLT and
+ # reduce dynamic relocations.
+-if (NOT APPLE AND NOT MINGW)
++if (NOT APPLE AND NOT MINGW AND NOT "SunOS" MATCHES ${CMAKE_SYSTEM_NAME})
+   target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions)
+ endif()
diff --git a/clang/patches/patch-tools_libclang_CMakeLists.txt b/clang/patches/patch-tools_libclang_CMakeLists.txt
new file mode 100644
index 0000000000..56ab216a74
--- /dev/null
+++ b/clang/patches/patch-tools_libclang_CMakeLists.txt
@@ -0,0 +1,34 @@
+$NetBSD: patch-tools_libclang_CMakeLists.txt,v 1.2 2022/01/14 08:58:48 tm Exp $
+
+Only the linker on Solaris 11.4 supports GNU ld version script and only if
+the special option gnu-version-script-compat is used. Older Solaris linker
+doesn't support version script.
+
+--- tools/libclang/CMakeLists.txt.orig	2021-09-24 16:18:10.000000000 +0000
++++ tools/libclang/CMakeLists.txt
+@@ -167,11 +167,21 @@ if(ENABLE_SHARED)
+     endif()
+   endif()
+   if (USE_VERSION_SCRIPT)
+-    target_link_options(libclang PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
+-    # The Solaris 11.4 linker supports a subset of GNU ld version scripts,
+-    # but requires a special option to enable it.
+     if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+-      target_link_options(libclang PRIVATE "-Wl,-z,gnu-version-script-compat")
++      include(CheckLinkerFlag)
++      # The Solaris 11.4 linker supports a subset of GNU ld version scripts,
++      # but requires a special option to enable it.
++      llvm_check_linker_flag(CXX "-Wl,-z,gnu-version-script-compat" LINKER_SUPPORTS_Z_GNU_VERSION_SCRIPT_COMPAT)
++      # Older Solaris (and illumos) linker doesn't support GNU ld version 
++      # and doesn't support GNU version script compat.
++      if (LINKER_SUPPORTS_Z_GNU_VERSION_SCRIPT_COMPAT)
++	target_link_options(libclang PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
++	target_link_options(libclang PRIVATE "-Wl,-z,gnu-version-script-compat")
++      else()
++        target_link_options(libclang PRIVATE "-Wl,-M,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
++      endif()
++    else() 
++      target_link_options(libclang PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
+     endif()
+     # Ensure that libclang.so gets rebuilt when the linker script changes.
+     set_property(SOURCE ARCMigrate.cpp APPEND PROPERTY
diff --git a/compiler-rt/DESCR b/compiler-rt/DESCR
new file mode 100644
index 0000000000..155e7badeb
--- /dev/null
+++ b/compiler-rt/DESCR
@@ -0,0 +1,23 @@
+The compiler-rt project consists of:
+
+ - builtins - a simple library that provides an implementation of the low-level
+   target-specific hooks required by code generation and other runtime
+   components. For example, when compiling for a 32-bit target, converting a
+   double to a 64-bit unsigned integer is compiling into a runtime call to the
+   "__fixunsdfdi" function. The builtins library provides optimized
+   implementations of this and other low-level routines, either in
+   target-independent C form, or as a heavily-optimized assembly.
+
+ - sanitizer runtimes - runtime libraries that are required to run the code
+   with sanitizer instrumentation. This includes runtimes for:
+   *     AddressSanitizer
+   *     ThreadSanitizer
+   *     UndefinedBehaviorSanitizer
+   *     MemorySanitizer
+   *     LeakSanitizer
+   *     DataFlowSanitizer
+
+ - profile - library which is used to collect coverage information.
+
+ - BlocksRuntime - a target-independent implementation of Apple "Blocks"
+   runtime interfaces.
diff --git a/compiler-rt/Makefile b/compiler-rt/Makefile
new file mode 100644
index 0000000000..6ac7e6d132
--- /dev/null
+++ b/compiler-rt/Makefile
@@ -0,0 +1,52 @@
+# $NetBSD: Makefile,v 1.19 2022/11/14 18:44:06 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	compiler-rt-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://compiler-rt.llvm.org/
+COMMENT=	LLVM runtime libraries
+LICENSE=	apache-2.0
+
+NOT_FOR_PLATFORM=	NetBSD-[0-7].*-*
+
+USE_CMAKE=	yes
+USE_LANGUAGES=	c99 c++11
+USE_TOOLS+=	ggrep
+GCC_REQD+=	4.8
+SSP_SUPPORTED=	no
+
+CONFIGURE_DIRS=	${WRKDIR}/build
+CMAKE_ARG_PATH=	${WRKSRC}
+
+OS_DIR=		${OPSYS:tl}
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DCOMPILER_RT_TEST_COMPILER=${PKG_CC:Q}
+CMAKE_ARGS+=	-DCOMPILER_RT_OS_DIR:STRING=${OS_DIR}
+CMAKE_ARGS+=	-DCOMPILER_RT_INSTALL_PATH:STRING=lib/clang/${PKGVERSION_NOREV}
+CMAKE_ARGS+=	-DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q}
+CMAKE_ARGS+=	-DCOMPILER_RT_ENABLE_IOS=OFF
+
+TEST_TARGET=	check-compiler-rt
+
+GENERATE_PLIST+=	find ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \
+			sed 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ;
+
+PYTHON_FOR_BUILD_ONLY=	yes
+
+post-extract:
+	${MKDIR} ${WRKDIR}/build
+
+post-install:
+	cd ${DESTDIR}${PREFIX} && \
+	${FIND} lib/clang/${PKGVERSION_NOREV} -type f -name '*.dylib' \
+		-exec install_name_tool -id ${PREFIX}/{} {} \;
+
+.include "../../devel/googletest/buildlink3.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/compiler-rt/buildlink3.mk b/compiler-rt/buildlink3.mk
new file mode 100644
index 0000000000..8df004a552
--- /dev/null
+++ b/compiler-rt/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.3 2019/12/29 15:31:21 adam Exp $
+
+BUILDLINK_TREE+=	compiler-rt
+
+.if !defined(COMPILER_RT_BUILDLINK3_MK)
+COMPILER_RT_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.compiler-rt+=	compiler-rt>=9.0.1
+BUILDLINK_PKGSRCDIR.compiler-rt?=	../../wip/compiler-rt
+
+.include "../../wip/llvm/buildlink3.mk"
+.endif	# COMPILER_RT_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-compiler-rt
diff --git a/compiler-rt/distinfo b/compiler-rt/distinfo
new file mode 100644
index 0000000000..e854b21709
--- /dev/null
+++ b/compiler-rt/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.23 2023/03/03 09:53:14 wiz Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (compiler-rt-16.0.1.src.tar.xz) = e843323008bb43ee5371b0f8b64c94a9c26b94b1c316ac84d3e7aae83a77763c
+SHA512 (compiler-rt-16.0.1.src.tar.xz) = ca9e076ef47b6298d68d7799896da0fb18148317ddc4b01e26d11b7ee02979bb771e39217611666c771c8177672f951631e5114140c9b3e58fe94e596964a9b9
+Size (compiler-rt-16.0.1.src.tar.xz) = 2354996 bytes
+SHA1 (patch-cmake_config-ix.cmake) = 40ee86393c0f9e26eeaa493c5312d2cabf4c2a58
+SHA1 (patch-lib_asan_CMakeLists.txt) = f91335b88c8c28a25d7dfada85769f799660f82a
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cpp) = 708b4def299a1cc47fca3c48f70745f8528c0fb8
diff --git a/compiler-rt/patches/patch-cmake_config-ix.cmake b/compiler-rt/patches/patch-cmake_config-ix.cmake
new file mode 100644
index 0000000000..c0e22403ec
--- /dev/null
+++ b/compiler-rt/patches/patch-cmake_config-ix.cmake
@@ -0,0 +1,42 @@
+$NetBSD: patch-cmake_config-ix.cmake,v 1.5 2022/08/12 08:58:41 pin Exp $
+
+Disable components that aren't ready for SunOS yet.
+
+--- cmake/config-ix.cmake.orig	2022-06-22 16:46:24.000000000 +0000
++++ cmake/config-ix.cmake
+@@ -668,7 +668,7 @@ set(COMPILER_RT_SANITIZERS_TO_BUILD all 
+ list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}")
+ 
+ if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
+-    (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS" OR
++    (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia" OR
+     (OS_NAME MATCHES "Windows" AND NOT CYGWIN AND
+         (NOT MINGW OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"))))
+   set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
+@@ -688,7 +688,7 @@ else()
+   set(COMPILER_RT_HAS_ASAN FALSE)
+ endif()
+ 
+-if (OS_NAME MATCHES "Linux|FreeBSD|Windows|NetBSD|SunOS")
++if (OS_NAME MATCHES "Linux|FreeBSD|Windows|NetBSD")
+   set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME TRUE)
+ else()
+   set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME FALSE)
+@@ -738,7 +738,7 @@ else()
+ endif()
+ 
+ if (PROFILE_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
+-    OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|SunOS|NetBSD|AIX")
++    OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows|Android|Fuchsia|NetBSD|AIX")
+   set(COMPILER_RT_HAS_PROFILE TRUE)
+ else()
+   set(COMPILER_RT_HAS_PROFILE FALSE)
+@@ -763,7 +763,7 @@ else()
+ endif()
+ 
+ if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND
+-    OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS")
++    OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia")
+   set(COMPILER_RT_HAS_UBSAN TRUE)
+ else()
+   set(COMPILER_RT_HAS_UBSAN FALSE)
diff --git a/compiler-rt/patches/patch-lib_asan_CMakeLists.txt b/compiler-rt/patches/patch-lib_asan_CMakeLists.txt
new file mode 100644
index 0000000000..eea1ec3303
--- /dev/null
+++ b/compiler-rt/patches/patch-lib_asan_CMakeLists.txt
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_asan_CMakeLists.txt,v 1.1 2022/08/12 08:58:41 pin Exp $
+
+Only use optimized asan code on Linux.
+https://github.com/llvm/llvm-project/issues/57086
+
+--- lib/asan/CMakeLists.txt.orig	2022-06-22 16:46:24.000000000 +0000
++++ lib/asan/CMakeLists.txt
+@@ -46,7 +46,7 @@ set(ASAN_STATIC_SOURCES
+   asan_rtl_static.cpp
+   )
+ 
+-if (NOT WIN32 AND NOT APPLE)
++if (LINUX)
+   list(APPEND ASAN_STATIC_SOURCES
+     asan_rtl_x86_64.S
+   )
diff --git a/compiler-rt/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cpp b/compiler-rt/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cpp
new file mode 100644
index 0000000000..25ba372c0d
--- /dev/null
+++ b/compiler-rt/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cpp
@@ -0,0 +1,75 @@
+$NetBSD: patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cpp,v 1.6 2023/03/03 09:53:14 wiz Exp $
+
+urio and smb have been removed from NetBSD.
+upstreamed?
+
+TIOCRCVFRAME and TIOCXMTFRAME as well.
+https://github.com/llvm/llvm-project/issues/61151
+
+--- lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp.orig	2023-01-12 07:12:30.000000000 +0000
++++ lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
+@@ -957,12 +957,14 @@ unsigned struct_session_op_sz = sizeof(s
+ unsigned struct_sgttyb_sz = sizeof(sgttyb);
+ unsigned struct_sioc_sg_req_sz = sizeof(sioc_sg_req);
+ unsigned struct_sioc_vif_req_sz = sizeof(sioc_vif_req);
++#if __NetBSD_Version__ < 999000000
+ unsigned struct_smbioc_flags_sz = sizeof(smbioc_flags);
+ unsigned struct_smbioc_lookup_sz = sizeof(smbioc_lookup);
+ unsigned struct_smbioc_oshare_sz = sizeof(smbioc_oshare);
+ unsigned struct_smbioc_ossn_sz = sizeof(smbioc_ossn);
+ unsigned struct_smbioc_rq_sz = sizeof(smbioc_rq);
+ unsigned struct_smbioc_rw_sz = sizeof(smbioc_rw);
++#endif
+ unsigned struct_spppauthcfg_sz = sizeof(spppauthcfg);
+ unsigned struct_spppauthfailuresettings_sz = sizeof(spppauthfailuresettings);
+ unsigned struct_spppauthfailurestats_sz = sizeof(spppauthfailurestats);
+@@ -987,7 +989,9 @@ unsigned struct_twe_drivecommand_sz = si
+ unsigned struct_twe_paramcommand_sz = sizeof(twe_paramcommand);
+ unsigned struct_twe_usercommand_sz = sizeof(twe_usercommand);
+ unsigned struct_ukyopon_identify_sz = sizeof(ukyopon_identify);
++#if __NetBSD_Version__ < 999000000
+ unsigned struct_urio_command_sz = sizeof(urio_command);
++#endif
+ unsigned struct_usb_alt_interface_sz = sizeof(usb_alt_interface);
+ unsigned struct_usb_bulk_ra_wb_opt_sz = sizeof(usb_bulk_ra_wb_opt);
+ unsigned struct_usb_config_desc_sz = sizeof(usb_config_desc);
+@@ -1576,8 +1580,10 @@ unsigned IOCTL_STICIO_RESET = STICIO_RES
+ unsigned IOCTL_STICIO_STARTQ = STICIO_STARTQ;
+ unsigned IOCTL_STICIO_STOPQ = STICIO_STOPQ;
+ unsigned IOCTL_UKYOPON_IDENTIFY = UKYOPON_IDENTIFY;
++#if __NetBSD_Version__ < 999000000
+ unsigned IOCTL_URIO_SEND_COMMAND = URIO_SEND_COMMAND;
+ unsigned IOCTL_URIO_RECV_COMMAND = URIO_RECV_COMMAND;
++#endif
+ unsigned IOCTL_USB_REQUEST = USB_REQUEST;
+ unsigned IOCTL_USB_SETDEBUG = USB_SETDEBUG;
+ unsigned IOCTL_USB_DISCOVER = USB_DISCOVER;
+@@ -1962,6 +1968,7 @@ unsigned IOCTL_SIOCCONNECTXDEL = SIOCCON
+ unsigned IOCTL_SIOCSIFINFO_FLAGS = SIOCSIFINFO_FLAGS;
+ unsigned IOCTL_SIOCAADDRCTL_POLICY = SIOCAADDRCTL_POLICY;
+ unsigned IOCTL_SIOCDADDRCTL_POLICY = SIOCDADDRCTL_POLICY;
++#if __NetBSD_Version__ < 999000000
+ unsigned IOCTL_SMBIOC_OPENSESSION = SMBIOC_OPENSESSION;
+ unsigned IOCTL_SMBIOC_OPENSHARE = SMBIOC_OPENSHARE;
+ unsigned IOCTL_SMBIOC_REQUEST = SMBIOC_REQUEST;
+@@ -1969,6 +1976,7 @@ unsigned IOCTL_SMBIOC_SETFLAGS = SMBIOC_
+ unsigned IOCTL_SMBIOC_LOOKUP = SMBIOC_LOOKUP;
+ unsigned IOCTL_SMBIOC_READ = SMBIOC_READ;
+ unsigned IOCTL_SMBIOC_WRITE = SMBIOC_WRITE;
++#endif
+ unsigned IOCTL_AGPIOC_INFO = AGPIOC_INFO;
+ unsigned IOCTL_AGPIOC_ACQUIRE = AGPIOC_ACQUIRE;
+ unsigned IOCTL_AGPIOC_RELEASE = AGPIOC_RELEASE;
+@@ -2342,8 +2350,12 @@ unsigned IOCTL_TIOCDRAIN = TIOCDRAIN;
+ unsigned IOCTL_TIOCGFLAGS = TIOCGFLAGS;
+ unsigned IOCTL_TIOCSFLAGS = TIOCSFLAGS;
+ unsigned IOCTL_TIOCDCDTIMESTAMP = TIOCDCDTIMESTAMP;
++#ifdef TIOCRCVFRAME
+ unsigned IOCTL_TIOCRCVFRAME = TIOCRCVFRAME;
++#endif
++#ifdef TIOCXMTFRAME
+ unsigned IOCTL_TIOCXMTFRAME = TIOCXMTFRAME;
++#endif
+ unsigned IOCTL_TIOCPTMGET = TIOCPTMGET;
+ unsigned IOCTL_TIOCGRANTPT = TIOCGRANTPT;
+ unsigned IOCTL_TIOCPTSNAME = TIOCPTSNAME;
diff --git a/include-what-you-use/DESCR b/include-what-you-use/DESCR
new file mode 100644
index 0000000000..a6a9330b5e
--- /dev/null
+++ b/include-what-you-use/DESCR
@@ -0,0 +1,11 @@
+"Include what you use" means this: for every symbol (type, function
+variable, or macro) that you use in foo.cc, either foo.cc or foo.h
+should #include a .h file that exports the declaration of that symbol.
+The include-what-you-use tool is a program that can be built with the
+clang libraries in order to analyze #includes of source files to find
+include-what-you-use violations, and suggest fixes for them.
+
+The main goal of include-what-you-use is to remove superfluous #includes.
+It does this both by figuring out what #includes are not actually needed for
+this file (for both .cc and .h files), and replacing #includes with
+forward-declares when possible.
diff --git a/include-what-you-use/Makefile b/include-what-you-use/Makefile
new file mode 100644
index 0000000000..d37d3a4145
--- /dev/null
+++ b/include-what-you-use/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.34 2023/04/19 08:09:41 adam Exp $
+
+DISTNAME=	include-what-you-use-0.20
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=include-what-you-use/}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://include-what-you-use.org/
+COMMENT=	Analyze \#includes in C and C++ source files
+LICENSE=	modified-bsd
+
+USE_CMAKE=	yes
+USE_LANGUAGES=	c c++14
+
+GCC_REQD+=	5
+
+CMAKE_ARGS=	-DIWYU_LLVM_ROOT_PATH:PATH=${BUILDLINK_PREFIX.clang}
+
+REPLACE_PYTHON=	*.py
+
+.include "../../wip/clang/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/include-what-you-use/PLIST b/include-what-you-use/PLIST
new file mode 100644
index 0000000000..63a5ae3096
--- /dev/null
+++ b/include-what-you-use/PLIST
@@ -0,0 +1,24 @@
+@comment $NetBSD: PLIST,v 1.7 2021/07/12 18:49:29 adam Exp $
+bin/fix_includes.py
+bin/include-what-you-use
+bin/iwyu_tool.py
+man/man1/include-what-you-use.1
+share/include-what-you-use/boost-1.64-all-private.imp
+share/include-what-you-use/boost-1.64-all.imp
+share/include-what-you-use/boost-1.75-all-private.imp
+share/include-what-you-use/boost-1.75-all.imp
+share/include-what-you-use/boost-all-private.imp
+share/include-what-you-use/boost-all.imp
+share/include-what-you-use/clang-6.intrinsics.imp
+share/include-what-you-use/gcc-8.intrinsics.imp
+share/include-what-you-use/gcc.libc.imp
+share/include-what-you-use/gcc.stl.headers.imp
+share/include-what-you-use/gcc.symbols.imp
+share/include-what-you-use/iwyu.gcc.imp
+share/include-what-you-use/libcxx.imp
+share/include-what-you-use/python2.7.imp
+share/include-what-you-use/python3.8.imp
+share/include-what-you-use/qt4.imp
+share/include-what-you-use/qt5_11.imp
+share/include-what-you-use/qt5_4.imp
+share/include-what-you-use/stl.c.headers.imp
diff --git a/include-what-you-use/distinfo b/include-what-you-use/distinfo
new file mode 100644
index 0000000000..9215c4ff8a
--- /dev/null
+++ b/include-what-you-use/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.19 2022/11/14 18:53:25 adam Exp $
+
+BLAKE2s (include-what-you-use-0.20.tar.gz) = e9b4ce706a4be37a2e78df9be04c2c94de1bedc622da27bcb7a4d93c82dcb46e
+SHA512 (include-what-you-use-0.20.tar.gz) = 77195dc36338a37d3397c78701d81e52fc1c6a3441979fa016f154b0fc860598959e6430e78a51bbf9049f6b2bb62956e50f5531ac5c94c6554e2383ace540f5
+Size (include-what-you-use-0.20.tar.gz) = 766208 bytes
diff --git a/libcxx/DESCR b/libcxx/DESCR
new file mode 100644
index 0000000000..34fd1f90e1
--- /dev/null
+++ b/libcxx/DESCR
@@ -0,0 +1,11 @@
+libc++ is a new implementation of the C++ standard library, targeting
+C++11.
+
+Features and Goals
+ * Correctness as defined by the C++11 standard.
+ * Fast execution.
+ * Minimal memory use.
+ * Fast compile times.
+ * ABI compatibility with gcc's libstdc++ for some low-level features
+   such as exception objects, rtti and memory allocation.
+ * Extensive unit tests.
diff --git a/libcxx/Makefile b/libcxx/Makefile
new file mode 100644
index 0000000000..dd882cd367
--- /dev/null
+++ b/libcxx/Makefile
@@ -0,0 +1,56 @@
+# $NetBSD: Makefile,v 1.17 2022/12/07 10:40:34 jperkin Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	libcxx-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://libcxx.llvm.org/
+COMMENT=	C++ Standard Library
+LICENSE=	apache-2.0
+
+# libcxx requires libcxxabi's cxxabi.h to build, but libcxxabi requires
+# libcxx's includes to build, so we have this unholy extra distfiles thing
+# in both of them to get them to build against each other without causing
+# circular dependencies.  This must be kept in sync with libcxxabi/Makefile.
+LIBCXXABI=	libcxxabi-${LLVM_VERSION}.src
+EXTRA_DIST+=	${LIBCXXABI}${EXTRACT_SUFX}
+
+SITES.${LIBCXXABI}${EXTRACT_SUFX}=	\
+	${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+
+CONFIGURE_DIRS=	build
+CMAKE_ARG_PATH=	${WRKSRC}
+
+USE_LANGUAGES=	c c++20
+USE_CMAKE=	yes
+SSP_SUPPORTED=	no
+GCC_REQD+=	10
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DLIBCXX_CXX_ABI=system-libcxxabi
+CMAKE_ARGS+=	-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${WRKDIR}/${LIBCXXABI}/include
+CMAKE_ARGS+=	-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+CMAKE_ARGS+=	-DLIBCXX_INCLUDE_BENCHMARKS=OFF
+
+# avoid conflict with stddef.h
+CXXFLAGS.NetBSD+=	-D__DEFINED_max_align_t=1
+
+CXXFLAGS.SunOS+=	-D_LIBCPP_NO_ABI_TAG=1
+
+.include "../../mk/compiler.mk"
+
+.if !empty(CC_VERSION:Mgcc-[0-9].*) || !empty(CC_VERSION:Mgcc-10.*)
+# Avoid GCC < 11 error https://github.com/llvm/llvm-project/issues/54018
+CXXFLAGS+=		-std=c++17 -D_LIBCPP_STD_VER=17
+.endif
+
+post-extract:
+	${MKDIR} ${WRKSRC}/build
+	${LN} -f -s ${WRKDIR}/${LIBCXXABI} ${WRKDIR}/libcxxabi
+
+.include "../../wip/libcxxabi/buildlink3.mk"
+.include "../../wip/libunwind/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libcxx/PLIST b/libcxx/PLIST
new file mode 100644
index 0000000000..2060768236
--- /dev/null
+++ b/libcxx/PLIST
@@ -0,0 +1,796 @@
+@comment $NetBSD: PLIST,v 1.9 2022/11/14 18:44:06 adam Exp $
+include/c++/v1/__algorithm/adjacent_find.h
+include/c++/v1/__algorithm/all_of.h
+include/c++/v1/__algorithm/any_of.h
+include/c++/v1/__algorithm/binary_search.h
+include/c++/v1/__algorithm/clamp.h
+include/c++/v1/__algorithm/comp.h
+include/c++/v1/__algorithm/comp_ref_type.h
+include/c++/v1/__algorithm/copy.h
+include/c++/v1/__algorithm/copy_backward.h
+include/c++/v1/__algorithm/copy_if.h
+include/c++/v1/__algorithm/copy_n.h
+include/c++/v1/__algorithm/count.h
+include/c++/v1/__algorithm/count_if.h
+include/c++/v1/__algorithm/equal.h
+include/c++/v1/__algorithm/equal_range.h
+include/c++/v1/__algorithm/fill.h
+include/c++/v1/__algorithm/fill_n.h
+include/c++/v1/__algorithm/find.h
+include/c++/v1/__algorithm/find_end.h
+include/c++/v1/__algorithm/find_first_of.h
+include/c++/v1/__algorithm/find_if.h
+include/c++/v1/__algorithm/find_if_not.h
+include/c++/v1/__algorithm/for_each.h
+include/c++/v1/__algorithm/for_each_n.h
+include/c++/v1/__algorithm/generate.h
+include/c++/v1/__algorithm/generate_n.h
+include/c++/v1/__algorithm/half_positive.h
+include/c++/v1/__algorithm/in_found_result.h
+include/c++/v1/__algorithm/in_fun_result.h
+include/c++/v1/__algorithm/in_in_out_result.h
+include/c++/v1/__algorithm/in_in_result.h
+include/c++/v1/__algorithm/in_out_out_result.h
+include/c++/v1/__algorithm/in_out_result.h
+include/c++/v1/__algorithm/includes.h
+include/c++/v1/__algorithm/inplace_merge.h
+include/c++/v1/__algorithm/is_heap.h
+include/c++/v1/__algorithm/is_heap_until.h
+include/c++/v1/__algorithm/is_partitioned.h
+include/c++/v1/__algorithm/is_permutation.h
+include/c++/v1/__algorithm/is_sorted.h
+include/c++/v1/__algorithm/is_sorted_until.h
+include/c++/v1/__algorithm/iter_swap.h
+include/c++/v1/__algorithm/iterator_operations.h
+include/c++/v1/__algorithm/lexicographical_compare.h
+include/c++/v1/__algorithm/lower_bound.h
+include/c++/v1/__algorithm/make_heap.h
+include/c++/v1/__algorithm/make_projected.h
+include/c++/v1/__algorithm/max.h
+include/c++/v1/__algorithm/max_element.h
+include/c++/v1/__algorithm/merge.h
+include/c++/v1/__algorithm/min.h
+include/c++/v1/__algorithm/min_element.h
+include/c++/v1/__algorithm/min_max_result.h
+include/c++/v1/__algorithm/minmax.h
+include/c++/v1/__algorithm/minmax_element.h
+include/c++/v1/__algorithm/mismatch.h
+include/c++/v1/__algorithm/move.h
+include/c++/v1/__algorithm/move_backward.h
+include/c++/v1/__algorithm/next_permutation.h
+include/c++/v1/__algorithm/none_of.h
+include/c++/v1/__algorithm/nth_element.h
+include/c++/v1/__algorithm/partial_sort.h
+include/c++/v1/__algorithm/partial_sort_copy.h
+include/c++/v1/__algorithm/partition.h
+include/c++/v1/__algorithm/partition_copy.h
+include/c++/v1/__algorithm/partition_point.h
+include/c++/v1/__algorithm/pop_heap.h
+include/c++/v1/__algorithm/prev_permutation.h
+include/c++/v1/__algorithm/push_heap.h
+include/c++/v1/__algorithm/ranges_adjacent_find.h
+include/c++/v1/__algorithm/ranges_all_of.h
+include/c++/v1/__algorithm/ranges_any_of.h
+include/c++/v1/__algorithm/ranges_binary_search.h
+include/c++/v1/__algorithm/ranges_clamp.h
+include/c++/v1/__algorithm/ranges_copy.h
+include/c++/v1/__algorithm/ranges_copy_backward.h
+include/c++/v1/__algorithm/ranges_copy_if.h
+include/c++/v1/__algorithm/ranges_copy_n.h
+include/c++/v1/__algorithm/ranges_count.h
+include/c++/v1/__algorithm/ranges_count_if.h
+include/c++/v1/__algorithm/ranges_equal.h
+include/c++/v1/__algorithm/ranges_equal_range.h
+include/c++/v1/__algorithm/ranges_fill.h
+include/c++/v1/__algorithm/ranges_fill_n.h
+include/c++/v1/__algorithm/ranges_find.h
+include/c++/v1/__algorithm/ranges_find_end.h
+include/c++/v1/__algorithm/ranges_find_first_of.h
+include/c++/v1/__algorithm/ranges_find_if.h
+include/c++/v1/__algorithm/ranges_find_if_not.h
+include/c++/v1/__algorithm/ranges_for_each.h
+include/c++/v1/__algorithm/ranges_for_each_n.h
+include/c++/v1/__algorithm/ranges_generate.h
+include/c++/v1/__algorithm/ranges_generate_n.h
+include/c++/v1/__algorithm/ranges_includes.h
+include/c++/v1/__algorithm/ranges_inplace_merge.h
+include/c++/v1/__algorithm/ranges_is_heap.h
+include/c++/v1/__algorithm/ranges_is_heap_until.h
+include/c++/v1/__algorithm/ranges_is_partitioned.h
+include/c++/v1/__algorithm/ranges_is_permutation.h
+include/c++/v1/__algorithm/ranges_is_sorted.h
+include/c++/v1/__algorithm/ranges_is_sorted_until.h
+include/c++/v1/__algorithm/ranges_iterator_concept.h
+include/c++/v1/__algorithm/ranges_lexicographical_compare.h
+include/c++/v1/__algorithm/ranges_lower_bound.h
+include/c++/v1/__algorithm/ranges_make_heap.h
+include/c++/v1/__algorithm/ranges_max.h
+include/c++/v1/__algorithm/ranges_max_element.h
+include/c++/v1/__algorithm/ranges_merge.h
+include/c++/v1/__algorithm/ranges_min.h
+include/c++/v1/__algorithm/ranges_min_element.h
+include/c++/v1/__algorithm/ranges_minmax.h
+include/c++/v1/__algorithm/ranges_minmax_element.h
+include/c++/v1/__algorithm/ranges_mismatch.h
+include/c++/v1/__algorithm/ranges_move.h
+include/c++/v1/__algorithm/ranges_move_backward.h
+include/c++/v1/__algorithm/ranges_next_permutation.h
+include/c++/v1/__algorithm/ranges_none_of.h
+include/c++/v1/__algorithm/ranges_nth_element.h
+include/c++/v1/__algorithm/ranges_partial_sort.h
+include/c++/v1/__algorithm/ranges_partial_sort_copy.h
+include/c++/v1/__algorithm/ranges_partition.h
+include/c++/v1/__algorithm/ranges_partition_copy.h
+include/c++/v1/__algorithm/ranges_partition_point.h
+include/c++/v1/__algorithm/ranges_pop_heap.h
+include/c++/v1/__algorithm/ranges_prev_permutation.h
+include/c++/v1/__algorithm/ranges_push_heap.h
+include/c++/v1/__algorithm/ranges_remove.h
+include/c++/v1/__algorithm/ranges_remove_copy.h
+include/c++/v1/__algorithm/ranges_remove_copy_if.h
+include/c++/v1/__algorithm/ranges_remove_if.h
+include/c++/v1/__algorithm/ranges_replace.h
+include/c++/v1/__algorithm/ranges_replace_copy.h
+include/c++/v1/__algorithm/ranges_replace_copy_if.h
+include/c++/v1/__algorithm/ranges_replace_if.h
+include/c++/v1/__algorithm/ranges_reverse.h
+include/c++/v1/__algorithm/ranges_reverse_copy.h
+include/c++/v1/__algorithm/ranges_rotate.h
+include/c++/v1/__algorithm/ranges_rotate_copy.h
+include/c++/v1/__algorithm/ranges_sample.h
+include/c++/v1/__algorithm/ranges_search.h
+include/c++/v1/__algorithm/ranges_search_n.h
+include/c++/v1/__algorithm/ranges_set_difference.h
+include/c++/v1/__algorithm/ranges_set_intersection.h
+include/c++/v1/__algorithm/ranges_set_symmetric_difference.h
+include/c++/v1/__algorithm/ranges_set_union.h
+include/c++/v1/__algorithm/ranges_shuffle.h
+include/c++/v1/__algorithm/ranges_sort.h
+include/c++/v1/__algorithm/ranges_sort_heap.h
+include/c++/v1/__algorithm/ranges_stable_partition.h
+include/c++/v1/__algorithm/ranges_stable_sort.h
+include/c++/v1/__algorithm/ranges_swap_ranges.h
+include/c++/v1/__algorithm/ranges_transform.h
+include/c++/v1/__algorithm/ranges_unique.h
+include/c++/v1/__algorithm/ranges_unique_copy.h
+include/c++/v1/__algorithm/ranges_upper_bound.h
+include/c++/v1/__algorithm/remove.h
+include/c++/v1/__algorithm/remove_copy.h
+include/c++/v1/__algorithm/remove_copy_if.h
+include/c++/v1/__algorithm/remove_if.h
+include/c++/v1/__algorithm/replace.h
+include/c++/v1/__algorithm/replace_copy.h
+include/c++/v1/__algorithm/replace_copy_if.h
+include/c++/v1/__algorithm/replace_if.h
+include/c++/v1/__algorithm/reverse.h
+include/c++/v1/__algorithm/reverse_copy.h
+include/c++/v1/__algorithm/rotate.h
+include/c++/v1/__algorithm/rotate_copy.h
+include/c++/v1/__algorithm/sample.h
+include/c++/v1/__algorithm/search.h
+include/c++/v1/__algorithm/search_n.h
+include/c++/v1/__algorithm/set_difference.h
+include/c++/v1/__algorithm/set_intersection.h
+include/c++/v1/__algorithm/set_symmetric_difference.h
+include/c++/v1/__algorithm/set_union.h
+include/c++/v1/__algorithm/shift_left.h
+include/c++/v1/__algorithm/shift_right.h
+include/c++/v1/__algorithm/shuffle.h
+include/c++/v1/__algorithm/sift_down.h
+include/c++/v1/__algorithm/sort.h
+include/c++/v1/__algorithm/sort_heap.h
+include/c++/v1/__algorithm/stable_partition.h
+include/c++/v1/__algorithm/stable_sort.h
+include/c++/v1/__algorithm/swap_ranges.h
+include/c++/v1/__algorithm/transform.h
+include/c++/v1/__algorithm/uniform_random_bit_generator_adaptor.h
+include/c++/v1/__algorithm/unique.h
+include/c++/v1/__algorithm/unique_copy.h
+include/c++/v1/__algorithm/unwrap_iter.h
+include/c++/v1/__algorithm/unwrap_range.h
+include/c++/v1/__algorithm/upper_bound.h
+include/c++/v1/__assert
+include/c++/v1/__availability
+include/c++/v1/__bit/bit_cast.h
+include/c++/v1/__bit/byteswap.h
+include/c++/v1/__bit_reference
+include/c++/v1/__bits
+include/c++/v1/__bsd_locale_defaults.h
+include/c++/v1/__bsd_locale_fallbacks.h
+include/c++/v1/__charconv/chars_format.h
+include/c++/v1/__charconv/from_chars_result.h
+include/c++/v1/__charconv/tables.h
+include/c++/v1/__charconv/to_chars_base_10.h
+include/c++/v1/__charconv/to_chars_result.h
+include/c++/v1/__chrono/calendar.h
+include/c++/v1/__chrono/convert_to_timespec.h
+include/c++/v1/__chrono/day.h
+include/c++/v1/__chrono/duration.h
+include/c++/v1/__chrono/file_clock.h
+include/c++/v1/__chrono/hh_mm_ss.h
+include/c++/v1/__chrono/high_resolution_clock.h
+include/c++/v1/__chrono/literals.h
+include/c++/v1/__chrono/month.h
+include/c++/v1/__chrono/month_weekday.h
+include/c++/v1/__chrono/monthday.h
+include/c++/v1/__chrono/steady_clock.h
+include/c++/v1/__chrono/system_clock.h
+include/c++/v1/__chrono/time_point.h
+include/c++/v1/__chrono/weekday.h
+include/c++/v1/__chrono/year.h
+include/c++/v1/__chrono/year_month.h
+include/c++/v1/__chrono/year_month_day.h
+include/c++/v1/__chrono/year_month_weekday.h
+include/c++/v1/__compare/common_comparison_category.h
+include/c++/v1/__compare/compare_partial_order_fallback.h
+include/c++/v1/__compare/compare_strong_order_fallback.h
+include/c++/v1/__compare/compare_three_way.h
+include/c++/v1/__compare/compare_three_way_result.h
+include/c++/v1/__compare/compare_weak_order_fallback.h
+include/c++/v1/__compare/is_eq.h
+include/c++/v1/__compare/ordering.h
+include/c++/v1/__compare/partial_order.h
+include/c++/v1/__compare/strong_order.h
+include/c++/v1/__compare/synth_three_way.h
+include/c++/v1/__compare/three_way_comparable.h
+include/c++/v1/__compare/weak_order.h
+include/c++/v1/__concepts/arithmetic.h
+include/c++/v1/__concepts/assignable.h
+include/c++/v1/__concepts/boolean_testable.h
+include/c++/v1/__concepts/class_or_enum.h
+include/c++/v1/__concepts/common_reference_with.h
+include/c++/v1/__concepts/common_with.h
+include/c++/v1/__concepts/constructible.h
+include/c++/v1/__concepts/convertible_to.h
+include/c++/v1/__concepts/copyable.h
+include/c++/v1/__concepts/derived_from.h
+include/c++/v1/__concepts/destructible.h
+include/c++/v1/__concepts/different_from.h
+include/c++/v1/__concepts/equality_comparable.h
+include/c++/v1/__concepts/invocable.h
+include/c++/v1/__concepts/movable.h
+include/c++/v1/__concepts/predicate.h
+include/c++/v1/__concepts/regular.h
+include/c++/v1/__concepts/relation.h
+include/c++/v1/__concepts/same_as.h
+include/c++/v1/__concepts/semiregular.h
+include/c++/v1/__concepts/swappable.h
+include/c++/v1/__concepts/totally_ordered.h
+include/c++/v1/__config
+include/c++/v1/__config_site
+include/c++/v1/__coroutine/coroutine_handle.h
+include/c++/v1/__coroutine/coroutine_traits.h
+include/c++/v1/__coroutine/noop_coroutine_handle.h
+include/c++/v1/__coroutine/trivial_awaitables.h
+include/c++/v1/__debug
+include/c++/v1/__debug_utils/randomize_range.h
+include/c++/v1/__errc
+include/c++/v1/__filesystem/copy_options.h
+include/c++/v1/__filesystem/directory_entry.h
+include/c++/v1/__filesystem/directory_iterator.h
+include/c++/v1/__filesystem/directory_options.h
+include/c++/v1/__filesystem/file_status.h
+include/c++/v1/__filesystem/file_time_type.h
+include/c++/v1/__filesystem/file_type.h
+include/c++/v1/__filesystem/filesystem_error.h
+include/c++/v1/__filesystem/operations.h
+include/c++/v1/__filesystem/path.h
+include/c++/v1/__filesystem/path_iterator.h
+include/c++/v1/__filesystem/perm_options.h
+include/c++/v1/__filesystem/perms.h
+include/c++/v1/__filesystem/recursive_directory_iterator.h
+include/c++/v1/__filesystem/space_info.h
+include/c++/v1/__filesystem/u8path.h
+include/c++/v1/__format/buffer.h
+include/c++/v1/__format/concepts.h
+include/c++/v1/__format/enable_insertable.h
+include/c++/v1/__format/extended_grapheme_cluster_table.h
+include/c++/v1/__format/format_arg.h
+include/c++/v1/__format/format_arg_store.h
+include/c++/v1/__format/format_args.h
+include/c++/v1/__format/format_context.h
+include/c++/v1/__format/format_error.h
+include/c++/v1/__format/format_fwd.h
+include/c++/v1/__format/format_parse_context.h
+include/c++/v1/__format/format_string.h
+include/c++/v1/__format/format_to_n_result.h
+include/c++/v1/__format/formatter.h
+include/c++/v1/__format/formatter_bool.h
+include/c++/v1/__format/formatter_char.h
+include/c++/v1/__format/formatter_floating_point.h
+include/c++/v1/__format/formatter_integer.h
+include/c++/v1/__format/formatter_integral.h
+include/c++/v1/__format/formatter_output.h
+include/c++/v1/__format/formatter_pointer.h
+include/c++/v1/__format/formatter_string.h
+include/c++/v1/__format/parser_std_format_spec.h
+include/c++/v1/__format/unicode.h
+include/c++/v1/__functional/binary_function.h
+include/c++/v1/__functional/binary_negate.h
+include/c++/v1/__functional/bind.h
+include/c++/v1/__functional/bind_back.h
+include/c++/v1/__functional/bind_front.h
+include/c++/v1/__functional/binder1st.h
+include/c++/v1/__functional/binder2nd.h
+include/c++/v1/__functional/boyer_moore_searcher.h
+include/c++/v1/__functional/compose.h
+include/c++/v1/__functional/default_searcher.h
+include/c++/v1/__functional/function.h
+include/c++/v1/__functional/hash.h
+include/c++/v1/__functional/identity.h
+include/c++/v1/__functional/invoke.h
+include/c++/v1/__functional/is_transparent.h
+include/c++/v1/__functional/mem_fn.h
+include/c++/v1/__functional/mem_fun_ref.h
+include/c++/v1/__functional/not_fn.h
+include/c++/v1/__functional/operations.h
+include/c++/v1/__functional/perfect_forward.h
+include/c++/v1/__functional/pointer_to_binary_function.h
+include/c++/v1/__functional/pointer_to_unary_function.h
+include/c++/v1/__functional/ranges_operations.h
+include/c++/v1/__functional/reference_wrapper.h
+include/c++/v1/__functional/unary_function.h
+include/c++/v1/__functional/unary_negate.h
+include/c++/v1/__functional/unwrap_ref.h
+include/c++/v1/__functional/weak_result_type.h
+include/c++/v1/__fwd/span.h
+include/c++/v1/__fwd/string_view.h
+include/c++/v1/__hash_table
+include/c++/v1/__ios/fpos.h
+include/c++/v1/__iterator/access.h
+include/c++/v1/__iterator/advance.h
+include/c++/v1/__iterator/back_insert_iterator.h
+include/c++/v1/__iterator/bounded_iter.h
+include/c++/v1/__iterator/common_iterator.h
+include/c++/v1/__iterator/concepts.h
+include/c++/v1/__iterator/counted_iterator.h
+include/c++/v1/__iterator/data.h
+include/c++/v1/__iterator/default_sentinel.h
+include/c++/v1/__iterator/distance.h
+include/c++/v1/__iterator/empty.h
+include/c++/v1/__iterator/erase_if_container.h
+include/c++/v1/__iterator/front_insert_iterator.h
+include/c++/v1/__iterator/incrementable_traits.h
+include/c++/v1/__iterator/indirectly_comparable.h
+include/c++/v1/__iterator/insert_iterator.h
+include/c++/v1/__iterator/istream_iterator.h
+include/c++/v1/__iterator/istreambuf_iterator.h
+include/c++/v1/__iterator/iter_move.h
+include/c++/v1/__iterator/iter_swap.h
+include/c++/v1/__iterator/iterator.h
+include/c++/v1/__iterator/iterator_traits.h
+include/c++/v1/__iterator/mergeable.h
+include/c++/v1/__iterator/move_iterator.h
+include/c++/v1/__iterator/move_sentinel.h
+include/c++/v1/__iterator/next.h
+include/c++/v1/__iterator/ostream_iterator.h
+include/c++/v1/__iterator/ostreambuf_iterator.h
+include/c++/v1/__iterator/permutable.h
+include/c++/v1/__iterator/prev.h
+include/c++/v1/__iterator/projected.h
+include/c++/v1/__iterator/readable_traits.h
+include/c++/v1/__iterator/reverse_access.h
+include/c++/v1/__iterator/reverse_iterator.h
+include/c++/v1/__iterator/size.h
+include/c++/v1/__iterator/sortable.h
+include/c++/v1/__iterator/unreachable_sentinel.h
+include/c++/v1/__iterator/wrap_iter.h
+include/c++/v1/__locale
+include/c++/v1/__mbstate_t.h
+include/c++/v1/__memory/addressof.h
+include/c++/v1/__memory/allocate_at_least.h
+include/c++/v1/__memory/allocation_guard.h
+include/c++/v1/__memory/allocator.h
+include/c++/v1/__memory/allocator_arg_t.h
+include/c++/v1/__memory/allocator_traits.h
+include/c++/v1/__memory/assume_aligned.h
+include/c++/v1/__memory/auto_ptr.h
+include/c++/v1/__memory/compressed_pair.h
+include/c++/v1/__memory/concepts.h
+include/c++/v1/__memory/construct_at.h
+include/c++/v1/__memory/pointer_traits.h
+include/c++/v1/__memory/ranges_construct_at.h
+include/c++/v1/__memory/ranges_uninitialized_algorithms.h
+include/c++/v1/__memory/raw_storage_iterator.h
+include/c++/v1/__memory/shared_ptr.h
+include/c++/v1/__memory/swap_allocator.h
+include/c++/v1/__memory/temporary_buffer.h
+include/c++/v1/__memory/uninitialized_algorithms.h
+include/c++/v1/__memory/unique_ptr.h
+include/c++/v1/__memory/uses_allocator.h
+include/c++/v1/__memory/voidify.h
+include/c++/v1/__mutex_base
+include/c++/v1/__node_handle
+include/c++/v1/__numeric/accumulate.h
+include/c++/v1/__numeric/adjacent_difference.h
+include/c++/v1/__numeric/exclusive_scan.h
+include/c++/v1/__numeric/gcd_lcm.h
+include/c++/v1/__numeric/inclusive_scan.h
+include/c++/v1/__numeric/inner_product.h
+include/c++/v1/__numeric/iota.h
+include/c++/v1/__numeric/midpoint.h
+include/c++/v1/__numeric/partial_sum.h
+include/c++/v1/__numeric/reduce.h
+include/c++/v1/__numeric/transform_exclusive_scan.h
+include/c++/v1/__numeric/transform_inclusive_scan.h
+include/c++/v1/__numeric/transform_reduce.h
+include/c++/v1/__random/bernoulli_distribution.h
+include/c++/v1/__random/binomial_distribution.h
+include/c++/v1/__random/cauchy_distribution.h
+include/c++/v1/__random/chi_squared_distribution.h
+include/c++/v1/__random/clamp_to_integral.h
+include/c++/v1/__random/default_random_engine.h
+include/c++/v1/__random/discard_block_engine.h
+include/c++/v1/__random/discrete_distribution.h
+include/c++/v1/__random/exponential_distribution.h
+include/c++/v1/__random/extreme_value_distribution.h
+include/c++/v1/__random/fisher_f_distribution.h
+include/c++/v1/__random/gamma_distribution.h
+include/c++/v1/__random/generate_canonical.h
+include/c++/v1/__random/geometric_distribution.h
+include/c++/v1/__random/independent_bits_engine.h
+include/c++/v1/__random/is_seed_sequence.h
+include/c++/v1/__random/is_valid.h
+include/c++/v1/__random/knuth_b.h
+include/c++/v1/__random/linear_congruential_engine.h
+include/c++/v1/__random/log2.h
+include/c++/v1/__random/lognormal_distribution.h
+include/c++/v1/__random/mersenne_twister_engine.h
+include/c++/v1/__random/negative_binomial_distribution.h
+include/c++/v1/__random/normal_distribution.h
+include/c++/v1/__random/piecewise_constant_distribution.h
+include/c++/v1/__random/piecewise_linear_distribution.h
+include/c++/v1/__random/poisson_distribution.h
+include/c++/v1/__random/random_device.h
+include/c++/v1/__random/ranlux.h
+include/c++/v1/__random/seed_seq.h
+include/c++/v1/__random/shuffle_order_engine.h
+include/c++/v1/__random/student_t_distribution.h
+include/c++/v1/__random/subtract_with_carry_engine.h
+include/c++/v1/__random/uniform_int_distribution.h
+include/c++/v1/__random/uniform_random_bit_generator.h
+include/c++/v1/__random/uniform_real_distribution.h
+include/c++/v1/__random/weibull_distribution.h
+include/c++/v1/__ranges/access.h
+include/c++/v1/__ranges/all.h
+include/c++/v1/__ranges/common_view.h
+include/c++/v1/__ranges/concepts.h
+include/c++/v1/__ranges/copyable_box.h
+include/c++/v1/__ranges/counted.h
+include/c++/v1/__ranges/dangling.h
+include/c++/v1/__ranges/data.h
+include/c++/v1/__ranges/drop_view.h
+include/c++/v1/__ranges/empty.h
+include/c++/v1/__ranges/empty_view.h
+include/c++/v1/__ranges/enable_borrowed_range.h
+include/c++/v1/__ranges/enable_view.h
+include/c++/v1/__ranges/filter_view.h
+include/c++/v1/__ranges/iota_view.h
+include/c++/v1/__ranges/join_view.h
+include/c++/v1/__ranges/lazy_split_view.h
+include/c++/v1/__ranges/non_propagating_cache.h
+include/c++/v1/__ranges/owning_view.h
+include/c++/v1/__ranges/range_adaptor.h
+include/c++/v1/__ranges/rbegin.h
+include/c++/v1/__ranges/ref_view.h
+include/c++/v1/__ranges/rend.h
+include/c++/v1/__ranges/reverse_view.h
+include/c++/v1/__ranges/single_view.h
+include/c++/v1/__ranges/size.h
+include/c++/v1/__ranges/subrange.h
+include/c++/v1/__ranges/take_view.h
+include/c++/v1/__ranges/transform_view.h
+include/c++/v1/__ranges/view_interface.h
+include/c++/v1/__ranges/views.h
+include/c++/v1/__ranges/zip_view.h
+include/c++/v1/__split_buffer
+include/c++/v1/__std_stream
+include/c++/v1/__string/char_traits.h
+include/c++/v1/__string/extern_template_lists.h
+include/c++/v1/__support/android/locale_bionic.h
+include/c++/v1/__support/fuchsia/xlocale.h
+include/c++/v1/__support/ibm/gettod_zos.h
+include/c++/v1/__support/ibm/locale_mgmt_zos.h
+include/c++/v1/__support/ibm/nanosleep.h
+include/c++/v1/__support/ibm/xlocale.h
+include/c++/v1/__support/musl/xlocale.h
+include/c++/v1/__support/newlib/xlocale.h
+include/c++/v1/__support/openbsd/xlocale.h
+include/c++/v1/__support/solaris/floatingpoint.h
+include/c++/v1/__support/solaris/wchar.h
+include/c++/v1/__support/solaris/xlocale.h
+include/c++/v1/__support/win32/limits_msvc_win32.h
+include/c++/v1/__support/win32/locale_win32.h
+include/c++/v1/__support/xlocale/__nop_locale_mgmt.h
+include/c++/v1/__support/xlocale/__posix_l_fallback.h
+include/c++/v1/__support/xlocale/__strtonum_fallback.h
+include/c++/v1/__thread/poll_with_backoff.h
+include/c++/v1/__thread/timed_backoff_policy.h
+include/c++/v1/__threading_support
+include/c++/v1/__tree
+include/c++/v1/__tuple
+include/c++/v1/__type_traits/add_const.h
+include/c++/v1/__type_traits/add_cv.h
+include/c++/v1/__type_traits/add_lvalue_reference.h
+include/c++/v1/__type_traits/add_pointer.h
+include/c++/v1/__type_traits/add_rvalue_reference.h
+include/c++/v1/__type_traits/add_volatile.h
+include/c++/v1/__type_traits/aligned_storage.h
+include/c++/v1/__type_traits/aligned_union.h
+include/c++/v1/__type_traits/alignment_of.h
+include/c++/v1/__type_traits/apply_cv.h
+include/c++/v1/__type_traits/common_reference.h
+include/c++/v1/__type_traits/common_type.h
+include/c++/v1/__type_traits/conditional.h
+include/c++/v1/__type_traits/conjunction.h
+include/c++/v1/__type_traits/copy_cv.h
+include/c++/v1/__type_traits/copy_cvref.h
+include/c++/v1/__type_traits/decay.h
+include/c++/v1/__type_traits/disjunction.h
+include/c++/v1/__type_traits/enable_if.h
+include/c++/v1/__type_traits/extent.h
+include/c++/v1/__type_traits/has_unique_object_representation.h
+include/c++/v1/__type_traits/has_virtual_destructor.h
+include/c++/v1/__type_traits/integral_constant.h
+include/c++/v1/__type_traits/is_abstract.h
+include/c++/v1/__type_traits/is_aggregate.h
+include/c++/v1/__type_traits/is_arithmetic.h
+include/c++/v1/__type_traits/is_array.h
+include/c++/v1/__type_traits/is_assignable.h
+include/c++/v1/__type_traits/is_base_of.h
+include/c++/v1/__type_traits/is_bounded_array.h
+include/c++/v1/__type_traits/is_callable.h
+include/c++/v1/__type_traits/is_class.h
+include/c++/v1/__type_traits/is_compound.h
+include/c++/v1/__type_traits/is_const.h
+include/c++/v1/__type_traits/is_constant_evaluated.h
+include/c++/v1/__type_traits/is_constructible.h
+include/c++/v1/__type_traits/is_convertible.h
+include/c++/v1/__type_traits/is_copy_assignable.h
+include/c++/v1/__type_traits/is_copy_constructible.h
+include/c++/v1/__type_traits/is_core_convertible.h
+include/c++/v1/__type_traits/is_default_constructible.h
+include/c++/v1/__type_traits/is_destructible.h
+include/c++/v1/__type_traits/is_empty.h
+include/c++/v1/__type_traits/is_enum.h
+include/c++/v1/__type_traits/is_final.h
+include/c++/v1/__type_traits/is_floating_point.h
+include/c++/v1/__type_traits/is_function.h
+include/c++/v1/__type_traits/is_fundamental.h
+include/c++/v1/__type_traits/is_integral.h
+include/c++/v1/__type_traits/is_literal_type.h
+include/c++/v1/__type_traits/is_member_function_pointer.h
+include/c++/v1/__type_traits/is_member_object_pointer.h
+include/c++/v1/__type_traits/is_member_pointer.h
+include/c++/v1/__type_traits/is_move_assignable.h
+include/c++/v1/__type_traits/is_move_constructible.h
+include/c++/v1/__type_traits/is_nothrow_assignable.h
+include/c++/v1/__type_traits/is_nothrow_constructible.h
+include/c++/v1/__type_traits/is_nothrow_convertible.h
+include/c++/v1/__type_traits/is_nothrow_copy_assignable.h
+include/c++/v1/__type_traits/is_nothrow_copy_constructible.h
+include/c++/v1/__type_traits/is_nothrow_default_constructible.h
+include/c++/v1/__type_traits/is_nothrow_destructible.h
+include/c++/v1/__type_traits/is_nothrow_move_assignable.h
+include/c++/v1/__type_traits/is_nothrow_move_constructible.h
+include/c++/v1/__type_traits/is_null_pointer.h
+include/c++/v1/__type_traits/is_object.h
+include/c++/v1/__type_traits/is_pod.h
+include/c++/v1/__type_traits/is_pointer.h
+include/c++/v1/__type_traits/is_polymorphic.h
+include/c++/v1/__type_traits/is_primary_template.h
+include/c++/v1/__type_traits/is_reference.h
+include/c++/v1/__type_traits/is_reference_wrapper.h
+include/c++/v1/__type_traits/is_referenceable.h
+include/c++/v1/__type_traits/is_same.h
+include/c++/v1/__type_traits/is_scalar.h
+include/c++/v1/__type_traits/is_scoped_enum.h
+include/c++/v1/__type_traits/is_signed.h
+include/c++/v1/__type_traits/is_signed_integer.h
+include/c++/v1/__type_traits/is_standard_layout.h
+include/c++/v1/__type_traits/is_trivial.h
+include/c++/v1/__type_traits/is_trivially_assignable.h
+include/c++/v1/__type_traits/is_trivially_constructible.h
+include/c++/v1/__type_traits/is_trivially_copy_assignable.h
+include/c++/v1/__type_traits/is_trivially_copy_constructible.h
+include/c++/v1/__type_traits/is_trivially_copyable.h
+include/c++/v1/__type_traits/is_trivially_default_constructible.h
+include/c++/v1/__type_traits/is_trivially_destructible.h
+include/c++/v1/__type_traits/is_trivially_move_assignable.h
+include/c++/v1/__type_traits/is_trivially_move_constructible.h
+include/c++/v1/__type_traits/is_unbounded_array.h
+include/c++/v1/__type_traits/is_union.h
+include/c++/v1/__type_traits/is_unsigned.h
+include/c++/v1/__type_traits/is_unsigned_integer.h
+include/c++/v1/__type_traits/is_valid_expansion.h
+include/c++/v1/__type_traits/is_void.h
+include/c++/v1/__type_traits/is_volatile.h
+include/c++/v1/__type_traits/lazy.h
+include/c++/v1/__type_traits/make_32_64_or_128_bit.h
+include/c++/v1/__type_traits/make_signed.h
+include/c++/v1/__type_traits/make_unsigned.h
+include/c++/v1/__type_traits/nat.h
+include/c++/v1/__type_traits/negation.h
+include/c++/v1/__type_traits/promote.h
+include/c++/v1/__type_traits/rank.h
+include/c++/v1/__type_traits/remove_all_extents.h
+include/c++/v1/__type_traits/remove_const.h
+include/c++/v1/__type_traits/remove_cv.h
+include/c++/v1/__type_traits/remove_cvref.h
+include/c++/v1/__type_traits/remove_extent.h
+include/c++/v1/__type_traits/remove_pointer.h
+include/c++/v1/__type_traits/remove_reference.h
+include/c++/v1/__type_traits/remove_volatile.h
+include/c++/v1/__type_traits/type_identity.h
+include/c++/v1/__type_traits/type_list.h
+include/c++/v1/__type_traits/underlying_type.h
+include/c++/v1/__type_traits/void_t.h
+include/c++/v1/__undef_macros
+include/c++/v1/__utility/as_const.h
+include/c++/v1/__utility/auto_cast.h
+include/c++/v1/__utility/cmp.h
+include/c++/v1/__utility/declval.h
+include/c++/v1/__utility/exchange.h
+include/c++/v1/__utility/forward.h
+include/c++/v1/__utility/in_place.h
+include/c++/v1/__utility/integer_sequence.h
+include/c++/v1/__utility/move.h
+include/c++/v1/__utility/pair.h
+include/c++/v1/__utility/piecewise_construct.h
+include/c++/v1/__utility/priority_tag.h
+include/c++/v1/__utility/rel_ops.h
+include/c++/v1/__utility/swap.h
+include/c++/v1/__utility/to_underlying.h
+include/c++/v1/__utility/transaction.h
+include/c++/v1/__utility/unreachable.h
+include/c++/v1/__variant/monostate.h
+include/c++/v1/__verbose_abort
+include/c++/v1/algorithm
+include/c++/v1/any
+include/c++/v1/array
+include/c++/v1/atomic
+include/c++/v1/barrier
+include/c++/v1/bit
+include/c++/v1/bitset
+include/c++/v1/cassert
+include/c++/v1/ccomplex
+include/c++/v1/cctype
+include/c++/v1/cerrno
+include/c++/v1/cfenv
+include/c++/v1/cfloat
+include/c++/v1/charconv
+include/c++/v1/chrono
+include/c++/v1/cinttypes
+include/c++/v1/ciso646
+include/c++/v1/climits
+include/c++/v1/clocale
+include/c++/v1/cmath
+include/c++/v1/codecvt
+include/c++/v1/compare
+include/c++/v1/complex
+include/c++/v1/complex.h
+include/c++/v1/concepts
+include/c++/v1/condition_variable
+include/c++/v1/coroutine
+include/c++/v1/csetjmp
+include/c++/v1/csignal
+include/c++/v1/cstdarg
+include/c++/v1/cstdbool
+include/c++/v1/cstddef
+include/c++/v1/cstdint
+include/c++/v1/cstdio
+include/c++/v1/cstdlib
+include/c++/v1/cstring
+include/c++/v1/ctgmath
+include/c++/v1/ctime
+include/c++/v1/ctype.h
+include/c++/v1/cuchar
+include/c++/v1/cwchar
+include/c++/v1/cwctype
+include/c++/v1/deque
+include/c++/v1/errno.h
+include/c++/v1/exception
+include/c++/v1/execution
+include/c++/v1/experimental/__config
+include/c++/v1/experimental/__memory
+include/c++/v1/experimental/algorithm
+include/c++/v1/experimental/coroutine
+include/c++/v1/experimental/deque
+include/c++/v1/experimental/forward_list
+include/c++/v1/experimental/functional
+include/c++/v1/experimental/iterator
+include/c++/v1/experimental/list
+include/c++/v1/experimental/map
+include/c++/v1/experimental/memory_resource
+include/c++/v1/experimental/propagate_const
+include/c++/v1/experimental/regex
+include/c++/v1/experimental/set
+include/c++/v1/experimental/simd
+include/c++/v1/experimental/string
+include/c++/v1/experimental/type_traits
+include/c++/v1/experimental/unordered_map
+include/c++/v1/experimental/unordered_set
+include/c++/v1/experimental/utility
+include/c++/v1/experimental/vector
+include/c++/v1/ext/__hash
+include/c++/v1/ext/hash_map
+include/c++/v1/ext/hash_set
+include/c++/v1/fenv.h
+include/c++/v1/filesystem
+include/c++/v1/float.h
+include/c++/v1/format
+include/c++/v1/forward_list
+include/c++/v1/fstream
+include/c++/v1/functional
+include/c++/v1/future
+include/c++/v1/initializer_list
+include/c++/v1/inttypes.h
+include/c++/v1/iomanip
+include/c++/v1/ios
+include/c++/v1/iosfwd
+include/c++/v1/iostream
+include/c++/v1/istream
+include/c++/v1/iterator
+include/c++/v1/latch
+include/c++/v1/limits
+include/c++/v1/limits.h
+include/c++/v1/list
+include/c++/v1/locale
+include/c++/v1/locale.h
+include/c++/v1/map
+include/c++/v1/math.h
+include/c++/v1/memory
+include/c++/v1/module.modulemap
+include/c++/v1/mutex
+include/c++/v1/new
+include/c++/v1/numbers
+include/c++/v1/numeric
+include/c++/v1/optional
+include/c++/v1/ostream
+include/c++/v1/queue
+include/c++/v1/random
+include/c++/v1/ranges
+include/c++/v1/ratio
+include/c++/v1/regex
+include/c++/v1/scoped_allocator
+include/c++/v1/semaphore
+include/c++/v1/set
+include/c++/v1/setjmp.h
+include/c++/v1/shared_mutex
+include/c++/v1/span
+include/c++/v1/sstream
+include/c++/v1/stack
+include/c++/v1/stdatomic.h
+include/c++/v1/stdbool.h
+include/c++/v1/stddef.h
+include/c++/v1/stdexcept
+include/c++/v1/stdint.h
+include/c++/v1/stdio.h
+include/c++/v1/stdlib.h
+include/c++/v1/streambuf
+include/c++/v1/string
+include/c++/v1/string.h
+include/c++/v1/string_view
+include/c++/v1/strstream
+include/c++/v1/system_error
+include/c++/v1/tgmath.h
+include/c++/v1/thread
+include/c++/v1/tuple
+include/c++/v1/type_traits
+include/c++/v1/typeindex
+include/c++/v1/typeinfo
+include/c++/v1/uchar.h
+include/c++/v1/unordered_map
+include/c++/v1/unordered_set
+include/c++/v1/utility
+include/c++/v1/valarray
+include/c++/v1/variant
+include/c++/v1/vector
+include/c++/v1/version
+include/c++/v1/wchar.h
+include/c++/v1/wctype.h
+lib/libc++.a
+lib/libc++.so
+lib/libc++.so.1
+lib/libc++.so.1.0
+lib/libc++experimental.a
diff --git a/libcxx/buildlink3.mk b/libcxx/buildlink3.mk
new file mode 100644
index 0000000000..7b08022464
--- /dev/null
+++ b/libcxx/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.7 2022/08/13 09:38:09 tnn Exp $
+
+BUILDLINK_TREE+=	libcxx
+
+.if !defined(LIBCXX_BUILDLINK3_MK)
+LIBCXX_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libcxx+=	libcxx>=14.0.0
+BUILDLINK_PKGSRCDIR.libcxx?=	../../wip/libcxx
+
+.endif	# LIBCXX_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libcxx
diff --git a/libcxx/distinfo b/libcxx/distinfo
new file mode 100644
index 0000000000..4ea8e6f3a4
--- /dev/null
+++ b/libcxx/distinfo
@@ -0,0 +1,17 @@
+$NetBSD: distinfo,v 1.25 2023/01/12 19:32:54 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (libcxx-16.0.1.src.tar.xz) = 3ea6f3d89c23341e4979ef2173a15cf0a0616925c391a9d41c964499e5f48d6d
+SHA512 (libcxx-16.0.1.src.tar.xz) = 37f660d020c4943b94e5a9a060a57c2f1e4e51f154028f299050d8d9706788b7b14f9fe552adf8909d10b3fa1fb793034ff46a40849c6ac45dff99ea10df6e77
+Size (libcxx-16.0.1.src.tar.xz) = 3647592 bytes
+BLAKE2s (libcxxabi-16.0.1.src.tar.xz) = aef7f4df34e26876aa0700932b929aa04e0957d2170c4d8c2c02f075783273cc
+SHA512 (libcxxabi-16.0.1.src.tar.xz) = 7b5af2a83d9ab704219af75874b4c18248869d91141670794e31d6e2ba852313e2677ce2b83ba4d58abf236e3e01519a917117ad938475a9e1e4b74ec6b12b11
+Size (libcxxabi-16.0.1.src.tar.xz) = 573576 bytes
+SHA1 (patch-include_____locale) = 2eafcf7f70f67df907593fe8cc0cc1ec1c0e0552
+SHA1 (patch-include_____support_solaris_xlocale.h) = c6a969ed48b4df78401fea76c7a936c258cf869f
+SHA1 (patch-src_charconv.cpp) = b8569ae77df4a5a7b627b3a9cb6691be73699dca
+SHA1 (patch-src_filesystem_filesystem__common.h) = 7b088ae8e577b482e05906434b510daed40469ae
+SHA1 (patch-src_include_to__chars__floating__point.h) = f7f880905609b87830ea657c7510fb3987448a09
+SHA1 (patch-src_support_solaris_xlocale.cpp) = 51fc7940a60a4e288a1ccb65f1ea0502f6006490
diff --git a/libcxx/patches/patch-include_____locale b/libcxx/patches/patch-include_____locale
new file mode 100644
index 0000000000..21a561ee20
--- /dev/null
+++ b/libcxx/patches/patch-include_____locale
@@ -0,0 +1,15 @@
+$NetBSD: patch-include_____locale,v 1.3 2022/12/07 10:40:34 jperkin Exp $
+
+Increase SunOS mask to fit all values.
+
+--- include/__locale.orig	2022-11-29 10:05:58.000000000 +0000
++++ include/__locale
+@@ -495,7 +495,7 @@ public:
+ # if defined(_AIX)
+     static const mask __regex_word = 0x8000;
+ # else
+-    static const mask __regex_word = 0x80;
++    static const mask __regex_word = 0x80000;
+ # endif
+ #elif defined(_NEWLIB_VERSION)
+     // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
diff --git a/libcxx/patches/patch-include_____support_solaris_xlocale.h b/libcxx/patches/patch-include_____support_solaris_xlocale.h
new file mode 100644
index 0000000000..dde9a19fc2
--- /dev/null
+++ b/libcxx/patches/patch-include_____support_solaris_xlocale.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-include_____support_solaris_xlocale.h,v 1.1 2022/12/07 10:40:34 jperkin Exp $
+
+Fix SunOS support.
+
+--- include/__support/solaris/xlocale.h.orig	2022-11-29 10:05:58.000000000 +0000
++++ include/__support/solaris/xlocale.h
+@@ -13,6 +13,9 @@
+ #ifndef __XLOCALE_H_INCLUDED
+ #define __XLOCALE_H_INCLUDED
+ 
++#include <cstdlib>
++#include <cwchar>
++#include <__support/xlocale/__strtonum_fallback.h>
+ #include <stdlib.h>
+ 
+ #ifdef __cplusplus
+@@ -31,6 +34,7 @@ int tolower_l(int __c, locale_t __l);
+ struct lconv *localeconv(void);
+ struct lconv *localeconv_l(locale_t __l);
+ 
++#if 0
+ // FIXME: These are quick-and-dirty hacks to make things pretend to work
+ inline _LIBCPP_HIDE_FROM_ABI long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
+@@ -66,6 +70,7 @@ inline _LIBCPP_HIDE_FROM_ABI long double
+ strtold_l(const char *__nptr, char **__endptr, locale_t __loc) {
+   return ::strtold(__nptr, __endptr);
+ }
++#endif
+ 
+ 
+ #ifdef __cplusplus
diff --git a/libcxx/patches/patch-src_charconv.cpp b/libcxx/patches/patch-src_charconv.cpp
new file mode 100644
index 0000000000..86061060a7
--- /dev/null
+++ b/libcxx/patches/patch-src_charconv.cpp
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_charconv.cpp,v 1.1 2022/08/13 09:38:09 tnn Exp $
+
+#if out some code that doesn't compile with GCC < 11 for now
+
+--- src/charconv.cpp.orig	2022-06-22 16:46:24.000000000 +0000
++++ src/charconv.cpp
+@@ -152,6 +152,7 @@ __u64toa(uint64_t value, char* buffer) n
+ 
+ // This implementation is dedicated to the memory of Mary and Thavatchai.
+ 
++#if _LIBCPP_STD_VER > 17
+ to_chars_result to_chars(char* __first, char* __last, float __value) {
+   return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, __value, chars_format{}, 0);
+ }
+@@ -192,5 +193,6 @@ to_chars_result to_chars(char* __first, 
+   return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(
+       __first, __last, static_cast<double>(__value), __fmt, __precision);
+ }
++#endif
+ 
+ _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/patches/patch-src_filesystem_filesystem__common.h b/libcxx/patches/patch-src_filesystem_filesystem__common.h
new file mode 100644
index 0000000000..5c0c657033
--- /dev/null
+++ b/libcxx/patches/patch-src_filesystem_filesystem__common.h
@@ -0,0 +1,28 @@
+$NetBSD: patch-src_filesystem_filesystem__common.h,v 1.1 2022/08/13 09:38:09 tnn Exp $
+
+Support POSIX file modes.
+
+--- src/filesystem/filesystem_common.h.orig	2022-06-22 16:46:24.000000000 +0000
++++ src/filesystem/filesystem_common.h
+@@ -538,7 +538,21 @@ bool set_file_times(const path& p, std::
+ #if defined(DT_BLK)
+ template <class DirEntT, class = decltype(DirEntT::d_type)>
+ static file_type get_file_type(DirEntT* ent, int) {
++#ifdef __sun
++#define DT_BLK		S_IFBLK
++#define DT_CHR		S_IFCHR
++#define DT_DIR		S_IFDIR
++#define DT_FIFO		S_IFIFO
++#define DT_LNK		S_IFLNK
++#define DT_REG		S_IFREG
++#define DT_SOCK		S_IFSOCK
++#define DT_UNKNOWN	0
++  struct stat s;
++  stat(ent->d_name, &s);
++  switch (s.st_mode & 0xF000) {
++#else
+   switch (ent->d_type) {
++#endif
+   case DT_BLK:
+     return file_type::block;
+   case DT_CHR:
diff --git a/libcxx/patches/patch-src_include_to__chars__floating__point.h b/libcxx/patches/patch-src_include_to__chars__floating__point.h
new file mode 100644
index 0000000000..23d63460f4
--- /dev/null
+++ b/libcxx/patches/patch-src_include_to__chars__floating__point.h
@@ -0,0 +1,60 @@
+$NetBSD: patch-src_include_to__chars__floating__point.h,v 1.1 2022/08/13 09:38:09 tnn Exp $
+
+#if out some code that doesn't compile with GCC < 11 for now
+
+--- src/include/to_chars_floating_point.h.orig	2022-06-22 16:46:24.000000000 +0000
++++ src/include/to_chars_floating_point.h
+@@ -90,6 +90,7 @@ struct _Floating_type_traits<double> {
+ 
+ // ^^^^^^^^^^ DERIVED FROM corecrt_internal_fltintrn.h ^^^^^^^^^^
+ 
++#if _LIBCPP_STD_VER > 17
+ // FUNCTION to_chars (FLOATING-POINT TO STRING)
+ template <class _Floating>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+@@ -329,7 +330,9 @@ to_chars_result _Floating_to_chars_hex_p
+     // We've already printed '-' if necessary, so uint32_t _Absolute_exponent avoids testing that again.
+     return _VSTD::to_chars(_First, _Last, _Absolute_exponent);
+ }
++#endif
+ 
++#if _LIBCPP_STD_VER > 17
+ template <class _Floating>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+ to_chars_result _Floating_to_chars_hex_shortest(
+@@ -456,6 +459,7 @@ to_chars_result _Floating_to_chars_hex_s
+     // We've already printed '-' if necessary, so static_cast<uint32_t> avoids testing that again.
+     return _VSTD::to_chars(_First, _Last, static_cast<uint32_t>(_Unbiased_exponent));
+ }
++#endif
+ 
+ // For general precision, we can use lookup tables to avoid performing trial formatting.
+ 
+@@ -828,6 +832,7 @@ struct _General_precision_tables<double>
+         0x7FEFFFFFFFFFFFFFu};
+ };
+ 
++#if _LIBCPP_STD_VER > 17
+ template <class _Floating>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+ to_chars_result _Floating_to_chars_general_precision(
+@@ -980,9 +985,11 @@ to_chars_result _Floating_to_chars_gener
+ 
+     return {_First, errc{}};
+ }
++#endif
+ 
+ enum class _Floating_to_chars_overload { _Plain, _Format_only, _Format_precision };
+ 
++#if _LIBCPP_STD_VER > 17
+ template <_Floating_to_chars_overload _Overload, class _Floating>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+ to_chars_result _Floating_to_chars(
+@@ -1068,6 +1075,7 @@ to_chars_result _Floating_to_chars(
+         }
+     }
+ }
++#endif
+ 
+ // clang-format on
+ 
diff --git a/libcxx/patches/patch-src_support_solaris_xlocale.cpp b/libcxx/patches/patch-src_support_solaris_xlocale.cpp
new file mode 100644
index 0000000000..05499f889e
--- /dev/null
+++ b/libcxx/patches/patch-src_support_solaris_xlocale.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_support_solaris_xlocale.cpp,v 1.3 2022/08/13 09:38:09 tnn Exp $
+
+don't try to use sys/localedef.h on SunOS if nonexistent
+OpenIndiana doesn't seem to ship the header.
+Userland shouldn't use it, according to Garrett D'Amore:
+https://illumos.topicbox.com/groups/developer/T6cfd2e6cd87f3485-M30dac0cb6fffae62ef45b9a8
+
+--- src/support/solaris/xlocale.cpp.orig	2022-06-22 16:46:24.000000000 +0000
++++ src/support/solaris/xlocale.cpp
+@@ -6,7 +6,7 @@
+ //
+ //===----------------------------------------------------------------------===//
+ 
+-#ifdef __sun__
++#if defined(__sun__) && __has_include(<sys/localedef.h>)
+ 
+ #include "__support/solaris/xlocale.h"
+ #include <stdarg.h>
diff --git a/libcxxabi/DESCR b/libcxxabi/DESCR
new file mode 100644
index 0000000000..7b53a18eda
--- /dev/null
+++ b/libcxxabi/DESCR
@@ -0,0 +1,7 @@
+libc++abi is a new implementation of low level support for a standard
+C++ library.
+
+Features and Goals
+ * Correctness as defined by the C++11 standard.
+ * Provide a portable sublayer to ease the porting of libc++
+ * On Mac OS X, be ABI compatible with the existing low-level support.
diff --git a/libcxxabi/Makefile b/libcxxabi/Makefile
new file mode 100644
index 0000000000..d25ed5e49c
--- /dev/null
+++ b/libcxxabi/Makefile
@@ -0,0 +1,52 @@
+# $NetBSD: Makefile,v 1.16 2022/11/14 18:44:06 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	libcxxabi-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://libcxxabi.llvm.org/
+COMMENT=	C++ Standard Library
+LICENSE=	apache-2.0
+
+# libcxx requires libcxxabi's cxxabi.h to build, but libcxxabi requires
+# libcxx's includes to build, so we have this unholy extra distfiles thing
+# in both of them to get them to build against each other without causing
+# circular dependencies.  This must be kept in sync with libcxxabi/Makefile.
+LIBCXX=		libcxx-${LLVM_VERSION}.src
+EXTRA_DIST+=	${LIBCXX}${EXTRACT_SUFX}
+
+SITES.${LIBCXX}${EXTRACT_SUFX}=	\
+	${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+
+CONFIGURE_DIRS=	build
+CMAKE_ARG_PATH=	${WRKSRC}
+
+USE_LANGUAGES=	c c++17
+USE_CMAKE=	yes
+SSP_SUPPORTED=	no
+GCC_REQD+=	10	# must be in sync with libcxx
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+
+# avoid conflict with stddef.h
+CXXFLAGS.NetBSD+=	-D__DEFINED_max_align_t=1
+
+.include "../../mk/compiler.mk"
+
+.if !empty(CC_VERSION:Mgcc-[0-9].*) || !empty(CC_VERSION:Mgcc-10.*)
+# Avoid GCC < 11 error https://github.com/llvm/llvm-project/issues/54018
+CXXFLAGS+=		-std=c++17 -D_LIBCPP_STD_VER=17
+.endif
+
+post-extract:
+	${MKDIR} ${WRKSRC}/build
+	${LN} -f -s ${WRKDIR}/${LIBCXX} ${WRKDIR}/libcxx
+# TODO: not sure what should create this and with which contents
+	${TOUCH} ${WRKDIR}/${LIBCXX}/include/__config_site
+
+.include "../../wip/libunwind/buildlink3.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libcxxabi/PLIST b/libcxxabi/PLIST
new file mode 100644
index 0000000000..2725188025
--- /dev/null
+++ b/libcxxabi/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.2 2022/11/14 18:44:06 adam Exp $
+include/c++/v1/__cxxabi_config.h
+include/c++/v1/cxxabi.h
+lib/libc++abi.a
+lib/libc++abi.so
+lib/libc++abi.so.1
+lib/libc++abi.so.1.0
diff --git a/libcxxabi/buildlink3.mk b/libcxxabi/buildlink3.mk
new file mode 100644
index 0000000000..532e7d82d0
--- /dev/null
+++ b/libcxxabi/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.6 2022/08/12 08:41:58 pin Exp $
+
+BUILDLINK_TREE+=	libcxxabi
+
+.if !defined(LIBCXXABI_BUILDLINK3_MK)
+LIBCXXABI_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libcxxabi+=	libcxxabi>=14.0.0
+BUILDLINK_PKGSRCDIR.libcxxabi?=		../../wip/libcxxabi
+
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../wip/libunwind/buildlink3.mk"
+.endif	# LIBCXXABI_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libcxxabi
diff --git a/libcxxabi/distinfo b/libcxxabi/distinfo
new file mode 100644
index 0000000000..8c4a58cd6a
--- /dev/null
+++ b/libcxxabi/distinfo
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.21 2023/01/12 19:32:54 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (libcxx-16.0.1.src.tar.xz) = 3ea6f3d89c23341e4979ef2173a15cf0a0616925c391a9d41c964499e5f48d6d
+SHA512 (libcxx-16.0.1.src.tar.xz) = 37f660d020c4943b94e5a9a060a57c2f1e4e51f154028f299050d8d9706788b7b14f9fe552adf8909d10b3fa1fb793034ff46a40849c6ac45dff99ea10df6e77
+Size (libcxx-16.0.1.src.tar.xz) = 3647592 bytes
+BLAKE2s (libcxxabi-16.0.1.src.tar.xz) = aef7f4df34e26876aa0700932b929aa04e0957d2170c4d8c2c02f075783273cc
+SHA512 (libcxxabi-16.0.1.src.tar.xz) = 7b5af2a83d9ab704219af75874b4c18248869d91141670794e31d6e2ba852313e2677ce2b83ba4d58abf236e3e01519a917117ad938475a9e1e4b74ec6b12b11
+Size (libcxxabi-16.0.1.src.tar.xz) = 573576 bytes
+SHA1 (patch-src_CMakeLists.txt) = da127de7603ed0ea5530c4a8cd2ffcee61d2ff90
+SHA1 (patch-src_demangle_Utility.h) = 7a4850869f9f4ce858d2cceeb999934c28292a95
diff --git a/libcxxabi/patches/patch-src_CMakeLists.txt b/libcxxabi/patches/patch-src_CMakeLists.txt
new file mode 100644
index 0000000000..7ac1a160f1
--- /dev/null
+++ b/libcxxabi/patches/patch-src_CMakeLists.txt
@@ -0,0 +1,30 @@
+$NetBSD: patch-src_CMakeLists.txt,v 1.1 2022/11/14 18:44:06 adam Exp $
+
+Fix build.
+
+--- src/CMakeLists.txt.orig	2022-11-02 03:11:40.000000000 +0000
++++ src/CMakeLists.txt
+@@ -57,6 +57,7 @@ if (MSVC_IDE OR XCODE)
+ endif()
+ 
+ # Some files depend on libc++ internals.
++include_directories("${LIBCXXABI_LIBCXX_PATH}/include")
+ include_directories("${LIBCXXABI_LIBCXX_PATH}/src")
+ 
+ if (LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
+@@ -168,7 +169,6 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
+     target_link_libraries(cxxabi_shared_objects PUBLIC unwind_shared)
+   endif()
+ endif()
+-target_link_libraries(cxxabi_shared_objects PRIVATE cxx-headers ${LIBCXXABI_BUILTINS_LIBRARY} ${LIBCXXABI_SHARED_LIBRARIES} ${LIBCXXABI_LIBRARIES})
+ target_link_libraries(cxxabi_shared_objects PUBLIC cxxabi-headers)
+ set_target_properties(cxxabi_shared_objects
+   PROPERTIES
+@@ -239,7 +239,6 @@ if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBC
+   target_link_libraries(cxxabi_static_objects PUBLIC unwind_static_objects) # propagate usage requirements
+   target_sources(cxxabi_static_objects PUBLIC $<TARGET_OBJECTS:unwind_static_objects>)
+ endif()
+-target_link_libraries(cxxabi_static_objects PRIVATE cxx-headers ${LIBCXXABI_STATIC_LIBRARIES} ${LIBCXXABI_LIBRARIES})
+ target_link_libraries(cxxabi_static_objects PUBLIC cxxabi-headers)
+ set_target_properties(cxxabi_static_objects
+   PROPERTIES
diff --git a/libcxxabi/patches/patch-src_demangle_Utility.h b/libcxxabi/patches/patch-src_demangle_Utility.h
new file mode 100644
index 0000000000..0d35e20e7e
--- /dev/null
+++ b/libcxxabi/patches/patch-src_demangle_Utility.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_demangle_Utility.h,v 1.2 2022/11/29 09:08:58 jperkin Exp $
+
+Work around ambiguous call on SunOS.
+
+--- src/demangle/Utility.h.orig	2022-11-16 06:28:29.000000000 +0000
++++ src/demangle/Utility.h
+@@ -134,7 +134,7 @@ public:
+   OutputBuffer &operator<<(char C) { return (*this += C); }
+ 
+   OutputBuffer &operator<<(long long N) {
+-    return writeUnsigned(static_cast<unsigned long long>(std::abs(N)), N < 0);
++    return writeUnsigned(static_cast<unsigned long long>(std::llabs(N)), N < 0);
+   }
+ 
+   OutputBuffer &operator<<(unsigned long long N) {
diff --git a/libunwind/DESCR b/libunwind/DESCR
new file mode 100644
index 0000000000..93d20deb5d
--- /dev/null
+++ b/libunwind/DESCR
@@ -0,0 +1 @@
+LLVM libunwind
diff --git a/libunwind/Makefile b/libunwind/Makefile
new file mode 100644
index 0000000000..b51b8fec49
--- /dev/null
+++ b/libunwind/Makefile
@@ -0,0 +1,39 @@
+# $NetBSD: Makefile,v 1.32 2023/01/24 18:36:28 wiz Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	libunwind-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+#HOMEPAGE=	http://libunwind.llvm.org/
+COMMENT=	LLVM libunwind
+LICENSE=	apache-2.0
+
+# libunwind requires libcxx source code to build
+LIBCXX=		libcxx-${LLVM_VERSION}.src
+EXTRA_DIST+=	${LIBCXX}${EXTRACT_SUFX}
+
+SITES.${LIBCXX}${EXTRACT_SUFX}=	\
+	${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+
+USE_LANGUAGES=		c c++11
+USE_TOOLS+=		pax
+SSP_SUPPORTED=		no
+GCC_REQD+=		10	# must be in sync with libcxx
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+
+INSTALLATION_DIRS=	include
+
+post-extract:
+	${LN} -f -s ${WRKDIR}/${LIBCXX} ${WRKDIR}/libcxx
+
+post-install:
+	cd ${WRKSRC}/include && ${PAX} -rw . ${DESTDIR}${PREFIX}/include
+
+.include "../../devel/cmake/build.mk"
+BUILDLINK_DEPMETHOD.llvm=	build
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libunwind/PLIST b/libunwind/PLIST
new file mode 100644
index 0000000000..9f4b003031
--- /dev/null
+++ b/libunwind/PLIST
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.3 2022/08/12 08:39:56 pin Exp $
+include/CMakeLists.txt
+include/__libunwind_config.h
+include/libunwind.h
+include/libunwind.modulemap
+include/mach-o/compact_unwind_encoding.h
+include/mach-o/compact_unwind_encoding.modulemap
+include/unwind.h
+include/unwind_arm_ehabi.h
+include/unwind_itanium.h
+lib/libunwind.a
+lib/libunwind.so
+lib/libunwind.so.1
+lib/libunwind.so.1.0
diff --git a/libunwind/buildlink3.mk b/libunwind/buildlink3.mk
new file mode 100644
index 0000000000..f4c84bdf69
--- /dev/null
+++ b/libunwind/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.11 2022/08/12 08:39:56 pin Exp $
+
+BUILDLINK_TREE+=	libunwind
+
+.if !defined(LIBUNWIND_BUILDLINK3_MK)
+LIBUNWIND_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libunwind+=	libunwind>=14.0.0
+BUILDLINK_PKGSRCDIR.libunwind?=		../../wip/libunwind
+
+.endif	# LIBUNWIND_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libunwind
diff --git a/libunwind/distinfo b/libunwind/distinfo
new file mode 100644
index 0000000000..4c22c1bd40
--- /dev/null
+++ b/libunwind/distinfo
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.32 2023/01/12 22:47:25 wiz Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (libcxx-16.0.1.src.tar.xz) = 3ea6f3d89c23341e4979ef2173a15cf0a0616925c391a9d41c964499e5f48d6d
+SHA512 (libcxx-16.0.1.src.tar.xz) = 37f660d020c4943b94e5a9a060a57c2f1e4e51f154028f299050d8d9706788b7b14f9fe552adf8909d10b3fa1fb793034ff46a40849c6ac45dff99ea10df6e77
+Size (libcxx-16.0.1.src.tar.xz) = 3647592 bytes
+BLAKE2s (libunwind-16.0.1.src.tar.xz) = 07235d04d727cdc2ef0595235465636cc6e9eefc4d5052d99e654b9338f498b5
+SHA512 (libunwind-16.0.1.src.tar.xz) = b6862d2d5a4601d4c91823634278768ad08c15162ee7bbdb0469955dace8b0a520d16fce1f4b4adfa127ac0af75bafeda54a5bbefd39b14ce17e474a2d550d55
+Size (libunwind-16.0.1.src.tar.xz) = 114976 bytes
+SHA1 (patch-src_CMakeLists.txt) = a8ac316fddf0d71c75d7f64695335a6f4842fead
diff --git a/libunwind/patches/patch-src_CMakeLists.txt b/libunwind/patches/patch-src_CMakeLists.txt
new file mode 100644
index 0000000000..6124d9d993
--- /dev/null
+++ b/libunwind/patches/patch-src_CMakeLists.txt
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_CMakeLists.txt,v 1.5 2023/01/12 22:47:25 wiz Exp $
+
+Fix building assembler files.
+https://github.com/llvm/llvm-project/issues/59978
+
+--- src/CMakeLists.txt.orig	2023-01-12 07:12:30.000000000 +0000
++++ src/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ # Get sources
++enable_language(ASM)
+ 
+ set(LIBUNWIND_CXX_SOURCES
+     libunwind.cpp
+@@ -31,15 +32,6 @@ set(LIBUNWIND_ASM_SOURCES
+     UnwindRegistersSave.S
+     )
+ 
+-# See add_asm_sources() in compiler-rt for explanation of this workaround.
+-# CMake doesn't work correctly with assembly on AIX. Workaround by compiling
+-# as C files as well.
+-if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR
+-   (MINGW AND CMAKE_VERSION VERSION_LESS 3.17) OR
+-   (${CMAKE_SYSTEM_NAME} MATCHES "AIX"))
+-  set_source_files_properties(${LIBUNWIND_ASM_SOURCES} PROPERTIES LANGUAGE C)
+-endif()
+-
+ set(LIBUNWIND_HEADERS
+     AddressSpace.hpp
+     assembly.h
diff --git a/lld/DESCR b/lld/DESCR
new file mode 100644
index 0000000000..e7b4aa2cfd
--- /dev/null
+++ b/lld/DESCR
@@ -0,0 +1,11 @@
+LLD is a linker from the LLVM project that is a drop-in replacement for
+system linkers and runs much faster than them. It also provides features
+that are useful for toolchain developers.
+
+The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS) and
+WebAssembly in descending order of completeness. Internally, LLD
+consists of several different linkers. The PE/COFF port is complete,
+including Windows debug info (PDB) support. The WebAssembly port is
+still a work in progress (See WebAssembly lld port). The Mach-O port is
+built based on a different architecture than the others. For the details
+about Mach-O, please read ATOM-based lld.
diff --git a/lld/Makefile b/lld/Makefile
new file mode 100644
index 0000000000..c0e58043f0
--- /dev/null
+++ b/lld/Makefile
@@ -0,0 +1,34 @@
+# $NetBSD: Makefile,v 1.21 2023/03/14 11:25:56 fcambus Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	lld-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://lld.llvm.org/
+COMMENT=	The LLVM Linker
+LICENSE=	apache-2.0
+
+USE_LANGUAGES=	c c++14
+GCC_REQD+=	7
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${CC:Q}
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${CXX:Q}
+
+PYTHON_FOR_BUILD_ONLY=	yes
+
+INSTALLATION_DIRS+=	libexec/lld
+
+post-install:
+	${LN} -sf ${PREFIX}/bin/lld ${DESTDIR}${PREFIX}/libexec/lld/ld
+
+.include "options.mk"
+.include "../../devel/cmake/build.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../wip/libunwind/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../mk/atomic64.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lld/PLIST b/lld/PLIST
new file mode 100644
index 0000000000..fd08339349
--- /dev/null
+++ b/lld/PLIST
@@ -0,0 +1,31 @@
+@comment $NetBSD: PLIST,v 1.9 2023/03/14 11:25:56 fcambus Exp $
+bin/ld.lld
+bin/ld64.lld
+bin/lld
+bin/lld-link
+bin/wasm-ld
+include/lld/Common/Args.h
+include/lld/Common/Arrays.h
+include/lld/Common/CommonLinkerContext.h
+include/lld/Common/DWARF.h
+include/lld/Common/Driver.h
+include/lld/Common/ErrorHandler.h
+include/lld/Common/Filesystem.h
+include/lld/Common/LLVM.h
+include/lld/Common/Memory.h
+include/lld/Common/Reproduce.h
+include/lld/Common/Strings.h
+include/lld/Common/TargetOptionsCommandFlags.h
+include/lld/Common/Timer.h
+include/lld/Common/Version.h
+lib/cmake/lld/LLDConfig.cmake
+lib/cmake/lld/LLDConfigVersion.cmake
+lib/cmake/lld/LLDTargets-release.cmake
+lib/cmake/lld/LLDTargets.cmake
+lib/liblldCOFF.a
+lib/liblldCommon.a
+lib/liblldELF.a
+lib/liblldMachO.a
+lib/liblldMinGW.a
+lib/liblldWasm.a
+libexec/lld/ld
diff --git a/lld/buildlink3.mk b/lld/buildlink3.mk
new file mode 100644
index 0000000000..9bae90c6dc
--- /dev/null
+++ b/lld/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.3 2019/12/29 15:31:21 adam Exp $
+
+BUILDLINK_TREE+=	lld
+
+.if !defined(LLD_BUILDLINK3_MK)
+LLD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lld+=	lld>=9.0.1
+BUILDLINK_PKGSRCDIR.lld?=	../../wip/lld
+
+.include "../../wip/llvm/buildlink3.mk"
+.endif	# LLD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-lld
diff --git a/lld/distinfo b/lld/distinfo
new file mode 100644
index 0000000000..29d83dd8fe
--- /dev/null
+++ b/lld/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.21 2023/01/12 19:32:53 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (lld-16.0.1.src.tar.xz) = f6962e363bdf5b040acc7064f99d865aee4ad0e42b874505a7b80b0271af4f54
+SHA512 (lld-16.0.1.src.tar.xz) = fe9566a1aeaafdd80568dfa9553936ecf144f79ec774bb02d85eb4e140d1a5434a953ddbd18e6c3f1413d37d21a48a7e6eff2c25ff622a50c6ca3af4c3dff61f
+Size (lld-16.0.1.src.tar.xz) = 1453312 bytes
+SHA1 (patch-CMakeLists.txt) = afcd342966b989026b39445645807e6a541b351e
+SHA1 (patch-ELF_Config.h) = 50861ef74c2ff9a9091afcbc8d076e379d9531e5
+SHA1 (patch-ELF_Options.td) = c81907d6e5e099ed2c26de972c6744b7197de3d3
diff --git a/lld/options.mk b/lld/options.mk
new file mode 100644
index 0000000000..ceaf154539
--- /dev/null
+++ b/lld/options.mk
@@ -0,0 +1,20 @@
+# $NetBSD: options.mk,v 1.1 2019/02/01 16:30:00 mgorny Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.lld
+PKG_SUPPORTED_OPTIONS=	tests
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mtests)
+DISTFILES+=		llvm-${PKGVERSION_NOREV}.src${EXTRACT_SUFX}
+CMAKE_ARGS+=		-DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q}
+CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=ON
+CMAKE_ARGS+=		-DLLVM_BUILD_TESTS=ON
+CMAKE_ARGS+=		-DLLVM_MAIN_SRC_DIR=${WRKDIR}/llvm-${PKGVERSION_NOREV}.src
+CMAKE_ARGS+=		-DLLVM_EXTERNAL_LIT=${WRKDIR}/llvm-${PKGVERSION_NOREV}.src/utils/lit/lit.py
+REPLACE_PYTHON+=	${WRKDIR}/llvm-${PKGVERSION_NOREV}.src/utils/lit/lit.py
+TEST_TARGET=		check-lld  # failing tests fixed in 8.0
+TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
+.else
+CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=OFF
+.endif
diff --git a/lld/patches/patch-CMakeLists.txt b/lld/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..f75d000cd4
--- /dev/null
+++ b/lld/patches/patch-CMakeLists.txt
@@ -0,0 +1,16 @@
+$NetBSD: patch-CMakeLists.txt,v 1.4 2022/08/12 08:52:51 pin Exp $
+
+LLD 7.0.1 is incompatible with gtest version in pkgsrc.  Remove
+the condition that prevents it from building its own copy when system
+version is installed.
+
+--- CMakeLists.txt.orig	2023-04-05 05:36:38.000000000 +0200
++++ CMakeLists.txt	2023-04-28 23:18:59.353328097 +0200
+@@ -77,7 +77,6 @@
+       endif()
+       set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
+       if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+-          AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+           AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+         add_subdirectory(${UNITTEST_DIR} third-party/unittest)
+       endif()
diff --git a/lld/patches/patch-ELF_Config.h b/lld/patches/patch-ELF_Config.h
new file mode 100644
index 0000000000..ef09c61a79
--- /dev/null
+++ b/lld/patches/patch-ELF_Config.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-ELF_Config.h,v 1.9 2022/08/12 08:52:51 pin Exp $
+
+Add dummy option for an AArch64 erratum.
+
+--- ELF/Config.h.orig	2022-06-22 16:46:24.000000000 +0000
++++ ELF/Config.h
+@@ -170,6 +170,7 @@ struct Configuration {
+   bool enableNewDtags;
+   bool executeOnly;
+   bool exportDynamic;
++  bool fixCortexA53Errata835769;
+   bool fixCortexA53Errata843419;
+   bool fixCortexA8;
+   bool formatBinary = false;
diff --git a/lld/patches/patch-ELF_Options.td b/lld/patches/patch-ELF_Options.td
new file mode 100644
index 0000000000..b21688b921
--- /dev/null
+++ b/lld/patches/patch-ELF_Options.td
@@ -0,0 +1,16 @@
+$NetBSD: patch-ELF_Options.td,v 1.5 2022/08/12 08:52:51 pin Exp $
+
+Add dummy option for an AArch64 erratum.
+
+--- ELF/Options.td.orig	2022-06-22 16:46:24.000000000 +0000
++++ ELF/Options.td
+@@ -217,6 +217,9 @@ defm filter: Eq<"filter", "Set DT_FILTER
+ 
+ defm fini: Eq<"fini", "Specify a finalizer function">, MetaVarName<"<symbol>">;
+ 
++def fix_cortex_a53_835769: F<"fix-cortex-a53-835769">,
++  HelpText<"Apply fixes for AArch64 Cortex-A53 erratum 835769">;
++
+ def fix_cortex_a53_843419: F<"fix-cortex-a53-843419">,
+   HelpText<"Apply fixes for AArch64 Cortex-A53 erratum 843419">;
+ 
diff --git a/lldb/DESCR b/lldb/DESCR
new file mode 100644
index 0000000000..2a231b41a0
--- /dev/null
+++ b/lldb/DESCR
@@ -0,0 +1 @@
+Next generation, high-performance debugger
diff --git a/lldb/Makefile b/lldb/Makefile
new file mode 100644
index 0000000000..68d233e826
--- /dev/null
+++ b/lldb/Makefile
@@ -0,0 +1,97 @@
+# $NetBSD: Makefile,v 1.46 2023/04/19 08:08:18 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	lldb-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	devel lang
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://lldb.org/
+COMMENT=	Next generation, high-performance debugger
+LICENSE=	apache-2.0
+
+DEPENDS+=	llvm-${PKGVERSION_NOREV}{,nb*}:../../wip/llvm
+DEPENDS+=	clang-${PKGVERSION_NOREV}{,nb*}:../../wip/clang
+DEPENDS+=	swig3>=3.0:../../devel/swig3
+DEPENDS+=	${PYPKGPREFIX}-six-[0-9]*:../../lang/py-six
+
+CONFIGURE_DIRS=		build
+CMAKE_ARG_PATH=		${WRKSRC}
+
+USE_CMAKE=		yes
+USE_LANGUAGES=		c c++14
+GCC_REQD+=		7
+PY_PATCHPLIST=		yes
+
+CMAKE_ARGS+=	-DLLVM_CONFIG=${LLVM_CONFIG_PATH}
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${CC:Q}
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${CXX:Q}
+CMAKE_ARGS+=	-DHAVE_CXX_ATOMICS64_WITHOUT_LIB=ON
+CMAKE_ARGS+=	-DLLDB_CODESIGN_IDENTITY=""
+CMAKE_ARGS+=	-DLLDB_USE_SYSTEM_SIX=ON
+CMAKE_ARGS+=	-DPYTHON_HOME=${PREFIX}
+
+CHECK_PORTABILITY_SKIP=	utils/buildit/build_llvm
+
+LUA_VERSIONS_ACCEPTED=	53
+
+REPLACE_PERL+=		*.pl
+REPLACE_PERL+=		*/*.pl
+REPLACE_PERL+=		*/*/*.pl
+REPLACE_PERL+=		*/*/*/*.pl
+REPLACE_PERL+=		*/*/*/*/*.pl
+REPLACE_PERL+=		*/*/*/*/*/*.pl
+REPLACE_PERL+=		scripts/sed-sources
+
+REPLACE_PYTHON+=	*.py
+REPLACE_PYTHON+=	*/*.py
+REPLACE_PYTHON+=	*/*/*.py
+REPLACE_PYTHON+=	*/*/*/*.py
+REPLACE_PYTHON+=	*/*/*/*/*.py
+REPLACE_PYTHON+=	*/*/*/*/*/*.py
+REPLACE_PYTHON+=	*/*/*/*/*/*/*.py
+REPLACE_PYTHON+=	*/*/*/*/*/*/*/*.py
+REPLACE_PYTHON+=	scripts/shush
+
+TEST_TARGET=		check-lldb
+#TEST_TARGET=		check-lldb-unit # doesn't work in standalone build
+#TEST_TARGET=		check-lldb-single # check-lldb -j1
+#TEST_TARGET=		check-lldb-expr # unknown
+TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD"
+.  if exists(/usr/include/panel.h)
+CMAKE_ARGS+=	-DLLDB_DISABLE_CURSES:BOOL=FALSE
+.  else
+CMAKE_ARGS+=	-DLLDB_DISABLE_CURSES:BOOL=TRUE
+.  endif
+
+.  if ${OPSYS_VERSION} < 99922
+# lacks ptrace(2) PT_STOP
+PKG_FAIL_REASON+=	"Only NetBSD >= 9.99.22 provides ptrace(2) PT_STOP"
+.  endif
+.endif
+
+# Not yet ported, so avoid wasting time trying...
+NOT_FOR_PLATFORM+=	NetBSD-*-powerpc
+
+post-extract:
+	${MKDIR} ${WRKSRC}/build
+
+#.include "../../devel/googletest/buildlink3.mk" # check-lldb-unit
+.include "../../mk/atomic64.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../wip/clang/buildlink3.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../lang/lua/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.include "../../lang/python/extension.mk"
+.include "../../lang/python/tool.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
+.include "../../mk/readline.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lldb/PLIST b/lldb/PLIST
new file mode 100644
index 0000000000..7c7083ee4e
--- /dev/null
+++ b/lldb/PLIST
@@ -0,0 +1,543 @@
+@comment $NetBSD: PLIST,v 1.16 2022/11/14 18:44:05 adam Exp $
+bin/lldb
+bin/lldb-argdumper
+bin/lldb-instr
+bin/lldb-server
+bin/lldb-vscode
+include/lldb/API/LLDB.h
+include/lldb/API/SBAddress.h
+include/lldb/API/SBAttachInfo.h
+include/lldb/API/SBBlock.h
+include/lldb/API/SBBreakpoint.h
+include/lldb/API/SBBreakpointLocation.h
+include/lldb/API/SBBreakpointName.h
+include/lldb/API/SBBroadcaster.h
+include/lldb/API/SBCommandInterpreter.h
+include/lldb/API/SBCommandInterpreterRunOptions.h
+include/lldb/API/SBCommandReturnObject.h
+include/lldb/API/SBCommunication.h
+include/lldb/API/SBCompileUnit.h
+include/lldb/API/SBData.h
+include/lldb/API/SBDebugger.h
+include/lldb/API/SBDeclaration.h
+include/lldb/API/SBDefines.h
+include/lldb/API/SBEnvironment.h
+include/lldb/API/SBError.h
+include/lldb/API/SBEvent.h
+include/lldb/API/SBExecutionContext.h
+include/lldb/API/SBExpressionOptions.h
+include/lldb/API/SBFile.h
+include/lldb/API/SBFileSpec.h
+include/lldb/API/SBFileSpecList.h
+include/lldb/API/SBFrame.h
+include/lldb/API/SBFunction.h
+include/lldb/API/SBHostOS.h
+include/lldb/API/SBInstruction.h
+include/lldb/API/SBInstructionList.h
+include/lldb/API/SBLanguageRuntime.h
+include/lldb/API/SBLaunchInfo.h
+include/lldb/API/SBLineEntry.h
+include/lldb/API/SBListener.h
+include/lldb/API/SBMemoryRegionInfo.h
+include/lldb/API/SBMemoryRegionInfoList.h
+include/lldb/API/SBModule.h
+include/lldb/API/SBModuleSpec.h
+include/lldb/API/SBPlatform.h
+include/lldb/API/SBProcess.h
+include/lldb/API/SBProcessInfo.h
+include/lldb/API/SBQueue.h
+include/lldb/API/SBQueueItem.h
+include/lldb/API/SBReproducer.h
+include/lldb/API/SBSection.h
+include/lldb/API/SBSourceManager.h
+include/lldb/API/SBStream.h
+include/lldb/API/SBStringList.h
+include/lldb/API/SBStructuredData.h
+include/lldb/API/SBSymbol.h
+include/lldb/API/SBSymbolContext.h
+include/lldb/API/SBSymbolContextList.h
+include/lldb/API/SBTarget.h
+include/lldb/API/SBThread.h
+include/lldb/API/SBThreadCollection.h
+include/lldb/API/SBThreadPlan.h
+include/lldb/API/SBTrace.h
+include/lldb/API/SBType.h
+include/lldb/API/SBTypeCategory.h
+include/lldb/API/SBTypeEnumMember.h
+include/lldb/API/SBTypeFilter.h
+include/lldb/API/SBTypeFormat.h
+include/lldb/API/SBTypeNameSpecifier.h
+include/lldb/API/SBTypeSummary.h
+include/lldb/API/SBTypeSynthetic.h
+include/lldb/API/SBUnixSignals.h
+include/lldb/API/SBValue.h
+include/lldb/API/SBValueList.h
+include/lldb/API/SBVariablesOptions.h
+include/lldb/API/SBWatchpoint.h
+include/lldb/Breakpoint/Breakpoint.h
+include/lldb/Breakpoint/BreakpointID.h
+include/lldb/Breakpoint/BreakpointIDList.h
+include/lldb/Breakpoint/BreakpointList.h
+include/lldb/Breakpoint/BreakpointLocation.h
+include/lldb/Breakpoint/BreakpointLocationCollection.h
+include/lldb/Breakpoint/BreakpointLocationList.h
+include/lldb/Breakpoint/BreakpointName.h
+include/lldb/Breakpoint/BreakpointOptions.h
+include/lldb/Breakpoint/BreakpointPrecondition.h
+include/lldb/Breakpoint/BreakpointResolver.h
+include/lldb/Breakpoint/BreakpointResolverAddress.h
+include/lldb/Breakpoint/BreakpointResolverFileLine.h
+include/lldb/Breakpoint/BreakpointResolverFileRegex.h
+include/lldb/Breakpoint/BreakpointResolverName.h
+include/lldb/Breakpoint/BreakpointResolverScripted.h
+include/lldb/Breakpoint/BreakpointSite.h
+include/lldb/Breakpoint/BreakpointSiteList.h
+include/lldb/Breakpoint/Stoppoint.h
+include/lldb/Breakpoint/StoppointCallbackContext.h
+include/lldb/Breakpoint/StoppointHitCounter.h
+include/lldb/Breakpoint/StoppointSite.h
+include/lldb/Breakpoint/Watchpoint.h
+include/lldb/Breakpoint/WatchpointList.h
+include/lldb/Breakpoint/WatchpointOptions.h
+include/lldb/Core/Address.h
+include/lldb/Core/AddressRange.h
+include/lldb/Core/AddressResolver.h
+include/lldb/Core/AddressResolverFileLine.h
+include/lldb/Core/Architecture.h
+include/lldb/Core/Communication.h
+include/lldb/Core/DataFileCache.h
+include/lldb/Core/Debugger.h
+include/lldb/Core/DebuggerEvents.h
+include/lldb/Core/Declaration.h
+include/lldb/Core/Disassembler.h
+include/lldb/Core/DumpDataExtractor.h
+include/lldb/Core/DumpRegisterValue.h
+include/lldb/Core/EmulateInstruction.h
+include/lldb/Core/FileLineResolver.h
+include/lldb/Core/FileSpecList.h
+include/lldb/Core/FormatEntity.h
+include/lldb/Core/Highlighter.h
+include/lldb/Core/IOHandler.h
+include/lldb/Core/IOHandlerCursesGUI.h
+include/lldb/Core/IOStreamMacros.h
+include/lldb/Core/LoadedModuleInfoList.h
+include/lldb/Core/Mangled.h
+include/lldb/Core/MappedHash.h
+include/lldb/Core/Module.h
+include/lldb/Core/ModuleChild.h
+include/lldb/Core/ModuleList.h
+include/lldb/Core/ModuleSpec.h
+include/lldb/Core/Opcode.h
+include/lldb/Core/PluginInterface.h
+include/lldb/Core/PluginManager.h
+include/lldb/Core/Progress.h
+include/lldb/Core/RichManglingContext.h
+include/lldb/Core/SearchFilter.h
+include/lldb/Core/Section.h
+include/lldb/Core/SourceLocationSpec.h
+include/lldb/Core/SourceManager.h
+include/lldb/Core/StreamAsynchronousIO.h
+include/lldb/Core/StreamBuffer.h
+include/lldb/Core/StreamFile.h
+include/lldb/Core/StructuredDataImpl.h
+include/lldb/Core/ThreadSafeDenseMap.h
+include/lldb/Core/ThreadSafeDenseSet.h
+include/lldb/Core/ThreadSafeValue.h
+include/lldb/Core/UniqueCStringMap.h
+include/lldb/Core/UserSettingsController.h
+include/lldb/Core/Value.h
+include/lldb/Core/ValueObject.h
+include/lldb/Core/ValueObjectCast.h
+include/lldb/Core/ValueObjectChild.h
+include/lldb/Core/ValueObjectConstResult.h
+include/lldb/Core/ValueObjectConstResultCast.h
+include/lldb/Core/ValueObjectConstResultChild.h
+include/lldb/Core/ValueObjectConstResultImpl.h
+include/lldb/Core/ValueObjectDynamicValue.h
+include/lldb/Core/ValueObjectList.h
+include/lldb/Core/ValueObjectMemory.h
+include/lldb/Core/ValueObjectRegister.h
+include/lldb/Core/ValueObjectSyntheticFilter.h
+include/lldb/Core/ValueObjectUpdater.h
+include/lldb/Core/ValueObjectVariable.h
+include/lldb/Core/dwarf.h
+include/lldb/DataFormatters/CXXFunctionPointer.h
+include/lldb/DataFormatters/DataVisualization.h
+include/lldb/DataFormatters/DumpValueObjectOptions.h
+include/lldb/DataFormatters/FormatCache.h
+include/lldb/DataFormatters/FormatClasses.h
+include/lldb/DataFormatters/FormatManager.h
+include/lldb/DataFormatters/FormattersContainer.h
+include/lldb/DataFormatters/FormattersHelpers.h
+include/lldb/DataFormatters/LanguageCategory.h
+include/lldb/DataFormatters/StringPrinter.h
+include/lldb/DataFormatters/TypeCategory.h
+include/lldb/DataFormatters/TypeCategoryMap.h
+include/lldb/DataFormatters/TypeFormat.h
+include/lldb/DataFormatters/TypeSummary.h
+include/lldb/DataFormatters/TypeSynthetic.h
+include/lldb/DataFormatters/ValueObjectPrinter.h
+include/lldb/DataFormatters/VectorIterator.h
+include/lldb/DataFormatters/VectorType.h
+include/lldb/Expression/DWARFExpression.h
+include/lldb/Expression/DWARFExpressionList.h
+include/lldb/Expression/DiagnosticManager.h
+include/lldb/Expression/DynamicCheckerFunctions.h
+include/lldb/Expression/Expression.h
+include/lldb/Expression/ExpressionParser.h
+include/lldb/Expression/ExpressionSourceCode.h
+include/lldb/Expression/ExpressionTypeSystemHelper.h
+include/lldb/Expression/ExpressionVariable.h
+include/lldb/Expression/FunctionCaller.h
+include/lldb/Expression/IRExecutionUnit.h
+include/lldb/Expression/IRInterpreter.h
+include/lldb/Expression/IRMemoryMap.h
+include/lldb/Expression/LLVMUserExpression.h
+include/lldb/Expression/Materializer.h
+include/lldb/Expression/REPL.h
+include/lldb/Expression/UserExpression.h
+include/lldb/Expression/UtilityFunction.h
+include/lldb/Host/Config.h
+include/lldb/Host/ConnectionFileDescriptor.h
+include/lldb/Host/Debug.h
+include/lldb/Host/Editline.h
+include/lldb/Host/File.h
+include/lldb/Host/FileAction.h
+include/lldb/Host/FileCache.h
+include/lldb/Host/FileSystem.h
+include/lldb/Host/Host.h
+include/lldb/Host/HostGetOpt.h
+include/lldb/Host/HostInfo.h
+include/lldb/Host/HostInfoBase.h
+include/lldb/Host/HostNativeProcess.h
+include/lldb/Host/HostNativeProcessBase.h
+include/lldb/Host/HostNativeThread.h
+include/lldb/Host/HostNativeThreadBase.h
+include/lldb/Host/HostNativeThreadForward.h
+include/lldb/Host/HostProcess.h
+include/lldb/Host/HostThread.h
+include/lldb/Host/LZMA.h
+include/lldb/Host/LockFile.h
+include/lldb/Host/LockFileBase.h
+include/lldb/Host/MainLoop.h
+include/lldb/Host/MainLoopBase.h
+include/lldb/Host/MonitoringProcessLauncher.h
+include/lldb/Host/OptionParser.h
+include/lldb/Host/Pipe.h
+include/lldb/Host/PipeBase.h
+include/lldb/Host/PosixApi.h
+include/lldb/Host/ProcessLaunchInfo.h
+include/lldb/Host/ProcessLauncher.h
+include/lldb/Host/ProcessRunLock.h
+include/lldb/Host/PseudoTerminal.h
+include/lldb/Host/SafeMachO.h
+include/lldb/Host/Socket.h
+include/lldb/Host/SocketAddress.h
+include/lldb/Host/Terminal.h
+include/lldb/Host/ThreadLauncher.h
+include/lldb/Host/Time.h
+include/lldb/Host/XML.h
+include/lldb/Host/android/HostInfoAndroid.h
+include/lldb/Host/common/GetOptInc.h
+include/lldb/Host/common/NativeBreakpointList.h
+include/lldb/Host/common/NativeProcessProtocol.h
+include/lldb/Host/common/NativeRegisterContext.h
+include/lldb/Host/common/NativeThreadProtocol.h
+include/lldb/Host/common/NativeWatchpointList.h
+include/lldb/Host/common/TCPSocket.h
+include/lldb/Host/common/UDPSocket.h
+include/lldb/Host/freebsd/HostInfoFreeBSD.h
+include/lldb/Host/linux/AbstractSocket.h
+include/lldb/Host/linux/Host.h
+include/lldb/Host/linux/HostInfoLinux.h
+include/lldb/Host/linux/Ptrace.h
+include/lldb/Host/linux/Support.h
+include/lldb/Host/linux/Uio.h
+include/lldb/Host/macosx/HostInfoMacOSX.h
+include/lldb/Host/macosx/HostThreadMacOSX.h
+include/lldb/Host/netbsd/HostInfoNetBSD.h
+include/lldb/Host/openbsd/HostInfoOpenBSD.h
+include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
+include/lldb/Host/posix/DomainSocket.h
+include/lldb/Host/posix/Fcntl.h
+include/lldb/Host/posix/HostInfoPosix.h
+include/lldb/Host/posix/HostProcessPosix.h
+include/lldb/Host/posix/HostThreadPosix.h
+include/lldb/Host/posix/LockFilePosix.h
+include/lldb/Host/posix/PipePosix.h
+include/lldb/Host/posix/ProcessLauncherPosixFork.h
+include/lldb/Host/windows/AutoHandle.h
+include/lldb/Host/windows/ConnectionGenericFileWindows.h
+include/lldb/Host/windows/HostInfoWindows.h
+include/lldb/Host/windows/HostProcessWindows.h
+include/lldb/Host/windows/HostThreadWindows.h
+include/lldb/Host/windows/LockFileWindows.h
+include/lldb/Host/windows/PipeWindows.h
+include/lldb/Host/windows/PosixApi.h
+include/lldb/Host/windows/ProcessLauncherWindows.h
+include/lldb/Host/windows/windows.h
+include/lldb/Initialization/SystemInitializer.h
+include/lldb/Initialization/SystemInitializerCommon.h
+include/lldb/Initialization/SystemLifetimeManager.h
+include/lldb/Interpreter/CommandAlias.h
+include/lldb/Interpreter/CommandCompletions.h
+include/lldb/Interpreter/CommandHistory.h
+include/lldb/Interpreter/CommandInterpreter.h
+include/lldb/Interpreter/CommandObject.h
+include/lldb/Interpreter/CommandObjectMultiword.h
+include/lldb/Interpreter/CommandOptionArgumentTable.h
+include/lldb/Interpreter/CommandOptionValidators.h
+include/lldb/Interpreter/CommandReturnObject.h
+include/lldb/Interpreter/OptionArgParser.h
+include/lldb/Interpreter/OptionGroupArchitecture.h
+include/lldb/Interpreter/OptionGroupBoolean.h
+include/lldb/Interpreter/OptionGroupFile.h
+include/lldb/Interpreter/OptionGroupFormat.h
+include/lldb/Interpreter/OptionGroupMemoryTag.h
+include/lldb/Interpreter/OptionGroupOutputFile.h
+include/lldb/Interpreter/OptionGroupPlatform.h
+include/lldb/Interpreter/OptionGroupPythonClassWithDict.h
+include/lldb/Interpreter/OptionGroupString.h
+include/lldb/Interpreter/OptionGroupUInt64.h
+include/lldb/Interpreter/OptionGroupUUID.h
+include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
+include/lldb/Interpreter/OptionGroupVariable.h
+include/lldb/Interpreter/OptionGroupWatchpoint.h
+include/lldb/Interpreter/OptionValue.h
+include/lldb/Interpreter/OptionValueArch.h
+include/lldb/Interpreter/OptionValueArgs.h
+include/lldb/Interpreter/OptionValueArray.h
+include/lldb/Interpreter/OptionValueBoolean.h
+include/lldb/Interpreter/OptionValueChar.h
+include/lldb/Interpreter/OptionValueDictionary.h
+include/lldb/Interpreter/OptionValueEnumeration.h
+include/lldb/Interpreter/OptionValueFileColonLine.h
+include/lldb/Interpreter/OptionValueFileSpec.h
+include/lldb/Interpreter/OptionValueFileSpecList.h
+include/lldb/Interpreter/OptionValueFormat.h
+include/lldb/Interpreter/OptionValueFormatEntity.h
+include/lldb/Interpreter/OptionValueLanguage.h
+include/lldb/Interpreter/OptionValuePathMappings.h
+include/lldb/Interpreter/OptionValueProperties.h
+include/lldb/Interpreter/OptionValueRegex.h
+include/lldb/Interpreter/OptionValueSInt64.h
+include/lldb/Interpreter/OptionValueString.h
+include/lldb/Interpreter/OptionValueUInt64.h
+include/lldb/Interpreter/OptionValueUUID.h
+include/lldb/Interpreter/OptionValues.h
+include/lldb/Interpreter/Options.h
+include/lldb/Interpreter/Property.h
+include/lldb/Interpreter/ScriptInterpreter.h
+include/lldb/Interpreter/ScriptedInterface.h
+include/lldb/Interpreter/ScriptedProcessInterface.h
+include/lldb/Symbol/ArmUnwindInfo.h
+include/lldb/Symbol/Block.h
+include/lldb/Symbol/CallFrameInfo.h
+include/lldb/Symbol/CompactUnwindInfo.h
+include/lldb/Symbol/CompileUnit.h
+include/lldb/Symbol/CompilerDecl.h
+include/lldb/Symbol/CompilerDeclContext.h
+include/lldb/Symbol/CompilerType.h
+include/lldb/Symbol/DWARFCallFrameInfo.h
+include/lldb/Symbol/DebugMacros.h
+include/lldb/Symbol/DeclVendor.h
+include/lldb/Symbol/FuncUnwinders.h
+include/lldb/Symbol/Function.h
+include/lldb/Symbol/LineEntry.h
+include/lldb/Symbol/LineTable.h
+include/lldb/Symbol/LocateSymbolFile.h
+include/lldb/Symbol/ObjectContainer.h
+include/lldb/Symbol/ObjectFile.h
+include/lldb/Symbol/PostfixExpression.h
+include/lldb/Symbol/SourceModule.h
+include/lldb/Symbol/Symbol.h
+include/lldb/Symbol/SymbolContext.h
+include/lldb/Symbol/SymbolContextScope.h
+include/lldb/Symbol/SymbolFile.h
+include/lldb/Symbol/SymbolFileOnDemand.h
+include/lldb/Symbol/SymbolVendor.h
+include/lldb/Symbol/Symtab.h
+include/lldb/Symbol/TaggedASTType.h
+include/lldb/Symbol/Type.h
+include/lldb/Symbol/TypeList.h
+include/lldb/Symbol/TypeMap.h
+include/lldb/Symbol/TypeSystem.h
+include/lldb/Symbol/UnwindPlan.h
+include/lldb/Symbol/UnwindTable.h
+include/lldb/Symbol/Variable.h
+include/lldb/Symbol/VariableList.h
+include/lldb/Target/ABI.h
+include/lldb/Target/AppleArm64ExceptionClass.h
+include/lldb/Target/AssertFrameRecognizer.h
+include/lldb/Target/DynamicLoader.h
+include/lldb/Target/DynamicRegisterInfo.h
+include/lldb/Target/ExecutionContext.h
+include/lldb/Target/ExecutionContextScope.h
+include/lldb/Target/InstrumentationRuntime.h
+include/lldb/Target/InstrumentationRuntimeStopInfo.h
+include/lldb/Target/JITLoader.h
+include/lldb/Target/JITLoaderList.h
+include/lldb/Target/Language.h
+include/lldb/Target/LanguageRuntime.h
+include/lldb/Target/Memory.h
+include/lldb/Target/MemoryHistory.h
+include/lldb/Target/MemoryRegionInfo.h
+include/lldb/Target/MemoryTagManager.h
+include/lldb/Target/MemoryTagMap.h
+include/lldb/Target/ModuleCache.h
+include/lldb/Target/OperatingSystem.h
+include/lldb/Target/PathMappingList.h
+include/lldb/Target/Platform.h
+include/lldb/Target/PostMortemProcess.h
+include/lldb/Target/Process.h
+include/lldb/Target/ProcessStructReader.h
+include/lldb/Target/ProcessTrace.h
+include/lldb/Target/Queue.h
+include/lldb/Target/QueueItem.h
+include/lldb/Target/QueueList.h
+include/lldb/Target/RegisterCheckpoint.h
+include/lldb/Target/RegisterContext.h
+include/lldb/Target/RegisterContextUnwind.h
+include/lldb/Target/RegisterNumber.h
+include/lldb/Target/RemoteAwarePlatform.h
+include/lldb/Target/Runtime.h
+include/lldb/Target/SectionLoadHistory.h
+include/lldb/Target/SectionLoadList.h
+include/lldb/Target/StackFrame.h
+include/lldb/Target/StackFrameList.h
+include/lldb/Target/StackFrameRecognizer.h
+include/lldb/Target/StackID.h
+include/lldb/Target/Statistics.h
+include/lldb/Target/StopInfo.h
+include/lldb/Target/StructuredDataPlugin.h
+include/lldb/Target/SystemRuntime.h
+include/lldb/Target/Target.h
+include/lldb/Target/TargetList.h
+include/lldb/Target/Thread.h
+include/lldb/Target/ThreadCollection.h
+include/lldb/Target/ThreadList.h
+include/lldb/Target/ThreadPlan.h
+include/lldb/Target/ThreadPlanBase.h
+include/lldb/Target/ThreadPlanCallFunction.h
+include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
+include/lldb/Target/ThreadPlanCallOnFunctionExit.h
+include/lldb/Target/ThreadPlanCallUserExpression.h
+include/lldb/Target/ThreadPlanPython.h
+include/lldb/Target/ThreadPlanRunToAddress.h
+include/lldb/Target/ThreadPlanShouldStopHere.h
+include/lldb/Target/ThreadPlanStack.h
+include/lldb/Target/ThreadPlanStepInRange.h
+include/lldb/Target/ThreadPlanStepInstruction.h
+include/lldb/Target/ThreadPlanStepOut.h
+include/lldb/Target/ThreadPlanStepOverBreakpoint.h
+include/lldb/Target/ThreadPlanStepOverRange.h
+include/lldb/Target/ThreadPlanStepRange.h
+include/lldb/Target/ThreadPlanStepThrough.h
+include/lldb/Target/ThreadPlanStepUntil.h
+include/lldb/Target/ThreadPlanTracer.h
+include/lldb/Target/ThreadSpec.h
+include/lldb/Target/Trace.h
+include/lldb/Target/TraceCursor.h
+include/lldb/Target/TraceDumper.h
+include/lldb/Target/TraceExporter.h
+include/lldb/Target/UnixSignals.h
+include/lldb/Target/Unwind.h
+include/lldb/Target/UnwindAssembly.h
+include/lldb/Target/UnwindLLDB.h
+include/lldb/Utility/AnsiTerminal.h
+include/lldb/Utility/ArchSpec.h
+include/lldb/Utility/Args.h
+include/lldb/Utility/Baton.h
+include/lldb/Utility/Broadcaster.h
+include/lldb/Utility/Cloneable.h
+include/lldb/Utility/CompletionRequest.h
+include/lldb/Utility/Connection.h
+include/lldb/Utility/ConstString.h
+include/lldb/Utility/DataBuffer.h
+include/lldb/Utility/DataBufferHeap.h
+include/lldb/Utility/DataBufferLLVM.h
+include/lldb/Utility/DataEncoder.h
+include/lldb/Utility/DataExtractor.h
+include/lldb/Utility/Endian.h
+include/lldb/Utility/Environment.h
+include/lldb/Utility/Event.h
+include/lldb/Utility/FileSpec.h
+include/lldb/Utility/Flags.h
+include/lldb/Utility/GDBRemote.h
+include/lldb/Utility/IOObject.h
+include/lldb/Utility/Instrumentation.h
+include/lldb/Utility/Iterable.h
+include/lldb/Utility/LLDBAssert.h
+include/lldb/Utility/LLDBLog.h
+include/lldb/Utility/Listener.h
+include/lldb/Utility/Log.h
+include/lldb/Utility/NameMatches.h
+include/lldb/Utility/OptionDefinition.h
+include/lldb/Utility/Predicate.h
+include/lldb/Utility/ProcessInfo.h
+include/lldb/Utility/RangeMap.h
+include/lldb/Utility/RegisterValue.h
+include/lldb/Utility/RegularExpression.h
+include/lldb/Utility/Reproducer.h
+include/lldb/Utility/ReproducerProvider.h
+include/lldb/Utility/Scalar.h
+include/lldb/Utility/SelectHelper.h
+include/lldb/Utility/SharedCluster.h
+include/lldb/Utility/State.h
+include/lldb/Utility/Status.h
+include/lldb/Utility/Stream.h
+include/lldb/Utility/StreamString.h
+include/lldb/Utility/StreamTee.h
+include/lldb/Utility/StringExtractor.h
+include/lldb/Utility/StringExtractorGDBRemote.h
+include/lldb/Utility/StringLexer.h
+include/lldb/Utility/StringList.h
+include/lldb/Utility/StructuredData.h
+include/lldb/Utility/TildeExpressionResolver.h
+include/lldb/Utility/Timeout.h
+include/lldb/Utility/Timer.h
+include/lldb/Utility/TraceGDBRemotePackets.h
+include/lldb/Utility/TraceIntelPTGDBRemotePackets.h
+include/lldb/Utility/UUID.h
+include/lldb/Utility/UnimplementedError.h
+include/lldb/Utility/UriParser.h
+include/lldb/Utility/UserID.h
+include/lldb/Utility/UserIDResolver.h
+include/lldb/Utility/VASPrintf.h
+include/lldb/Utility/VMRange.h
+include/lldb/Utility/XcodeSDK.h
+include/lldb/Version/Version.h
+include/lldb/lldb-defines.h
+include/lldb/lldb-enumerations.h
+include/lldb/lldb-forward.h
+include/lldb/lldb-private-defines.h
+include/lldb/lldb-private-enumerations.h
+include/lldb/lldb-private-forward.h
+include/lldb/lldb-private-interfaces.h
+include/lldb/lldb-private-types.h
+include/lldb/lldb-private.h
+include/lldb/lldb-public.h
+include/lldb/lldb-types.h
+include/lldb/lldb-versioning.h
+lib/liblldb.so
+lib/liblldb.so.${PKGVERSION}
+lib/liblldb.so.15
+lib/lua/5.3/lldb.so
+${PYSITELIB}/lldb/__init__.py
+${PYSITELIB}/lldb/_lldb.so
+${PYSITELIB}/lldb/embedded_interpreter.py
+${PYSITELIB}/lldb/formatters/Logger.py
+${PYSITELIB}/lldb/formatters/__init__.py
+${PYSITELIB}/lldb/formatters/attrib_fromdict.py
+${PYSITELIB}/lldb/formatters/cache.py
+${PYSITELIB}/lldb/formatters/cpp/__init__.py
+${PYSITELIB}/lldb/formatters/cpp/gnu_libstdcpp.py
+${PYSITELIB}/lldb/formatters/cpp/libcxx.py
+${PYSITELIB}/lldb/formatters/metrics.py
+${PYSITELIB}/lldb/formatters/synth.py
+${PYSITELIB}/lldb/lldb-argdumper
+${PYSITELIB}/lldb/plugins/__init__.py
+${PYSITELIB}/lldb/plugins/scripted_process.py
+${PYSITELIB}/lldb/utils/__init__.py
+${PYSITELIB}/lldb/utils/in_call_stack.py
+${PYSITELIB}/lldb/utils/symbolication.py
diff --git a/lldb/PLIST.Darwin b/lldb/PLIST.Darwin
new file mode 100644
index 0000000000..aabc19f973
--- /dev/null
+++ b/lldb/PLIST.Darwin
@@ -0,0 +1,12 @@
+@comment $NetBSD: PLIST.Darwin,v 1.7 2022/11/14 18:44:05 adam Exp $
+bin/darwin-debug
+bin/debugserver
+${PYSITELIB}/lldb/diagnose/__init__.py
+${PYSITELIB}/lldb/diagnose/diagnose_nsstring.py
+${PYSITELIB}/lldb/diagnose/diagnose_unwind.py
+${PYSITELIB}/lldb/macosx/__init__.py
+${PYSITELIB}/lldb/macosx/crashlog.py
+${PYSITELIB}/lldb/macosx/crashlog_scripted_process.py
+${PYSITELIB}/lldb/macosx/heap.py
+${PYSITELIB}/lldb/macosx/heap/Makefile
+${PYSITELIB}/lldb/macosx/heap/heap_find.cpp
diff --git a/lldb/PLIST.Linux b/lldb/PLIST.Linux
new file mode 100644
index 0000000000..3f27997bde
--- /dev/null
+++ b/lldb/PLIST.Linux
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.Linux,v 1.1 2021/05/15 08:22:06 nia Exp $
+lib/liblldbIntelFeatures.so
+lib/liblldbIntelFeatures.so.10
diff --git a/lldb/buildlink3.mk b/lldb/buildlink3.mk
new file mode 100644
index 0000000000..66d42793a4
--- /dev/null
+++ b/lldb/buildlink3.mk
@@ -0,0 +1,18 @@
+# $NetBSD: buildlink3.mk,v 1.15 2023/04/19 08:08:18 adam Exp $
+
+BUILDLINK_TREE+=	lldb
+
+.if !defined(LLDB_BUILDLINK3_MK)
+LLDB_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lldb+=	lldb>=9.0.1
+BUILDLINK_ABI_DEPENDS.lldb+=	lldb>=15.0.7nb1
+BUILDLINK_PKGSRCDIR.lldb?=	../../wip/lldb
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../wip/clang/buildlink3.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.endif	# LLDB_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-lldb
diff --git a/lldb/distinfo b/lldb/distinfo
new file mode 100644
index 0000000000..db0a7628ea
--- /dev/null
+++ b/lldb/distinfo
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.35 2023/01/12 19:32:53 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (lldb-16.0.1.src.tar.xz) = 0405016b04b5f275f280f150dc7fdc02211b4fbf6e34f9063e5d819dd70c735a
+SHA512 (lldb-16.0.1.src.tar.xz) = 1691f8b25e76fa070a3ff4a6b13675e6af9926a5b9039052969a7881f1f478777f92c214df69847d958ae67275b4ff05568420cbc39a2ed5bf8c24b436bac568
+Size (lldb-16.0.1.src.tar.xz) = 10379168 bytes
+SHA1 (patch-cmake_modules_LLDBStandalone.cmake) = 773d420c3fd2c9b4af6af9d42c5778e96a1ae52b
+SHA1 (patch-source_API_CMakeLists.txt) = 23a7b24632f937a4541863aff6a7591255cafe40
+SHA1 (patch-source_Host_netbsd_HostNetBSD.cpp) = 8c19657d90ffea176b1297331fd23a8b565c6f1d
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 15c6d8399198de567b4e901533e1b1f77d9e348f
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 26a7298b835b97b89257975f7e87f0f8225e5f99
diff --git a/lldb/patches/patch-cmake_modules_LLDBStandalone.cmake b/lldb/patches/patch-cmake_modules_LLDBStandalone.cmake
new file mode 100644
index 0000000000..0431be1670
--- /dev/null
+++ b/lldb/patches/patch-cmake_modules_LLDBStandalone.cmake
@@ -0,0 +1,12 @@
+$NetBSD: patch-cmake_modules_LLDBStandalone.cmake,v 1.5 2022/08/12 08:54:31 pin Exp $
+
+--- cmake/modules/LLDBStandalone.cmake.orig	2022-06-22 16:46:24.000000000 +0000
++++ cmake/modules/LLDBStandalone.cmake
+@@ -85,7 +85,6 @@ list(APPEND CMAKE_MODULE_PATH "${LLVM_DI
+ include(AddLLVM)
+ include(TableGen)
+ include(HandleLLVMOptions)
+-include(CheckAtomic)
+ include(LLVMDistributionSupport)
+ 
+ set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
diff --git a/lldb/patches/patch-source_API_CMakeLists.txt b/lldb/patches/patch-source_API_CMakeLists.txt
new file mode 100644
index 0000000000..d3ac7db389
--- /dev/null
+++ b/lldb/patches/patch-source_API_CMakeLists.txt
@@ -0,0 +1,17 @@
+$NetBSD: patch-source_API_CMakeLists.txt,v 1.6 2022/08/12 08:54:31 pin Exp $
+
+Fix finding libxml2's includes.
+
+--- source/API/CMakeLists.txt.orig	2022-06-22 16:46:24.000000000 +0000
++++ source/API/CMakeLists.txt
+@@ -15,6 +15,10 @@ if(LLDB_ENABLE_LUA)
+   set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
+ endif()
+ 
++if(LIBXML2_FOUND)
++  include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
++endif()
++
+ add_lldb_library(liblldb SHARED ${option_framework}
+   SBAddress.cpp
+   SBAttachInfo.cpp
diff --git a/lldb/patches/patch-source_Host_netbsd_HostNetBSD.cpp b/lldb/patches/patch-source_Host_netbsd_HostNetBSD.cpp
new file mode 100644
index 0000000000..42f3827786
--- /dev/null
+++ b/lldb/patches/patch-source_Host_netbsd_HostNetBSD.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-source_Host_netbsd_HostNetBSD.cpp,v 1.1 2022/11/14 18:46:39 adam Exp $
+
+Fix build on NetBSD.
+
+--- source/Host/netbsd/HostNetBSD.cpp.orig	2022-11-10 13:48:56.029150970 +0000
++++ source/Host/netbsd/HostNetBSD.cpp
+@@ -109,7 +109,7 @@ static bool GetNetBSDProcessCPUType(Proc
+         process_info.GetExecutableFile(), 0x20, 0);
+     if (buffer_sp) {
+       uint8_t exe_class = llvm::object::getElfArchType(
+-                              {reinterpret_cast<char *>(buffer_sp->GetBytes()),
++                              {reinterpret_cast<const char *>(buffer_sp->GetBytes()),
+                                size_t(buffer_sp->GetByteSize())})
+                               .first;
+ 
diff --git a/lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp b/lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
new file mode 100644
index 0000000000..d1ba202278
--- /dev/null
+++ b/lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -0,0 +1,54 @@
+$NetBSD: patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp,v 1.3 2022/08/12 08:54:31 pin Exp $
+
+Provide StopProcess.
+
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2022-06-22 16:46:24.000000000 +0000
++++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+@@ -381,6 +381,29 @@ void NativeProcessNetBSD::MonitorSignal(
+   SetState(StateType::eStateStopped, true);
+ }
+ 
++Status NativeProcessNetBSD::StopProcess(lldb::pid_t pid) {
++#ifdef PT_STOP
++  return PtraceWrapper(PT_STOP, pid);
++#else
++  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PTRACE));
++  int ret;
++  Status error;
++
++  errno = 0;
++  ret = kill(pid, SIGSTOP);
++
++  if (ret == -1)
++    error.SetErrorToErrno();
++
++  LLDB_LOG(log, "kill({0}, SIGSTOP)", pid);
++
++  if (error.Fail())
++    LLDB_LOG(log, "kill() failed: {0}", error);
++
++  return error;  
++#endif
++}
++
+ Status NativeProcessNetBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
+                                           int data, int *result) {
+   Log *log = GetLog(POSIXLog::Ptrace);
+@@ -533,7 +556,7 @@ Status NativeProcessNetBSD::Resume(const
+   return ret;
+ }
+ 
+-Status NativeProcessNetBSD::Halt() { return PtraceWrapper(PT_STOP, GetID()); }
++Status NativeProcessNetBSD::Halt() { return StopProcess(GetID()); }
+ 
+ Status NativeProcessNetBSD::Detach() {
+   Status error;
+@@ -558,7 +581,7 @@ Status NativeProcessNetBSD::Signal(int s
+ }
+ 
+ Status NativeProcessNetBSD::Interrupt() {
+-  return PtraceWrapper(PT_STOP, GetID());
++  return StopProcess(GetID());
+ }
+ 
+ Status NativeProcessNetBSD::Kill() {
diff --git a/lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h b/lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
new file mode 100644
index 0000000000..3a5caa4676
--- /dev/null
+++ b/lldb/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h,v 1.4 2022/08/12 08:54:31 pin Exp $
+
+Declare StopProcess.
+
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2022-06-22 16:46:24.000000000 +0000
++++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
+@@ -87,6 +87,7 @@ public:
+   // Interface used by NativeRegisterContext-derived classes.
+   static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr,
+                               int data = 0, int *result = nullptr);
++  static Status StopProcess(lldb::pid_t pid);
+ 
+   llvm::Expected<std::string> SaveCore(llvm::StringRef path_hint) override;
+ 
diff --git a/openmp/DESCR b/openmp/DESCR
new file mode 100644
index 0000000000..3ec76f7b97
--- /dev/null
+++ b/openmp/DESCR
@@ -0,0 +1,5 @@
+The OpenMP subproject of LLVM contains the components required to build an
+executable OpenMP program that are outside the compiler itself.
+
+Here you can find the code for the runtime library against which code compiled
+by clang -fopenmp must be linked before it can run.
diff --git a/openmp/Makefile b/openmp/Makefile
new file mode 100644
index 0000000000..1f6c6f08a4
--- /dev/null
+++ b/openmp/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile,v 1.15 2022/11/14 18:44:07 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	openmp-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	parallel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://openmp.llvm.org/
+COMMENT=	Support for the OpenMP language
+LICENSE=	apache-2.0
+
+CONFIGURE_DIRS=		${WRKDIR}/build
+CMAKE_ARG_PATH=		${WRKSRC}
+
+USE_LANGUAGES=		c gnu++14
+USE_CMAKE=		yes
+USE_TOOLS+=		perl pkg-config
+GCC_REQD+=		4.8
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DOPENMP_ENABLE_LIBOMPTARGET=OFF
+CMAKE_ARGS+=	-DOPENMP_ENABLE_OMPT_TOOLS=OFF
+
+BUILDLINK_TRANSFORM.NetBSD+=	opt:-std=c++14:-std=gnu++14 # alloca
+
+post-extract:
+	${MKDIR} ${WRKDIR}/build
+
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/openmp/PLIST b/openmp/PLIST
new file mode 100644
index 0000000000..a16edf1f18
--- /dev/null
+++ b/openmp/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1 2019/06/17 16:35:44 adam Exp $
+include/omp-tools.h
+include/omp.h
+include/ompt.h
+lib/libgomp.so
+lib/libiomp5.so
+lib/libomp.so
diff --git a/openmp/buildlink3.mk b/openmp/buildlink3.mk
new file mode 100644
index 0000000000..e9719399d8
--- /dev/null
+++ b/openmp/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: buildlink3.mk,v 1.3 2022/06/28 11:35:24 wiz Exp $
+
+BUILDLINK_TREE+=	openmp
+
+.if !defined(OPENMP_BUILDLINK3_MK)
+OPENMP_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.openmp+=	openmp>=9.0.1
+BUILDLINK_ABI_DEPENDS.openmp?=	openmp>=13.0.1nb1
+BUILDLINK_PKGSRCDIR.openmp?=	../../wip/openmp
+.endif	# OPENMP_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-openmp
diff --git a/openmp/distinfo b/openmp/distinfo
new file mode 100644
index 0000000000..c23d1e56d3
--- /dev/null
+++ b/openmp/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.17 2023/01/12 19:32:54 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (openmp-16.0.1.src.tar.xz) = 7cc4f32b121d93d3c5b57de78a98b321e5f37bffc9cdc492cf3bde0051c6086b
+SHA512 (openmp-16.0.1.src.tar.xz) = 9c22ce1c7a2d12d266d5ce88d610d5bbbbf1da9ce9ad27be10f875ad238c5353b8cac7a64a84b7b0477387f3f60577eff49cde8b4521ab66509c9cd3d90c881f
+Size (openmp-16.0.1.src.tar.xz) = 1278184 bytes
+SHA1 (patch-runtime_src_kmp__runtime.cpp) = 70f4396d4c1631fbd74692ef26b22d08675da547
diff --git a/openmp/patches/patch-runtime_src_kmp__runtime.cpp b/openmp/patches/patch-runtime_src_kmp__runtime.cpp
new file mode 100644
index 0000000000..b8cb2cdbec
--- /dev/null
+++ b/openmp/patches/patch-runtime_src_kmp__runtime.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-runtime_src_kmp__runtime.cpp,v 1.2 2022/08/12 08:49:20 pin Exp $
+
+* Support NetBSD/i386 and other 32-bit architectures.
+
+--- runtime/src/kmp_runtime.cpp.orig	2022-06-22 16:46:24.000000000 +0000
++++ runtime/src/kmp_runtime.cpp
+@@ -8754,7 +8754,7 @@ __kmp_determine_reduction_method(
+ 
+ #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
+ 
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_HURD || KMP_OS_NETBSD
+ 
+     // basic tuning
+ 
diff --git a/polly/DESCR b/polly/DESCR
new file mode 100644
index 0000000000..6750ff4476
--- /dev/null
+++ b/polly/DESCR
@@ -0,0 +1,12 @@
+Polly is a high-level loop and data-locality optimizer and optimization
+infrastructure for LLVM. It uses an abstract mathematical representation based
+on integer polyhedra to analyze and optimize the memory access pattern of a
+program. We currently perform classical loop transformations, especially tiling
+and loop fusion to improve data-locality. Polly can also exploit OpenMP level
+parallelism, expose SIMDization opportunities. Work has also be done in the
+area of automatic GPU code generation.
+
+For many users, however, it's not the existing optimizations in Polly that are
+of most interest, but the new analyses and optimizations enabled by the Polly
+infrastructure. At polyhedral.info you can get an idea of what has already been
+done and what is possible in the context of polyhedral compilation.
diff --git a/polly/Makefile b/polly/Makefile
new file mode 100644
index 0000000000..34ad904069
--- /dev/null
+++ b/polly/Makefile
@@ -0,0 +1,31 @@
+# $NetBSD: Makefile,v 1.19 2020/04/18 08:01:43 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	polly-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//}
+CATEGORIES=	devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://polly.llvm.org/
+COMMENT=	Polyhedral optimizations for LLVM
+LICENSE=	apache-2.0
+
+DEPENDS+=	llvm-${PKGVERSION_NOREV}{,nb*}:../../wip/llvm
+
+CONFIGURE_DIRS=		${WRKDIR}/build
+CMAKE_ARG_PATH=		${WRKSRC}
+
+USE_LANGUAGES=		c c++14
+USE_CMAKE=		yes
+GCC_REQD+=		4.8
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${CC:Q}
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${CXX:Q}
+
+post-extract:
+	${MKDIR} ${WRKDIR}/build
+
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/polly/PLIST b/polly/PLIST
new file mode 100644
index 0000000000..1501d0d65f
--- /dev/null
+++ b/polly/PLIST
@@ -0,0 +1,120 @@
+@comment $NetBSD: PLIST,v 1.10 2022/11/14 18:44:05 adam Exp $
+include/polly/Canonicalization.h
+include/polly/CodeGen/BlockGenerators.h
+include/polly/CodeGen/CodeGeneration.h
+include/polly/CodeGen/CodegenCleanup.h
+include/polly/CodeGen/IRBuilder.h
+include/polly/CodeGen/IslAst.h
+include/polly/CodeGen/IslExprBuilder.h
+include/polly/CodeGen/IslNodeBuilder.h
+include/polly/CodeGen/LoopGenerators.h
+include/polly/CodeGen/LoopGeneratorsGOMP.h
+include/polly/CodeGen/LoopGeneratorsKMP.h
+include/polly/CodeGen/PPCGCodeGeneration.h
+include/polly/CodeGen/PerfMonitor.h
+include/polly/CodeGen/RuntimeDebugBuilder.h
+include/polly/CodeGen/Utils.h
+include/polly/CodePreparation.h
+include/polly/Config/config.h
+include/polly/DeLICM.h
+include/polly/DeadCodeElimination.h
+include/polly/DependenceInfo.h
+include/polly/FlattenAlgo.h
+include/polly/FlattenSchedule.h
+include/polly/ForwardOpTree.h
+include/polly/JSONExporter.h
+include/polly/LinkAllPasses.h
+include/polly/ManualOptimizer.h
+include/polly/MatmulOptimizer.h
+include/polly/MaximalStaticExpansion.h
+include/polly/Options.h
+include/polly/PolyhedralInfo.h
+include/polly/PruneUnprofitable.h
+include/polly/RegisterPasses.h
+include/polly/ScheduleOptimizer.h
+include/polly/ScheduleTreeTransform.h
+include/polly/ScopBuilder.h
+include/polly/ScopDetection.h
+include/polly/ScopDetectionDiagnostic.h
+include/polly/ScopGraphPrinter.h
+include/polly/ScopInfo.h
+include/polly/ScopPass.h
+include/polly/Simplify.h
+include/polly/Support/DumpFunctionPass.h
+include/polly/Support/DumpModulePass.h
+include/polly/Support/GICHelper.h
+include/polly/Support/ISLOStream.h
+include/polly/Support/ISLOperators.h
+include/polly/Support/ISLTools.h
+include/polly/Support/LinkGPURuntime.h
+include/polly/Support/SCEVAffinator.h
+include/polly/Support/SCEVValidator.h
+include/polly/Support/ScopHelper.h
+include/polly/Support/ScopLocation.h
+include/polly/Support/VirtualInstruction.h
+include/polly/ZoneAlgo.h
+include/polly/isl/aff.h
+include/polly/isl/aff_type.h
+include/polly/isl/arg.h
+include/polly/isl/ast.h
+include/polly/isl/ast_build.h
+include/polly/isl/ast_type.h
+include/polly/isl/constraint.h
+include/polly/isl/ctx.h
+include/polly/isl/fixed_box.h
+include/polly/isl/flow.h
+include/polly/isl/hash.h
+include/polly/isl/hmap.h
+include/polly/isl/id.h
+include/polly/isl/id_to_ast_expr.h
+include/polly/isl/id_to_id.h
+include/polly/isl/id_to_pw_aff.h
+include/polly/isl/id_type.h
+include/polly/isl/ilp.h
+include/polly/isl/isl-noexceptions.h
+include/polly/isl/list.h
+include/polly/isl/local_space.h
+include/polly/isl/lp.h
+include/polly/isl/map.h
+include/polly/isl/map_to_basic_set.h
+include/polly/isl/map_type.h
+include/polly/isl/mat.h
+include/polly/isl/maybe.h
+include/polly/isl/maybe_ast_expr.h
+include/polly/isl/maybe_basic_set.h
+include/polly/isl/maybe_id.h
+include/polly/isl/maybe_pw_aff.h
+include/polly/isl/maybe_templ.h
+include/polly/isl/multi.h
+include/polly/isl/obj.h
+include/polly/isl/options.h
+include/polly/isl/point.h
+include/polly/isl/polynomial.h
+include/polly/isl/polynomial_type.h
+include/polly/isl/printer.h
+include/polly/isl/printer_type.h
+include/polly/isl/schedule.h
+include/polly/isl/schedule_node.h
+include/polly/isl/schedule_type.h
+include/polly/isl/set.h
+include/polly/isl/set_type.h
+include/polly/isl/space.h
+include/polly/isl/space_type.h
+include/polly/isl/stdint.h
+include/polly/isl/stream.h
+include/polly/isl/stride_info.h
+include/polly/isl/union_map.h
+include/polly/isl/union_map_type.h
+include/polly/isl/union_set.h
+include/polly/isl/union_set_type.h
+include/polly/isl/val.h
+include/polly/isl/val_gmp.h
+include/polly/isl/val_type.h
+include/polly/isl/vec.h
+include/polly/isl/version.h
+include/polly/isl/vertices.h
+lib/LLVMPolly.so
+lib/cmake/polly/PollyConfig.cmake
+lib/cmake/polly/PollyExports-all.cmake
+lib/libPolly.a
+lib/libPollyISL.a
diff --git a/polly/buildlink3.mk b/polly/buildlink3.mk
new file mode 100644
index 0000000000..0b436e7429
--- /dev/null
+++ b/polly/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.6 2019/12/29 15:31:21 adam Exp $
+
+BUILDLINK_TREE+=	polly
+
+.if !defined(POLLY_BUILDLINK3_MK)
+POLLY_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.polly+=	polly>=9.0.1
+BUILDLINK_PKGSRCDIR.polly?=	../../wip/polly
+
+.include "../../wip/llvm/buildlink3.mk"
+.endif	# POLLY_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-polly
diff --git a/polly/distinfo b/polly/distinfo
new file mode 100644
index 0000000000..88a78a451d
--- /dev/null
+++ b/polly/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.29 2023/01/12 19:32:53 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (polly-16.0.1.src.tar.xz) = 5ddabf2809a9bc98855b8af51aa527e74afd2bc3771a1c5fd2a2881d83608ed3
+SHA512 (polly-16.0.1.src.tar.xz) = a4f05f059736c3656438615efb1271d1249d77f33fa5855eb4f2fc8cd669bc8a6118fed2105e17c5eddbc56135b76dbd47552e0f77de64230f4b82e6e3d54132
+Size (polly-16.0.1.src.tar.xz) = 9356908 bytes
+SHA1 (patch-CMakeLists.txt) = 8138e11f858f23e0069c8fa0c07eff2b7aaf8c43
diff --git a/polly/patches/patch-CMakeLists.txt b/polly/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..847e6ab836
--- /dev/null
+++ b/polly/patches/patch-CMakeLists.txt
@@ -0,0 +1,17 @@
+$NetBSD: patch-CMakeLists.txt,v 1.4 2017/12/01 19:22:12 adam Exp $
+
+Disable tests: they require missing files from standard LLVM build (lit tool)
+
+--- CMakeLists.txt.orig	2017-07-11 11:37:35.000000000 +0000
++++ CMakeLists.txt
+@@ -176,10 +176,6 @@ add_definitions( -D_GNU_SOURCE )
+ 
+ add_subdirectory(docs)
+ add_subdirectory(lib)
+-add_subdirectory(test)
+-if (POLLY_GTEST_AVAIL)
+-  add_subdirectory(unittests)
+-endif ()
+ add_subdirectory(tools)
+ add_subdirectory(cmake)
+ # TODO: docs.
diff --git a/wasi-compiler-rt/DESCR b/wasi-compiler-rt/DESCR
new file mode 100644
index 0000000000..402651e971
--- /dev/null
+++ b/wasi-compiler-rt/DESCR
@@ -0,0 +1 @@
+compiler-rt library for WebAssembly programs built on top of WASI
diff --git a/wasi-compiler-rt/Makefile b/wasi-compiler-rt/Makefile
new file mode 100644
index 0000000000..42ebf52c9e
--- /dev/null
+++ b/wasi-compiler-rt/Makefile
@@ -0,0 +1,84 @@
+# $NetBSD: Makefile,v 1.21 2023/04/19 08:10:36 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	compiler-rt-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//:S/compiler-rt-/wasi-compiler-rt-/}
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://compiler-rt.llvm.org/
+COMMENT=	LLVM runtime libraries for WASI/WebAssembly
+LICENSE=	apache-2.0
+
+PATCHDIR=	${.CURDIR}/../../lang/compiler-rt/patches
+DISTINFO_FILE=	${.CURDIR}/../../lang/compiler-rt/distinfo
+
+NOT_FOR_PLATFORM=	NetBSD-[0-7].*-*
+
+USE_CMAKE=	yes
+USE_LANGUAGES=	c99 c++11
+USE_TOOLS+=	ggrep
+
+SSP_SUPPORTED=		no
+PKGSRC_USE_STACK_CHECK=	no
+
+CONFIGURE_DIRS=	build
+CMAKE_ARG_PATH=	${WRKSRC}/lib/builtins
+
+BUILDLINK_TRANSFORM+=	rm:-I/usr/include
+BUILDLINK_TRANSFORM+=	rm:-I${PREFIX}/include
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DCOMPILER_RT_TEST_COMPILER=${CC:Q}
+CMAKE_ARGS+=	-DCOMPILER_RT_OS_DIR:STRING=wasi
+CMAKE_ARGS+=	-DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q}
+CMAKE_ARGS+=	-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=wasm32-wasi
+CMAKE_ARGS+=	-DCOMPILER_RT_BAREMETAL_BUILD=TRUE
+CMAKE_ARGS+=	-DCMAKE_SYSROOT=${BUILDLINK_DIR}/wasi
+CMAKE_ARGS+=	-DCOMPILER_RT_BAREMETAL_BUILD=TRUE
+CMAKE_ARGS+=	-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=TRUE
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_FPIC_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_FPIE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_FNO_BUILTIN_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_STD_C11_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_FREESTANDING_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_XRAY_COMPILER_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_ATOMIC_KEYWORD:BOOL=ON
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_BFLOAT16:BOOL=OFF
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_FLOAT16:BOOL=OFF
+CMAKE_ARGS+=	-DCOMPILER_RT_HAS_ASM_LSE:BOOL=OFF
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER_WORKS=1 # Do not test clang compile
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER_WORKS=1 # Do not test clang++ compile
+CMAKE_ARGS+=	-DCOMPILER_RT_ENABLE_IOS=OFF
+
+CMAKE_INSTALL_PREFIX=	${PREFIX}/lib/clang/${PKGVERSION_NOREV}
+
+GENERATE_PLIST+=	find ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \
+			sed 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ;
+
+post-extract:
+	${MKDIR} ${WRKSRC}/build
+
+.include "../../mk/bsd.prefs.mk"
+
+# Run llvm-ranlib again on the archive. Fixes mystery build failure
+# in Firefox due to missing index (see PR pkg/56590). Might be a MAKE_JOBS
+# problem in this package?
+.if ${OPSYS} != "Darwin"
+post-install:
+	${PREFIX}/bin/llvm-ranlib \
+	  ${DESTDIR}${PREFIX}/lib/clang/${PKGVERSION_NOREV}/lib/wasi/libclang_rt.builtins-wasm32.a
+.endif
+
+ABI=			# 32
+CFLAGS=			-O2
+CXXFLAGS=		-O2
+PKGSRC_COMPILER=	clang
+CLANGBASE=		${PREFIX}
+BUILDLINK_DEPMETHOD.clang=	build
+.include "../../wip/clang/buildlink3.mk"
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../wip/wasi-libc/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/wasi-compiler-rt/buildlink3.mk b/wasi-compiler-rt/buildlink3.mk
new file mode 100644
index 0000000000..a58923aa08
--- /dev/null
+++ b/wasi-compiler-rt/buildlink3.mk
@@ -0,0 +1,17 @@
+# $NetBSD: buildlink3.mk,v 1.6 2023/01/26 01:03:01 gutteridge Exp $
+
+BUILDLINK_TREE+=	wasi-compiler-rt
+
+BUILDLINK_DEPMETHOD.wasi-compiler-rt?=	build
+
+.if !defined(WASI_COMPILER_RT_BUILDLINK3_MK)
+WASI_COMPILER_RT_BUILDLINK3_MK:=
+
+# This exact version must be kept in sync with llvm, or firefox
+# minimum build dependencies will be incorrect.
+BUILDLINK_API_DEPENDS.wasi-compiler-rt+=	wasi-compiler-rt>=15.0.7
+BUILDLINK_PKGSRCDIR.wasi-compiler-rt?=		../../wip/wasi-compiler-rt
+
+.endif	# WASI_COMPILER_RT_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-wasi-compiler-rt
diff --git a/wasi-libc/DESCR b/wasi-libc/DESCR
new file mode 100644
index 0000000000..c1841ca7a0
--- /dev/null
+++ b/wasi-libc/DESCR
@@ -0,0 +1,9 @@
+WASI Libc is a libc for WebAssembly programs built on top of WASI
+system calls. It provides a wide array of POSIX-compatible C APIs,
+including support for standard I/O, file I/O, filesystem manipulation,
+memory management, time, string, environment variables, program
+startup, and many other APIs.
+
+WASI Libc is sufficiently stable and usable for many purposes, as
+most of the POSIX-compatible APIs are stable, though it is continuing
+to evolve to better align with wasm and WASI.
diff --git a/wasi-libc/Makefile b/wasi-libc/Makefile
new file mode 100644
index 0000000000..708859fa53
--- /dev/null
+++ b/wasi-libc/Makefile
@@ -0,0 +1,58 @@
+# $NetBSD: Makefile,v 1.11 2023/04/19 08:10:36 adam Exp $
+
+GITHUB_PROJECT=	wasi-libc
+GITHUB_TAG=	079adff840032c3455eb1cb34dc9ceaa0b2bfc0c
+DISTNAME=	wasi-libc-0.0.0pre20220311
+PKGREVISION=	3
+CATEGORIES=	lang
+MASTER_SITES=	${MASTER_SITE_GITHUB:=WebAssembly/}
+
+GITHUB_SUBMODULES+=	WebAssembly WASI 3423c9c83c7219095d6e67faaf62598ad370064c wasi/tools/wasi-headers/WASI
+EXTRACT_USING=		bsdtar
+
+MAINTAINER=	ryoon%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/WebAssembly/wasi-libc/
+COMMENT=	libc for WebAssembly programs built on top of WASI
+LICENSE=	mit AND apache-2.0 # apache-2.0-with-LLVM-exception
+
+# Do not fail tests and compile time error (undefined symbols) in www/firefox.
+SSP_SUPPORTED=		no
+PKGSRC_USE_STACK_CHECK=	no
+
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD"
+.  if ${OPSYS_VERSION} < 099900
+# Use GNU find from findutils for -not option.
+TOOLS_PLATFORM.find=	# empty
+.  endif
+.endif
+
+USE_TOOLS+=	gmake
+
+# Do not crush clang-13
+BUILDLINK_TRANSFORM+=	rm:-fcommon
+
+MAKE_FLAGS+=	WASM_CC=clang
+MAKE_FLAGS+=	WASM_AR=${PREFIX}/bin/llvm-ar
+MAKE_FLAGS+=	WASM_NM=${PREFIX}/bin/llvm-nm
+MAKE_FLAGS+=	INSTALL_DIR=${DESTDIR}${PREFIX}/wasi
+BUILD_TARGET=	finish
+
+# iconv.h from libiconv get pulled in on SunOS (via clang)
+# It conflicts with musl libc so must be removed.
+pre-configure:
+	rm -f ${BUILDLINK_DIR}/include/iconv.h
+
+ABI=			# 32
+CFLAGS=			-O2
+CXXFLAGS=		-O2
+PKGSRC_COMPILER=	clang
+CLANGBASE=		${PREFIX}
+BUILDLINK_DEPMETHOD.clang=	build
+.include "../../wip/clang/buildlink3.mk"
+BUILDLINK_DEPMETHOD.llvm=	build
+.include "../../wip/llvm/buildlink3.mk"
+.if empty(PKG_BUILD_OPTIONS.llvm:Mllvm-target-webassembly)
+PKG_FAIL_REASON+=	"llvm-target-webassembly PKG_OPTION must be enabled in lang/llvm"
+.endif
+.include "../../mk/bsd.pkg.mk"
diff --git a/wasi-libc/PLIST b/wasi-libc/PLIST
new file mode 100644
index 0000000000..76609acab5
--- /dev/null
+++ b/wasi-libc/PLIST
@@ -0,0 +1,219 @@
+@comment $NetBSD: PLIST,v 1.1 2021/12/19 13:38:56 ryoon Exp $
+wasi/include/__errno.h
+wasi/include/__errno_values.h
+wasi/include/__fd_set.h
+wasi/include/__function___isatty.h
+wasi/include/__functions_malloc.h
+wasi/include/__functions_memcpy.h
+wasi/include/__header_dirent.h
+wasi/include/__header_fcntl.h
+wasi/include/__header_inttypes.h
+wasi/include/__header_netinet_in.h
+wasi/include/__header_poll.h
+wasi/include/__header_stdlib.h
+wasi/include/__header_string.h
+wasi/include/__header_sys_ioctl.h
+wasi/include/__header_sys_resource.h
+wasi/include/__header_sys_socket.h
+wasi/include/__header_sys_stat.h
+wasi/include/__header_time.h
+wasi/include/__header_unistd.h
+wasi/include/__macro_FD_SETSIZE.h
+wasi/include/__macro_PAGESIZE.h
+wasi/include/__mode_t.h
+wasi/include/__seek.h
+wasi/include/__struct_dirent.h
+wasi/include/__struct_in6_addr.h
+wasi/include/__struct_in_addr.h
+wasi/include/__struct_iovec.h
+wasi/include/__struct_msghdr.h
+wasi/include/__struct_pollfd.h
+wasi/include/__struct_rusage.h
+wasi/include/__struct_sockaddr.h
+wasi/include/__struct_sockaddr_in.h
+wasi/include/__struct_sockaddr_in6.h
+wasi/include/__struct_sockaddr_storage.h
+wasi/include/__struct_sockaddr_un.h
+wasi/include/__struct_stat.h
+wasi/include/__struct_timespec.h
+wasi/include/__struct_timeval.h
+wasi/include/__struct_tm.h
+wasi/include/__struct_tms.h
+wasi/include/__typedef_DIR.h
+wasi/include/__typedef_blkcnt_t.h
+wasi/include/__typedef_blksize_t.h
+wasi/include/__typedef_clock_t.h
+wasi/include/__typedef_clockid_t.h
+wasi/include/__typedef_dev_t.h
+wasi/include/__typedef_fd_set.h
+wasi/include/__typedef_gid_t.h
+wasi/include/__typedef_in_addr_t.h
+wasi/include/__typedef_in_port_t.h
+wasi/include/__typedef_ino_t.h
+wasi/include/__typedef_mode_t.h
+wasi/include/__typedef_nfds_t.h
+wasi/include/__typedef_nlink_t.h
+wasi/include/__typedef_off_t.h
+wasi/include/__typedef_sa_family_t.h
+wasi/include/__typedef_sigset_t.h
+wasi/include/__typedef_socklen_t.h
+wasi/include/__typedef_ssize_t.h
+wasi/include/__typedef_suseconds_t.h
+wasi/include/__typedef_time_t.h
+wasi/include/__typedef_uid_t.h
+wasi/include/alloca.h
+wasi/include/ar.h
+wasi/include/arpa/ftp.h
+wasi/include/arpa/inet.h
+wasi/include/arpa/nameser.h
+wasi/include/arpa/nameser_compat.h
+wasi/include/arpa/telnet.h
+wasi/include/arpa/tftp.h
+wasi/include/assert.h
+wasi/include/bits/alltypes.h
+wasi/include/bits/dirent.h
+wasi/include/bits/fcntl.h
+wasi/include/bits/fenv.h
+wasi/include/bits/float.h
+wasi/include/bits/hwcap.h
+wasi/include/bits/io.h
+wasi/include/bits/ioctl.h
+wasi/include/bits/ioctl_fix.h
+wasi/include/bits/ipcstat.h
+wasi/include/bits/limits.h
+wasi/include/bits/mman.h
+wasi/include/bits/poll.h
+wasi/include/bits/posix.h
+wasi/include/bits/reg.h
+wasi/include/bits/resource.h
+wasi/include/bits/signal.h
+wasi/include/bits/socket.h
+wasi/include/bits/stat.h
+wasi/include/bits/stdint.h
+wasi/include/byteswap.h
+wasi/include/complex.h
+wasi/include/cpio.h
+wasi/include/crypt.h
+wasi/include/ctype.h
+wasi/include/dirent.h
+wasi/include/endian.h
+wasi/include/err.h
+wasi/include/errno.h
+wasi/include/fcntl.h
+wasi/include/features.h
+wasi/include/fenv.h
+wasi/include/float.h
+wasi/include/fmtmsg.h
+wasi/include/fnmatch.h
+wasi/include/ftw.h
+wasi/include/getopt.h
+wasi/include/glob.h
+wasi/include/iconv.h
+wasi/include/ifaddrs.h
+wasi/include/inttypes.h
+wasi/include/iso646.h
+wasi/include/langinfo.h
+wasi/include/libgen.h
+wasi/include/limits.h
+wasi/include/locale.h
+wasi/include/malloc.h
+wasi/include/math.h
+wasi/include/memory.h
+wasi/include/monetary.h
+wasi/include/mqueue.h
+wasi/include/netinet/icmp6.h
+wasi/include/netinet/igmp.h
+wasi/include/netinet/in.h
+wasi/include/netinet/in_systm.h
+wasi/include/netinet/ip.h
+wasi/include/netinet/ip6.h
+wasi/include/netinet/ip_icmp.h
+wasi/include/netinet/tcp.h
+wasi/include/netinet/udp.h
+wasi/include/netpacket/packet.h
+wasi/include/nl_types.h
+wasi/include/poll.h
+wasi/include/regex.h
+wasi/include/sched.h
+wasi/include/search.h
+wasi/include/semaphore.h
+wasi/include/signal.h
+wasi/include/stdalign.h
+wasi/include/stdbool.h
+wasi/include/stdc-predef.h
+wasi/include/stdint.h
+wasi/include/stdio.h
+wasi/include/stdio_ext.h
+wasi/include/stdlib.h
+wasi/include/stdnoreturn.h
+wasi/include/string.h
+wasi/include/strings.h
+wasi/include/stropts.h
+wasi/include/sys/dir.h
+wasi/include/sys/errno.h
+wasi/include/sys/eventfd.h
+wasi/include/sys/fcntl.h
+wasi/include/sys/file.h
+wasi/include/sys/ioctl.h
+wasi/include/sys/mman.h
+wasi/include/sys/param.h
+wasi/include/sys/poll.h
+wasi/include/sys/random.h
+wasi/include/sys/reg.h
+wasi/include/sys/resource.h
+wasi/include/sys/select.h
+wasi/include/sys/signal.h
+wasi/include/sys/socket.h
+wasi/include/sys/stat.h
+wasi/include/sys/stropts.h
+wasi/include/sys/syscall.h
+wasi/include/sys/sysinfo.h
+wasi/include/sys/time.h
+wasi/include/sys/timeb.h
+wasi/include/sys/times.h
+wasi/include/sys/timex.h
+wasi/include/sys/ttydefaults.h
+wasi/include/sys/types.h
+wasi/include/sys/uio.h
+wasi/include/sys/un.h
+wasi/include/sys/utsname.h
+wasi/include/syscall.h
+wasi/include/sysexits.h
+wasi/include/tar.h
+wasi/include/tgmath.h
+wasi/include/threads.h
+wasi/include/time.h
+wasi/include/uchar.h
+wasi/include/unistd.h
+wasi/include/utime.h
+wasi/include/values.h
+wasi/include/wasi/api.h
+wasi/include/wasi/libc-environ.h
+wasi/include/wasi/libc-find-relpath.h
+wasi/include/wasi/libc-nocwd.h
+wasi/include/wasi/libc.h
+wasi/include/wchar.h
+wasi/include/wctype.h
+wasi/lib/wasm32-wasi/crt1-command.o
+wasi/lib/wasm32-wasi/crt1-reactor.o
+wasi/lib/wasm32-wasi/crt1.o
+wasi/lib/wasm32-wasi/libc-printscan-long-double.a
+wasi/lib/wasm32-wasi/libc-printscan-no-floating-point.a
+wasi/lib/wasm32-wasi/libc.a
+wasi/lib/wasm32-wasi/libc.imports
+wasi/lib/wasm32-wasi/libcrypt.a
+wasi/lib/wasm32-wasi/libdl.a
+wasi/lib/wasm32-wasi/libm.a
+wasi/lib/wasm32-wasi/libpthread.a
+wasi/lib/wasm32-wasi/libresolv.a
+wasi/lib/wasm32-wasi/librt.a
+wasi/lib/wasm32-wasi/libutil.a
+wasi/lib/wasm32-wasi/libwasi-emulated-getpid.a
+wasi/lib/wasm32-wasi/libwasi-emulated-mman.a
+wasi/lib/wasm32-wasi/libwasi-emulated-process-clocks.a
+wasi/lib/wasm32-wasi/libwasi-emulated-signal.a
+wasi/lib/wasm32-wasi/libxnet.a
+wasi/share/wasm32-wasi/defined-symbols.txt
+wasi/share/wasm32-wasi/include-all.c
+wasi/share/wasm32-wasi/predefined-macros.txt
+wasi/share/wasm32-wasi/undefined-symbols.txt
diff --git a/wasi-libc/buildlink3.mk b/wasi-libc/buildlink3.mk
new file mode 100644
index 0000000000..49147c292c
--- /dev/null
+++ b/wasi-libc/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/12/19 13:38:56 ryoon Exp $
+
+BUILDLINK_TREE+=	wasi-libc
+
+BUILDLINK_DEPMETHOD.wasi-libc?=	build
+
+.if !defined(WASI_LIBC_BUILDLINK3_MK)
+WASI_LIBC_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.wasi-libc+=	wasi-libc>=0.0.0pre20210923
+BUILDLINK_PKGSRCDIR.wasi-libc?=		../../wip/wasi-libc
+
+.endif	# WASI_LIBC_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-wasi-libc
diff --git a/wasi-libc/distinfo b/wasi-libc/distinfo
new file mode 100644
index 0000000000..e902ccbc0f
--- /dev/null
+++ b/wasi-libc/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.2 2022/03/15 14:33:22 wiz Exp $
+
+BLAKE2s (WebAssembly-WASI-3423c9c83c7219095d6e67faaf62598ad370064c.tar.gz) = 50040bba05e7685e002650788f5692c61f489bbf3aee20d1b8b70a0be5fec957
+SHA512 (WebAssembly-WASI-3423c9c83c7219095d6e67faaf62598ad370064c.tar.gz) = b96f2c6a2d777fa721e10cf24f8d11b71bac3c9ee308b2c223daf0477feaf6cd300897dba18d220c30a34cd34fb29f7545f4b393fc60f8b91ba0a1538b787c14
+Size (WebAssembly-WASI-3423c9c83c7219095d6e67faaf62598ad370064c.tar.gz) = 200976 bytes
+BLAKE2s (wasi-libc-0.0.0pre20220311-079adff840032c3455eb1cb34dc9ceaa0b2bfc0c.tar.gz) = cc34906d02772ce0c7b2ce36c3282c7fe91495c3ff854b0688c75b5509ddb6ee
+SHA512 (wasi-libc-0.0.0pre20220311-079adff840032c3455eb1cb34dc9ceaa0b2bfc0c.tar.gz) = f79cee2be336614a4512a074b6909689ecee57baeb16b43602bf9551c778d176901d69db6c56f4d5561f32477c76a861a3c6c73edae651b6d4d83ee439c514df
+Size (wasi-libc-0.0.0pre20220311-079adff840032c3455eb1cb34dc9ceaa0b2bfc0c.tar.gz) = 1251437 bytes
+SHA1 (patch-Makefile) = d7b66d8f5172c1ee21de7ce8075d3f41d2ed0af0
diff --git a/wasi-libc/patches/patch-Makefile b/wasi-libc/patches/patch-Makefile
new file mode 100644
index 0000000000..60f271fa81
--- /dev/null
+++ b/wasi-libc/patches/patch-Makefile
@@ -0,0 +1,19 @@
+$NetBSD: patch-Makefile,v 1.2 2022/03/15 14:33:23 wiz Exp $
+
+* Disable symbol comparison, it's fragile
+* Workaround for rebuild in install stage.
+
+--- Makefile.orig	2022-03-10 22:14:40.000000000 +0000
++++ Makefile
+@@ -545,9 +545,9 @@ check-symbols: startup_files libc
+ 
+ 	# Check that the computed metadata matches the expected metadata.
+ 	# This ignores whitespace because on Windows the output has CRLF line endings.
+-	diff -wur "$(CURDIR)/expected/$(MULTIARCH_TRIPLE)" "$(SYSROOT_SHARE)"
++	#diff -wur "$(CURDIR)/expected/$(MULTIARCH_TRIPLE)" "$(SYSROOT_SHARE)"
+ 
+-install: finish
++install:
+ 	mkdir -p "$(INSTALL_DIR)"
+ 	cp -r "$(SYSROOT)/lib" "$(SYSROOT)/share" "$(SYSROOT)/include" "$(INSTALL_DIR)"
+ 
diff --git a/wasi-libcxx/DESCR b/wasi-libcxx/DESCR
new file mode 100644
index 0000000000..f0bc2ed2ae
--- /dev/null
+++ b/wasi-libcxx/DESCR
@@ -0,0 +1 @@
+libc++abi and libc++ for WebAssembly WASI environment.
diff --git a/wasi-libcxx/Makefile b/wasi-libcxx/Makefile
new file mode 100644
index 0000000000..4e51fb266f
--- /dev/null
+++ b/wasi-libcxx/Makefile
@@ -0,0 +1,182 @@
+# $NetBSD: Makefile,v 1.19 2023/04/19 08:10:36 adam Exp $
+
+.include "../../wip/llvm/version.mk"
+
+DISTNAME=	libcxxabi-${LLVM_VERSION}.src
+PKGNAME=	${DISTNAME:S/.src//:S/libcxxabi-/wasi-libcxx-/}
+CATEGORIES=	lang devel
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://libcxxabi.llvm.org/
+COMMENT=	C++ Standard Librares (libc++/libc++abi) for WASI/WebAssembly
+LICENSE=	apache-2.0
+
+WRKSRC=		${WRKDIR}
+
+# libcxx requires libcxxabi's cxxabi.h to build, but libcxxabi requires
+# libcxx's includes to build, so we have this unholy extra distfiles thing
+# in both of them to get them to build against each other without causing
+# circular dependencies.  This must be kept in sync with libcxxabi/Makefile.
+LIBCXX=		libcxx-${LLVM_VERSION}.src
+EXTRA_DIST+=	${LIBCXX}${EXTRACT_SUFX}
+SITES.${LIBCXX}${EXTRACT_SUFX}=	\
+	${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+
+BUILD_DEPENDS+=	lld-[0-9]*:../../wip/lld
+
+# Workaround for header conflicts
+BUILDLINK_TRANSFORM+=	rm:-I/usr/include
+BUILDLINK_TRANSFORM+=	rm:-I${PREFIX}/include
+
+BUILD_DIRS+=		build_libcxx
+BUILD_DIRS+=		build_libcxxabi
+INSTALL_DIRS+=		${BUILD_DIRS}
+
+USE_LANGUAGES=	c c++
+USE_CMAKE=	yes
+
+SSP_SUPPORTED=		no
+PKGSRC_USE_STACK_CHECK=	no
+
+CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+=	-DLIBCXXABI_LIBCXX_INCLUDES=${WRKDIR}/libcxx/include
+CMAKE_ARGS+=	-DLIBCXXABI_USE_LLVM_UNWINDER=OFF
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER_WORKS=1
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER_WORKS=1
+CMAKE_ARGS+=	-DCXX_SUPPORTS_CXX11=ON
+CMAKE_ARGS+=	-DLLVM_COMPILER_CHECKED=ON
+CMAKE_ARGS+=	-DUNIX:BOOL=ON
+CMAKE_ARGS+=	-DCMAKE_SYSROOT=${BUILDLINK_DIR}/wasi
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER_TARGET=wasm32-wasi
+CMAKE_ARGS+=	-DLLVM_CONFIG_PATH=${PREFIX}/bin/llvm-config
+CMAKE_ARGS+=	-DLIBCXX_LIBDIR_SUFFIX=/wasm32-wasi
+CMAKE_ARGS+=	-DLIBCXX_INCLUDE_BENCHMARKS:BOOL=FALSE
+CMAKE_ARGS+=	-DLIBCXX_INCLUDE_TESTS:BOOL=FALSE
+CMAKE_ARGS+=	-DLIBCXX_ENABLE_THREADS:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_HAS_PTHREAD_API:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_HAS_EXTERNAL_THREAD_API:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_HAS_WIN32_THREAD_API:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_ENABLE_SHARED:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_CXX_ABI=libcxxabi
+CMAKE_ARGS+=	-DLIBCXX_HAS_MUSL_LIBC:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_ABI_VERSION=2
+CMAKE_ARGS+=	-DLIBCXXABI_LIBDIR_SUFFIX=/wasm32-wasi
+CMAKE_ARGS+=	-DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_ENABLE_SHARED:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_SILENT_TERMINATE:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_ENABLE_THREADS:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_HAS_PTHREAD_API:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_HAS_EXTERNAL_THREAD_API:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_HAS_WIN32_THREAD_API:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_NOSTDLIBXX_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_HAS_COMMENT_LIB_PRAGMA:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_FALIGNED_ALLOCATION_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_NOSTDINCXX_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_FVISIBILITY_EQ_HIDDEN_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WALL_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WEXTRA_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_W_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WWRITE_STRINGS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WNO_UNUSED_PARAMETER_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WNO_LONG_LONG_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WEXTRA_SEMI_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WNO_COVERED_SWITCH_DEFAULT_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_WNO_IGNORED_ATTRIBUTES_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_EHS_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_EHA_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_ZL_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXX_SUPPORTS_NODEFAULTLIB_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_FNO_EXCEPTIONS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_HAS_COMMENT_LIB_PRAGMA:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_FALIGNED_ALLOCATION_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_NOSTDINCXX_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_FVISIBILITY_EQ_HIDDEN_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WALL_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WEXTRA_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_W_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WWRITE_STRINGS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WNO_UNUSED_PARAMETER_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WNO_LONG_LONG_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WEXTRA_SEMI_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WNO_COVERED_SWITCH_DEFAULT_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WNO_IGNORED_ATTRIBUTES_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_EHS_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_EHA_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_ZL_FLAG:BOOL=OFF
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_NODEFAULTLIB_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WCONVERSION_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WMISMATCHED_TAGS_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WMISSING_BRACES_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WSHADOW_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_PEDANTIC_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DLIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG:BOOL=ON
+CMAKE_ARGS+=	-DCMAKE_CXX_LINK_FLAGS=${LDFLAGS:Q}
+CMAKE_ARGS+=	-DCMAKE_C_FLAGS=-fno-exceptions
+CMAKE_ARGS+=	-DCMAKE_CXX_FLAGS=-fno-exceptions
+CMAKE_ARGS+=	-DLIBCXX_CXX_ABI=system-libcxxabi
+CMAKE_ARGS+=	-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${WRKDIR}/libcxxabi/include
+
+CMAKE_INSTALL_PREFIX=	${PREFIX}/wasi
+
+# avoid conflict with stddef.h
+CPPFLAGS.NetBSD+=	-D__DEFINED_max_align_t=1
+
+post-extract:
+	${MKDIR} ${WRKDIR}/build_libcxx
+	${MKDIR} ${WRKDIR}/build_libcxxabi
+	${LN} -f -s ${WRKDIR}/${DISTNAME} ${WRKDIR}/libcxxabi
+	${LN} -f -s ${WRKDIR}/${LIBCXX} ${WRKDIR}/libcxx
+
+do-configure:
+	cd ${WRKSRC} && cd build_libcxx && \
+	${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV} \
+		cmake ${CMAKE_ARGS} ../libcxx
+	cd ${WRKSRC} && cd build_libcxxabi && \
+	${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV} \
+		cmake ${CMAKE_ARGS} ../libcxxabi
+
+# Run llvm-ranlib again on the archives. Fixes mystery build failure
+# in Firefox due to missing index (see PR pkg/56590). Might be a MAKE_JOBS
+# problem in this package?
+post-install:
+	${PREFIX}/bin/llvm-ranlib \
+	  ${DESTDIR}${PREFIX}/wasi/lib/wasm32-wasi/libc++.a
+	${PREFIX}/bin/llvm-ranlib \
+	  ${DESTDIR}${PREFIX}/wasi/lib/wasm32-wasi/libc++abi.a
+
+.include "../../wip/llvm/buildlink3.mk"
+.include "../../wip/wasi-libc/buildlink3.mk"
+.include "../../wip/wasi-compiler-rt/buildlink3.mk"
+ABI=			# 32
+CFLAGS=			-O2
+CXXFLAGS=		-O2
+PKGSRC_COMPILER=	clang
+CLANGBASE=		${PREFIX}
+BUILDLINK_DEPMETHOD.clang=	build
+.include "../../wip/clang/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/wasi-libcxx/PLIST b/wasi-libcxx/PLIST
new file mode 100644
index 0000000000..dc99e868d2
--- /dev/null
+++ b/wasi-libcxx/PLIST
@@ -0,0 +1,878 @@
+@comment $NetBSD$
+wasi/include/c++/v1/__algorithm/adjacent_find.h
+wasi/include/c++/v1/__algorithm/all_of.h
+wasi/include/c++/v1/__algorithm/any_of.h
+wasi/include/c++/v1/__algorithm/binary_search.h
+wasi/include/c++/v1/__algorithm/clamp.h
+wasi/include/c++/v1/__algorithm/comp.h
+wasi/include/c++/v1/__algorithm/comp_ref_type.h
+wasi/include/c++/v1/__algorithm/copy.h
+wasi/include/c++/v1/__algorithm/copy_backward.h
+wasi/include/c++/v1/__algorithm/copy_if.h
+wasi/include/c++/v1/__algorithm/copy_move_common.h
+wasi/include/c++/v1/__algorithm/copy_n.h
+wasi/include/c++/v1/__algorithm/count.h
+wasi/include/c++/v1/__algorithm/count_if.h
+wasi/include/c++/v1/__algorithm/equal.h
+wasi/include/c++/v1/__algorithm/equal_range.h
+wasi/include/c++/v1/__algorithm/fill.h
+wasi/include/c++/v1/__algorithm/fill_n.h
+wasi/include/c++/v1/__algorithm/find.h
+wasi/include/c++/v1/__algorithm/find_end.h
+wasi/include/c++/v1/__algorithm/find_first_of.h
+wasi/include/c++/v1/__algorithm/find_if.h
+wasi/include/c++/v1/__algorithm/find_if_not.h
+wasi/include/c++/v1/__algorithm/for_each.h
+wasi/include/c++/v1/__algorithm/for_each_n.h
+wasi/include/c++/v1/__algorithm/generate.h
+wasi/include/c++/v1/__algorithm/generate_n.h
+wasi/include/c++/v1/__algorithm/half_positive.h
+wasi/include/c++/v1/__algorithm/in_found_result.h
+wasi/include/c++/v1/__algorithm/in_fun_result.h
+wasi/include/c++/v1/__algorithm/in_in_out_result.h
+wasi/include/c++/v1/__algorithm/in_in_result.h
+wasi/include/c++/v1/__algorithm/in_out_out_result.h
+wasi/include/c++/v1/__algorithm/in_out_result.h
+wasi/include/c++/v1/__algorithm/includes.h
+wasi/include/c++/v1/__algorithm/inplace_merge.h
+wasi/include/c++/v1/__algorithm/is_heap.h
+wasi/include/c++/v1/__algorithm/is_heap_until.h
+wasi/include/c++/v1/__algorithm/is_partitioned.h
+wasi/include/c++/v1/__algorithm/is_permutation.h
+wasi/include/c++/v1/__algorithm/is_sorted.h
+wasi/include/c++/v1/__algorithm/is_sorted_until.h
+wasi/include/c++/v1/__algorithm/iter_swap.h
+wasi/include/c++/v1/__algorithm/iterator_operations.h
+wasi/include/c++/v1/__algorithm/lexicographical_compare.h
+wasi/include/c++/v1/__algorithm/lower_bound.h
+wasi/include/c++/v1/__algorithm/make_heap.h
+wasi/include/c++/v1/__algorithm/make_projected.h
+wasi/include/c++/v1/__algorithm/max.h
+wasi/include/c++/v1/__algorithm/max_element.h
+wasi/include/c++/v1/__algorithm/merge.h
+wasi/include/c++/v1/__algorithm/min.h
+wasi/include/c++/v1/__algorithm/min_element.h
+wasi/include/c++/v1/__algorithm/min_max_result.h
+wasi/include/c++/v1/__algorithm/minmax.h
+wasi/include/c++/v1/__algorithm/minmax_element.h
+wasi/include/c++/v1/__algorithm/mismatch.h
+wasi/include/c++/v1/__algorithm/move.h
+wasi/include/c++/v1/__algorithm/move_backward.h
+wasi/include/c++/v1/__algorithm/next_permutation.h
+wasi/include/c++/v1/__algorithm/none_of.h
+wasi/include/c++/v1/__algorithm/nth_element.h
+wasi/include/c++/v1/__algorithm/partial_sort.h
+wasi/include/c++/v1/__algorithm/partial_sort_copy.h
+wasi/include/c++/v1/__algorithm/partition.h
+wasi/include/c++/v1/__algorithm/partition_copy.h
+wasi/include/c++/v1/__algorithm/partition_point.h
+wasi/include/c++/v1/__algorithm/pop_heap.h
+wasi/include/c++/v1/__algorithm/prev_permutation.h
+wasi/include/c++/v1/__algorithm/push_heap.h
+wasi/include/c++/v1/__algorithm/ranges_adjacent_find.h
+wasi/include/c++/v1/__algorithm/ranges_all_of.h
+wasi/include/c++/v1/__algorithm/ranges_any_of.h
+wasi/include/c++/v1/__algorithm/ranges_binary_search.h
+wasi/include/c++/v1/__algorithm/ranges_clamp.h
+wasi/include/c++/v1/__algorithm/ranges_copy.h
+wasi/include/c++/v1/__algorithm/ranges_copy_backward.h
+wasi/include/c++/v1/__algorithm/ranges_copy_if.h
+wasi/include/c++/v1/__algorithm/ranges_copy_n.h
+wasi/include/c++/v1/__algorithm/ranges_count.h
+wasi/include/c++/v1/__algorithm/ranges_count_if.h
+wasi/include/c++/v1/__algorithm/ranges_equal.h
+wasi/include/c++/v1/__algorithm/ranges_equal_range.h
+wasi/include/c++/v1/__algorithm/ranges_fill.h
+wasi/include/c++/v1/__algorithm/ranges_fill_n.h
+wasi/include/c++/v1/__algorithm/ranges_find.h
+wasi/include/c++/v1/__algorithm/ranges_find_end.h
+wasi/include/c++/v1/__algorithm/ranges_find_first_of.h
+wasi/include/c++/v1/__algorithm/ranges_find_if.h
+wasi/include/c++/v1/__algorithm/ranges_find_if_not.h
+wasi/include/c++/v1/__algorithm/ranges_for_each.h
+wasi/include/c++/v1/__algorithm/ranges_for_each_n.h
+wasi/include/c++/v1/__algorithm/ranges_generate.h
+wasi/include/c++/v1/__algorithm/ranges_generate_n.h
+wasi/include/c++/v1/__algorithm/ranges_includes.h
+wasi/include/c++/v1/__algorithm/ranges_inplace_merge.h
+wasi/include/c++/v1/__algorithm/ranges_is_heap.h
+wasi/include/c++/v1/__algorithm/ranges_is_heap_until.h
+wasi/include/c++/v1/__algorithm/ranges_is_partitioned.h
+wasi/include/c++/v1/__algorithm/ranges_is_permutation.h
+wasi/include/c++/v1/__algorithm/ranges_is_sorted.h
+wasi/include/c++/v1/__algorithm/ranges_is_sorted_until.h
+wasi/include/c++/v1/__algorithm/ranges_iterator_concept.h
+wasi/include/c++/v1/__algorithm/ranges_lexicographical_compare.h
+wasi/include/c++/v1/__algorithm/ranges_lower_bound.h
+wasi/include/c++/v1/__algorithm/ranges_make_heap.h
+wasi/include/c++/v1/__algorithm/ranges_max.h
+wasi/include/c++/v1/__algorithm/ranges_max_element.h
+wasi/include/c++/v1/__algorithm/ranges_merge.h
+wasi/include/c++/v1/__algorithm/ranges_min.h
+wasi/include/c++/v1/__algorithm/ranges_min_element.h
+wasi/include/c++/v1/__algorithm/ranges_minmax.h
+wasi/include/c++/v1/__algorithm/ranges_minmax_element.h
+wasi/include/c++/v1/__algorithm/ranges_mismatch.h
+wasi/include/c++/v1/__algorithm/ranges_move.h
+wasi/include/c++/v1/__algorithm/ranges_move_backward.h
+wasi/include/c++/v1/__algorithm/ranges_next_permutation.h
+wasi/include/c++/v1/__algorithm/ranges_none_of.h
+wasi/include/c++/v1/__algorithm/ranges_nth_element.h
+wasi/include/c++/v1/__algorithm/ranges_partial_sort.h
+wasi/include/c++/v1/__algorithm/ranges_partial_sort_copy.h
+wasi/include/c++/v1/__algorithm/ranges_partition.h
+wasi/include/c++/v1/__algorithm/ranges_partition_copy.h
+wasi/include/c++/v1/__algorithm/ranges_partition_point.h
+wasi/include/c++/v1/__algorithm/ranges_pop_heap.h
+wasi/include/c++/v1/__algorithm/ranges_prev_permutation.h
+wasi/include/c++/v1/__algorithm/ranges_push_heap.h
+wasi/include/c++/v1/__algorithm/ranges_remove.h
+wasi/include/c++/v1/__algorithm/ranges_remove_copy.h
+wasi/include/c++/v1/__algorithm/ranges_remove_copy_if.h
+wasi/include/c++/v1/__algorithm/ranges_remove_if.h
+wasi/include/c++/v1/__algorithm/ranges_replace.h
+wasi/include/c++/v1/__algorithm/ranges_replace_copy.h
+wasi/include/c++/v1/__algorithm/ranges_replace_copy_if.h
+wasi/include/c++/v1/__algorithm/ranges_replace_if.h
+wasi/include/c++/v1/__algorithm/ranges_reverse.h
+wasi/include/c++/v1/__algorithm/ranges_reverse_copy.h
+wasi/include/c++/v1/__algorithm/ranges_rotate.h
+wasi/include/c++/v1/__algorithm/ranges_rotate_copy.h
+wasi/include/c++/v1/__algorithm/ranges_sample.h
+wasi/include/c++/v1/__algorithm/ranges_search.h
+wasi/include/c++/v1/__algorithm/ranges_search_n.h
+wasi/include/c++/v1/__algorithm/ranges_set_difference.h
+wasi/include/c++/v1/__algorithm/ranges_set_intersection.h
+wasi/include/c++/v1/__algorithm/ranges_set_symmetric_difference.h
+wasi/include/c++/v1/__algorithm/ranges_set_union.h
+wasi/include/c++/v1/__algorithm/ranges_shuffle.h
+wasi/include/c++/v1/__algorithm/ranges_sort.h
+wasi/include/c++/v1/__algorithm/ranges_sort_heap.h
+wasi/include/c++/v1/__algorithm/ranges_stable_partition.h
+wasi/include/c++/v1/__algorithm/ranges_stable_sort.h
+wasi/include/c++/v1/__algorithm/ranges_swap_ranges.h
+wasi/include/c++/v1/__algorithm/ranges_transform.h
+wasi/include/c++/v1/__algorithm/ranges_unique.h
+wasi/include/c++/v1/__algorithm/ranges_unique_copy.h
+wasi/include/c++/v1/__algorithm/ranges_upper_bound.h
+wasi/include/c++/v1/__algorithm/remove.h
+wasi/include/c++/v1/__algorithm/remove_copy.h
+wasi/include/c++/v1/__algorithm/remove_copy_if.h
+wasi/include/c++/v1/__algorithm/remove_if.h
+wasi/include/c++/v1/__algorithm/replace.h
+wasi/include/c++/v1/__algorithm/replace_copy.h
+wasi/include/c++/v1/__algorithm/replace_copy_if.h
+wasi/include/c++/v1/__algorithm/replace_if.h
+wasi/include/c++/v1/__algorithm/reverse.h
+wasi/include/c++/v1/__algorithm/reverse_copy.h
+wasi/include/c++/v1/__algorithm/rotate.h
+wasi/include/c++/v1/__algorithm/rotate_copy.h
+wasi/include/c++/v1/__algorithm/sample.h
+wasi/include/c++/v1/__algorithm/search.h
+wasi/include/c++/v1/__algorithm/search_n.h
+wasi/include/c++/v1/__algorithm/set_difference.h
+wasi/include/c++/v1/__algorithm/set_intersection.h
+wasi/include/c++/v1/__algorithm/set_symmetric_difference.h
+wasi/include/c++/v1/__algorithm/set_union.h
+wasi/include/c++/v1/__algorithm/shift_left.h
+wasi/include/c++/v1/__algorithm/shift_right.h
+wasi/include/c++/v1/__algorithm/shuffle.h
+wasi/include/c++/v1/__algorithm/sift_down.h
+wasi/include/c++/v1/__algorithm/sort.h
+wasi/include/c++/v1/__algorithm/sort_heap.h
+wasi/include/c++/v1/__algorithm/stable_partition.h
+wasi/include/c++/v1/__algorithm/stable_sort.h
+wasi/include/c++/v1/__algorithm/swap_ranges.h
+wasi/include/c++/v1/__algorithm/transform.h
+wasi/include/c++/v1/__algorithm/uniform_random_bit_generator_adaptor.h
+wasi/include/c++/v1/__algorithm/unique.h
+wasi/include/c++/v1/__algorithm/unique_copy.h
+wasi/include/c++/v1/__algorithm/unwrap_iter.h
+wasi/include/c++/v1/__algorithm/unwrap_range.h
+wasi/include/c++/v1/__algorithm/upper_bound.h
+wasi/include/c++/v1/__assert
+wasi/include/c++/v1/__availability
+wasi/include/c++/v1/__bit/bit_cast.h
+wasi/include/c++/v1/__bit/bit_ceil.h
+wasi/include/c++/v1/__bit/bit_floor.h
+wasi/include/c++/v1/__bit/bit_log2.h
+wasi/include/c++/v1/__bit/bit_width.h
+wasi/include/c++/v1/__bit/blsr.h
+wasi/include/c++/v1/__bit/byteswap.h
+wasi/include/c++/v1/__bit/countl.h
+wasi/include/c++/v1/__bit/countr.h
+wasi/include/c++/v1/__bit/endian.h
+wasi/include/c++/v1/__bit/has_single_bit.h
+wasi/include/c++/v1/__bit/popcount.h
+wasi/include/c++/v1/__bit/rotate.h
+wasi/include/c++/v1/__bit_reference
+wasi/include/c++/v1/__bsd_locale_defaults.h
+wasi/include/c++/v1/__bsd_locale_fallbacks.h
+wasi/include/c++/v1/__charconv/chars_format.h
+wasi/include/c++/v1/__charconv/from_chars_result.h
+wasi/include/c++/v1/__charconv/tables.h
+wasi/include/c++/v1/__charconv/to_chars_base_10.h
+wasi/include/c++/v1/__charconv/to_chars_result.h
+wasi/include/c++/v1/__chrono/calendar.h
+wasi/include/c++/v1/__chrono/convert_to_timespec.h
+wasi/include/c++/v1/__chrono/convert_to_tm.h
+wasi/include/c++/v1/__chrono/day.h
+wasi/include/c++/v1/__chrono/duration.h
+wasi/include/c++/v1/__chrono/file_clock.h
+wasi/include/c++/v1/__chrono/formatter.h
+wasi/include/c++/v1/__chrono/hh_mm_ss.h
+wasi/include/c++/v1/__chrono/high_resolution_clock.h
+wasi/include/c++/v1/__chrono/literals.h
+wasi/include/c++/v1/__chrono/month.h
+wasi/include/c++/v1/__chrono/month_weekday.h
+wasi/include/c++/v1/__chrono/monthday.h
+wasi/include/c++/v1/__chrono/ostream.h
+wasi/include/c++/v1/__chrono/parser_std_format_spec.h
+wasi/include/c++/v1/__chrono/statically_widen.h
+wasi/include/c++/v1/__chrono/steady_clock.h
+wasi/include/c++/v1/__chrono/system_clock.h
+wasi/include/c++/v1/__chrono/time_point.h
+wasi/include/c++/v1/__chrono/weekday.h
+wasi/include/c++/v1/__chrono/year.h
+wasi/include/c++/v1/__chrono/year_month.h
+wasi/include/c++/v1/__chrono/year_month_day.h
+wasi/include/c++/v1/__chrono/year_month_weekday.h
+wasi/include/c++/v1/__compare/common_comparison_category.h
+wasi/include/c++/v1/__compare/compare_partial_order_fallback.h
+wasi/include/c++/v1/__compare/compare_strong_order_fallback.h
+wasi/include/c++/v1/__compare/compare_three_way.h
+wasi/include/c++/v1/__compare/compare_three_way_result.h
+wasi/include/c++/v1/__compare/compare_weak_order_fallback.h
+wasi/include/c++/v1/__compare/is_eq.h
+wasi/include/c++/v1/__compare/ordering.h
+wasi/include/c++/v1/__compare/partial_order.h
+wasi/include/c++/v1/__compare/strong_order.h
+wasi/include/c++/v1/__compare/synth_three_way.h
+wasi/include/c++/v1/__compare/three_way_comparable.h
+wasi/include/c++/v1/__compare/weak_order.h
+wasi/include/c++/v1/__concepts/arithmetic.h
+wasi/include/c++/v1/__concepts/assignable.h
+wasi/include/c++/v1/__concepts/boolean_testable.h
+wasi/include/c++/v1/__concepts/class_or_enum.h
+wasi/include/c++/v1/__concepts/common_reference_with.h
+wasi/include/c++/v1/__concepts/common_with.h
+wasi/include/c++/v1/__concepts/constructible.h
+wasi/include/c++/v1/__concepts/convertible_to.h
+wasi/include/c++/v1/__concepts/copyable.h
+wasi/include/c++/v1/__concepts/derived_from.h
+wasi/include/c++/v1/__concepts/destructible.h
+wasi/include/c++/v1/__concepts/different_from.h
+wasi/include/c++/v1/__concepts/equality_comparable.h
+wasi/include/c++/v1/__concepts/invocable.h
+wasi/include/c++/v1/__concepts/movable.h
+wasi/include/c++/v1/__concepts/predicate.h
+wasi/include/c++/v1/__concepts/regular.h
+wasi/include/c++/v1/__concepts/relation.h
+wasi/include/c++/v1/__concepts/same_as.h
+wasi/include/c++/v1/__concepts/semiregular.h
+wasi/include/c++/v1/__concepts/swappable.h
+wasi/include/c++/v1/__concepts/totally_ordered.h
+wasi/include/c++/v1/__config
+wasi/include/c++/v1/__config_site
+wasi/include/c++/v1/__coroutine/coroutine_handle.h
+wasi/include/c++/v1/__coroutine/coroutine_traits.h
+wasi/include/c++/v1/__coroutine/noop_coroutine_handle.h
+wasi/include/c++/v1/__coroutine/trivial_awaitables.h
+wasi/include/c++/v1/__cxxabi_config.h
+wasi/include/c++/v1/__debug
+wasi/include/c++/v1/__debug_utils/randomize_range.h
+wasi/include/c++/v1/__errc
+wasi/include/c++/v1/__expected/bad_expected_access.h
+wasi/include/c++/v1/__expected/expected.h
+wasi/include/c++/v1/__expected/unexpect.h
+wasi/include/c++/v1/__expected/unexpected.h
+wasi/include/c++/v1/__filesystem/copy_options.h
+wasi/include/c++/v1/__filesystem/directory_entry.h
+wasi/include/c++/v1/__filesystem/directory_iterator.h
+wasi/include/c++/v1/__filesystem/directory_options.h
+wasi/include/c++/v1/__filesystem/file_status.h
+wasi/include/c++/v1/__filesystem/file_time_type.h
+wasi/include/c++/v1/__filesystem/file_type.h
+wasi/include/c++/v1/__filesystem/filesystem_error.h
+wasi/include/c++/v1/__filesystem/operations.h
+wasi/include/c++/v1/__filesystem/path.h
+wasi/include/c++/v1/__filesystem/path_iterator.h
+wasi/include/c++/v1/__filesystem/perm_options.h
+wasi/include/c++/v1/__filesystem/perms.h
+wasi/include/c++/v1/__filesystem/recursive_directory_iterator.h
+wasi/include/c++/v1/__filesystem/space_info.h
+wasi/include/c++/v1/__filesystem/u8path.h
+wasi/include/c++/v1/__format/buffer.h
+wasi/include/c++/v1/__format/concepts.h
+wasi/include/c++/v1/__format/container_adaptor.h
+wasi/include/c++/v1/__format/enable_insertable.h
+wasi/include/c++/v1/__format/escaped_output_table.h
+wasi/include/c++/v1/__format/extended_grapheme_cluster_table.h
+wasi/include/c++/v1/__format/format_arg.h
+wasi/include/c++/v1/__format/format_arg_store.h
+wasi/include/c++/v1/__format/format_args.h
+wasi/include/c++/v1/__format/format_context.h
+wasi/include/c++/v1/__format/format_error.h
+wasi/include/c++/v1/__format/format_functions.h
+wasi/include/c++/v1/__format/format_fwd.h
+wasi/include/c++/v1/__format/format_parse_context.h
+wasi/include/c++/v1/__format/format_string.h
+wasi/include/c++/v1/__format/format_to_n_result.h
+wasi/include/c++/v1/__format/formatter.h
+wasi/include/c++/v1/__format/formatter_bool.h
+wasi/include/c++/v1/__format/formatter_char.h
+wasi/include/c++/v1/__format/formatter_floating_point.h
+wasi/include/c++/v1/__format/formatter_integer.h
+wasi/include/c++/v1/__format/formatter_integral.h
+wasi/include/c++/v1/__format/formatter_output.h
+wasi/include/c++/v1/__format/formatter_pointer.h
+wasi/include/c++/v1/__format/formatter_string.h
+wasi/include/c++/v1/__format/formatter_tuple.h
+wasi/include/c++/v1/__format/parser_std_format_spec.h
+wasi/include/c++/v1/__format/range_default_formatter.h
+wasi/include/c++/v1/__format/range_formatter.h
+wasi/include/c++/v1/__format/unicode.h
+wasi/include/c++/v1/__functional/binary_function.h
+wasi/include/c++/v1/__functional/binary_negate.h
+wasi/include/c++/v1/__functional/bind.h
+wasi/include/c++/v1/__functional/bind_back.h
+wasi/include/c++/v1/__functional/bind_front.h
+wasi/include/c++/v1/__functional/binder1st.h
+wasi/include/c++/v1/__functional/binder2nd.h
+wasi/include/c++/v1/__functional/boyer_moore_searcher.h
+wasi/include/c++/v1/__functional/compose.h
+wasi/include/c++/v1/__functional/default_searcher.h
+wasi/include/c++/v1/__functional/function.h
+wasi/include/c++/v1/__functional/hash.h
+wasi/include/c++/v1/__functional/identity.h
+wasi/include/c++/v1/__functional/invoke.h
+wasi/include/c++/v1/__functional/is_transparent.h
+wasi/include/c++/v1/__functional/mem_fn.h
+wasi/include/c++/v1/__functional/mem_fun_ref.h
+wasi/include/c++/v1/__functional/not_fn.h
+wasi/include/c++/v1/__functional/operations.h
+wasi/include/c++/v1/__functional/perfect_forward.h
+wasi/include/c++/v1/__functional/pointer_to_binary_function.h
+wasi/include/c++/v1/__functional/pointer_to_unary_function.h
+wasi/include/c++/v1/__functional/ranges_operations.h
+wasi/include/c++/v1/__functional/reference_wrapper.h
+wasi/include/c++/v1/__functional/unary_function.h
+wasi/include/c++/v1/__functional/unary_negate.h
+wasi/include/c++/v1/__functional/unwrap_ref.h
+wasi/include/c++/v1/__functional/weak_result_type.h
+wasi/include/c++/v1/__fwd/array.h
+wasi/include/c++/v1/__fwd/get.h
+wasi/include/c++/v1/__fwd/hash.h
+wasi/include/c++/v1/__fwd/memory_resource.h
+wasi/include/c++/v1/__fwd/pair.h
+wasi/include/c++/v1/__fwd/span.h
+wasi/include/c++/v1/__fwd/string.h
+wasi/include/c++/v1/__fwd/string_view.h
+wasi/include/c++/v1/__fwd/subrange.h
+wasi/include/c++/v1/__fwd/tuple.h
+wasi/include/c++/v1/__hash_table
+wasi/include/c++/v1/__ios/fpos.h
+wasi/include/c++/v1/__iterator/access.h
+wasi/include/c++/v1/__iterator/advance.h
+wasi/include/c++/v1/__iterator/back_insert_iterator.h
+wasi/include/c++/v1/__iterator/bounded_iter.h
+wasi/include/c++/v1/__iterator/common_iterator.h
+wasi/include/c++/v1/__iterator/concepts.h
+wasi/include/c++/v1/__iterator/counted_iterator.h
+wasi/include/c++/v1/__iterator/data.h
+wasi/include/c++/v1/__iterator/default_sentinel.h
+wasi/include/c++/v1/__iterator/distance.h
+wasi/include/c++/v1/__iterator/empty.h
+wasi/include/c++/v1/__iterator/erase_if_container.h
+wasi/include/c++/v1/__iterator/front_insert_iterator.h
+wasi/include/c++/v1/__iterator/incrementable_traits.h
+wasi/include/c++/v1/__iterator/indirectly_comparable.h
+wasi/include/c++/v1/__iterator/insert_iterator.h
+wasi/include/c++/v1/__iterator/istream_iterator.h
+wasi/include/c++/v1/__iterator/istreambuf_iterator.h
+wasi/include/c++/v1/__iterator/iter_move.h
+wasi/include/c++/v1/__iterator/iter_swap.h
+wasi/include/c++/v1/__iterator/iterator.h
+wasi/include/c++/v1/__iterator/iterator_traits.h
+wasi/include/c++/v1/__iterator/iterator_with_data.h
+wasi/include/c++/v1/__iterator/mergeable.h
+wasi/include/c++/v1/__iterator/move_iterator.h
+wasi/include/c++/v1/__iterator/move_sentinel.h
+wasi/include/c++/v1/__iterator/next.h
+wasi/include/c++/v1/__iterator/ostream_iterator.h
+wasi/include/c++/v1/__iterator/ostreambuf_iterator.h
+wasi/include/c++/v1/__iterator/permutable.h
+wasi/include/c++/v1/__iterator/prev.h
+wasi/include/c++/v1/__iterator/projected.h
+wasi/include/c++/v1/__iterator/readable_traits.h
+wasi/include/c++/v1/__iterator/reverse_access.h
+wasi/include/c++/v1/__iterator/reverse_iterator.h
+wasi/include/c++/v1/__iterator/segmented_iterator.h
+wasi/include/c++/v1/__iterator/size.h
+wasi/include/c++/v1/__iterator/sortable.h
+wasi/include/c++/v1/__iterator/unreachable_sentinel.h
+wasi/include/c++/v1/__iterator/wrap_iter.h
+wasi/include/c++/v1/__locale
+wasi/include/c++/v1/__mbstate_t.h
+wasi/include/c++/v1/__memory/addressof.h
+wasi/include/c++/v1/__memory/align.h
+wasi/include/c++/v1/__memory/allocate_at_least.h
+wasi/include/c++/v1/__memory/allocation_guard.h
+wasi/include/c++/v1/__memory/allocator.h
+wasi/include/c++/v1/__memory/allocator_arg_t.h
+wasi/include/c++/v1/__memory/allocator_destructor.h
+wasi/include/c++/v1/__memory/allocator_traits.h
+wasi/include/c++/v1/__memory/assume_aligned.h
+wasi/include/c++/v1/__memory/auto_ptr.h
+wasi/include/c++/v1/__memory/builtin_new_allocator.h
+wasi/include/c++/v1/__memory/compressed_pair.h
+wasi/include/c++/v1/__memory/concepts.h
+wasi/include/c++/v1/__memory/construct_at.h
+wasi/include/c++/v1/__memory/destruct_n.h
+wasi/include/c++/v1/__memory/pointer_traits.h
+wasi/include/c++/v1/__memory/ranges_construct_at.h
+wasi/include/c++/v1/__memory/ranges_uninitialized_algorithms.h
+wasi/include/c++/v1/__memory/raw_storage_iterator.h
+wasi/include/c++/v1/__memory/shared_ptr.h
+wasi/include/c++/v1/__memory/swap_allocator.h
+wasi/include/c++/v1/__memory/temp_value.h
+wasi/include/c++/v1/__memory/temporary_buffer.h
+wasi/include/c++/v1/__memory/uninitialized_algorithms.h
+wasi/include/c++/v1/__memory/unique_ptr.h
+wasi/include/c++/v1/__memory/uses_allocator.h
+wasi/include/c++/v1/__memory/uses_allocator_construction.h
+wasi/include/c++/v1/__memory/voidify.h
+wasi/include/c++/v1/__memory_resource/memory_resource.h
+wasi/include/c++/v1/__memory_resource/monotonic_buffer_resource.h
+wasi/include/c++/v1/__memory_resource/polymorphic_allocator.h
+wasi/include/c++/v1/__memory_resource/pool_options.h
+wasi/include/c++/v1/__memory_resource/synchronized_pool_resource.h
+wasi/include/c++/v1/__memory_resource/unsynchronized_pool_resource.h
+wasi/include/c++/v1/__mutex_base
+wasi/include/c++/v1/__node_handle
+wasi/include/c++/v1/__numeric/accumulate.h
+wasi/include/c++/v1/__numeric/adjacent_difference.h
+wasi/include/c++/v1/__numeric/exclusive_scan.h
+wasi/include/c++/v1/__numeric/gcd_lcm.h
+wasi/include/c++/v1/__numeric/inclusive_scan.h
+wasi/include/c++/v1/__numeric/inner_product.h
+wasi/include/c++/v1/__numeric/iota.h
+wasi/include/c++/v1/__numeric/midpoint.h
+wasi/include/c++/v1/__numeric/partial_sum.h
+wasi/include/c++/v1/__numeric/reduce.h
+wasi/include/c++/v1/__numeric/transform_exclusive_scan.h
+wasi/include/c++/v1/__numeric/transform_inclusive_scan.h
+wasi/include/c++/v1/__numeric/transform_reduce.h
+wasi/include/c++/v1/__random/bernoulli_distribution.h
+wasi/include/c++/v1/__random/binomial_distribution.h
+wasi/include/c++/v1/__random/cauchy_distribution.h
+wasi/include/c++/v1/__random/chi_squared_distribution.h
+wasi/include/c++/v1/__random/clamp_to_integral.h
+wasi/include/c++/v1/__random/default_random_engine.h
+wasi/include/c++/v1/__random/discard_block_engine.h
+wasi/include/c++/v1/__random/discrete_distribution.h
+wasi/include/c++/v1/__random/exponential_distribution.h
+wasi/include/c++/v1/__random/extreme_value_distribution.h
+wasi/include/c++/v1/__random/fisher_f_distribution.h
+wasi/include/c++/v1/__random/gamma_distribution.h
+wasi/include/c++/v1/__random/generate_canonical.h
+wasi/include/c++/v1/__random/geometric_distribution.h
+wasi/include/c++/v1/__random/independent_bits_engine.h
+wasi/include/c++/v1/__random/is_seed_sequence.h
+wasi/include/c++/v1/__random/is_valid.h
+wasi/include/c++/v1/__random/knuth_b.h
+wasi/include/c++/v1/__random/linear_congruential_engine.h
+wasi/include/c++/v1/__random/log2.h
+wasi/include/c++/v1/__random/lognormal_distribution.h
+wasi/include/c++/v1/__random/mersenne_twister_engine.h
+wasi/include/c++/v1/__random/negative_binomial_distribution.h
+wasi/include/c++/v1/__random/normal_distribution.h
+wasi/include/c++/v1/__random/piecewise_constant_distribution.h
+wasi/include/c++/v1/__random/piecewise_linear_distribution.h
+wasi/include/c++/v1/__random/poisson_distribution.h
+wasi/include/c++/v1/__random/random_device.h
+wasi/include/c++/v1/__random/ranlux.h
+wasi/include/c++/v1/__random/seed_seq.h
+wasi/include/c++/v1/__random/shuffle_order_engine.h
+wasi/include/c++/v1/__random/student_t_distribution.h
+wasi/include/c++/v1/__random/subtract_with_carry_engine.h
+wasi/include/c++/v1/__random/uniform_int_distribution.h
+wasi/include/c++/v1/__random/uniform_random_bit_generator.h
+wasi/include/c++/v1/__random/uniform_real_distribution.h
+wasi/include/c++/v1/__random/weibull_distribution.h
+wasi/include/c++/v1/__ranges/access.h
+wasi/include/c++/v1/__ranges/all.h
+wasi/include/c++/v1/__ranges/as_rvalue_view.h
+wasi/include/c++/v1/__ranges/common_view.h
+wasi/include/c++/v1/__ranges/concepts.h
+wasi/include/c++/v1/__ranges/copyable_box.h
+wasi/include/c++/v1/__ranges/counted.h
+wasi/include/c++/v1/__ranges/dangling.h
+wasi/include/c++/v1/__ranges/data.h
+wasi/include/c++/v1/__ranges/drop_view.h
+wasi/include/c++/v1/__ranges/drop_while_view.h
+wasi/include/c++/v1/__ranges/elements_view.h
+wasi/include/c++/v1/__ranges/empty.h
+wasi/include/c++/v1/__ranges/empty_view.h
+wasi/include/c++/v1/__ranges/enable_borrowed_range.h
+wasi/include/c++/v1/__ranges/enable_view.h
+wasi/include/c++/v1/__ranges/filter_view.h
+wasi/include/c++/v1/__ranges/iota_view.h
+wasi/include/c++/v1/__ranges/istream_view.h
+wasi/include/c++/v1/__ranges/join_view.h
+wasi/include/c++/v1/__ranges/lazy_split_view.h
+wasi/include/c++/v1/__ranges/non_propagating_cache.h
+wasi/include/c++/v1/__ranges/owning_view.h
+wasi/include/c++/v1/__ranges/range_adaptor.h
+wasi/include/c++/v1/__ranges/rbegin.h
+wasi/include/c++/v1/__ranges/ref_view.h
+wasi/include/c++/v1/__ranges/rend.h
+wasi/include/c++/v1/__ranges/reverse_view.h
+wasi/include/c++/v1/__ranges/single_view.h
+wasi/include/c++/v1/__ranges/size.h
+wasi/include/c++/v1/__ranges/split_view.h
+wasi/include/c++/v1/__ranges/subrange.h
+wasi/include/c++/v1/__ranges/take_view.h
+wasi/include/c++/v1/__ranges/take_while_view.h
+wasi/include/c++/v1/__ranges/transform_view.h
+wasi/include/c++/v1/__ranges/view_interface.h
+wasi/include/c++/v1/__ranges/views.h
+wasi/include/c++/v1/__ranges/zip_view.h
+wasi/include/c++/v1/__split_buffer
+wasi/include/c++/v1/__std_stream
+wasi/include/c++/v1/__string/char_traits.h
+wasi/include/c++/v1/__string/extern_template_lists.h
+wasi/include/c++/v1/__support/android/locale_bionic.h
+wasi/include/c++/v1/__support/fuchsia/xlocale.h
+wasi/include/c++/v1/__support/ibm/gettod_zos.h
+wasi/include/c++/v1/__support/ibm/locale_mgmt_zos.h
+wasi/include/c++/v1/__support/ibm/nanosleep.h
+wasi/include/c++/v1/__support/ibm/xlocale.h
+wasi/include/c++/v1/__support/musl/xlocale.h
+wasi/include/c++/v1/__support/newlib/xlocale.h
+wasi/include/c++/v1/__support/openbsd/xlocale.h
+wasi/include/c++/v1/__support/solaris/floatingpoint.h
+wasi/include/c++/v1/__support/solaris/wchar.h
+wasi/include/c++/v1/__support/solaris/xlocale.h
+wasi/include/c++/v1/__support/win32/locale_win32.h
+wasi/include/c++/v1/__support/xlocale/__nop_locale_mgmt.h
+wasi/include/c++/v1/__support/xlocale/__posix_l_fallback.h
+wasi/include/c++/v1/__support/xlocale/__strtonum_fallback.h
+wasi/include/c++/v1/__thread/poll_with_backoff.h
+wasi/include/c++/v1/__thread/timed_backoff_policy.h
+wasi/include/c++/v1/__threading_support
+wasi/include/c++/v1/__tree
+wasi/include/c++/v1/__tuple_dir/apply_cv.h
+wasi/include/c++/v1/__tuple_dir/make_tuple_types.h
+wasi/include/c++/v1/__tuple_dir/pair_like.h
+wasi/include/c++/v1/__tuple_dir/sfinae_helpers.h
+wasi/include/c++/v1/__tuple_dir/tuple_element.h
+wasi/include/c++/v1/__tuple_dir/tuple_indices.h
+wasi/include/c++/v1/__tuple_dir/tuple_like.h
+wasi/include/c++/v1/__tuple_dir/tuple_like_ext.h
+wasi/include/c++/v1/__tuple_dir/tuple_size.h
+wasi/include/c++/v1/__tuple_dir/tuple_types.h
+wasi/include/c++/v1/__type_traits/add_const.h
+wasi/include/c++/v1/__type_traits/add_cv.h
+wasi/include/c++/v1/__type_traits/add_lvalue_reference.h
+wasi/include/c++/v1/__type_traits/add_pointer.h
+wasi/include/c++/v1/__type_traits/add_rvalue_reference.h
+wasi/include/c++/v1/__type_traits/add_volatile.h
+wasi/include/c++/v1/__type_traits/aligned_storage.h
+wasi/include/c++/v1/__type_traits/aligned_union.h
+wasi/include/c++/v1/__type_traits/alignment_of.h
+wasi/include/c++/v1/__type_traits/apply_cv.h
+wasi/include/c++/v1/__type_traits/can_extract_key.h
+wasi/include/c++/v1/__type_traits/common_reference.h
+wasi/include/c++/v1/__type_traits/common_type.h
+wasi/include/c++/v1/__type_traits/conditional.h
+wasi/include/c++/v1/__type_traits/conjunction.h
+wasi/include/c++/v1/__type_traits/copy_cv.h
+wasi/include/c++/v1/__type_traits/copy_cvref.h
+wasi/include/c++/v1/__type_traits/decay.h
+wasi/include/c++/v1/__type_traits/dependent_type.h
+wasi/include/c++/v1/__type_traits/disjunction.h
+wasi/include/c++/v1/__type_traits/enable_if.h
+wasi/include/c++/v1/__type_traits/extent.h
+wasi/include/c++/v1/__type_traits/has_unique_object_representation.h
+wasi/include/c++/v1/__type_traits/has_virtual_destructor.h
+wasi/include/c++/v1/__type_traits/integral_constant.h
+wasi/include/c++/v1/__type_traits/is_abstract.h
+wasi/include/c++/v1/__type_traits/is_aggregate.h
+wasi/include/c++/v1/__type_traits/is_allocator.h
+wasi/include/c++/v1/__type_traits/is_always_bitcastable.h
+wasi/include/c++/v1/__type_traits/is_arithmetic.h
+wasi/include/c++/v1/__type_traits/is_array.h
+wasi/include/c++/v1/__type_traits/is_assignable.h
+wasi/include/c++/v1/__type_traits/is_base_of.h
+wasi/include/c++/v1/__type_traits/is_bounded_array.h
+wasi/include/c++/v1/__type_traits/is_callable.h
+wasi/include/c++/v1/__type_traits/is_char_like_type.h
+wasi/include/c++/v1/__type_traits/is_class.h
+wasi/include/c++/v1/__type_traits/is_compound.h
+wasi/include/c++/v1/__type_traits/is_const.h
+wasi/include/c++/v1/__type_traits/is_constant_evaluated.h
+wasi/include/c++/v1/__type_traits/is_constructible.h
+wasi/include/c++/v1/__type_traits/is_convertible.h
+wasi/include/c++/v1/__type_traits/is_copy_assignable.h
+wasi/include/c++/v1/__type_traits/is_copy_constructible.h
+wasi/include/c++/v1/__type_traits/is_core_convertible.h
+wasi/include/c++/v1/__type_traits/is_default_constructible.h
+wasi/include/c++/v1/__type_traits/is_destructible.h
+wasi/include/c++/v1/__type_traits/is_empty.h
+wasi/include/c++/v1/__type_traits/is_enum.h
+wasi/include/c++/v1/__type_traits/is_final.h
+wasi/include/c++/v1/__type_traits/is_floating_point.h
+wasi/include/c++/v1/__type_traits/is_function.h
+wasi/include/c++/v1/__type_traits/is_fundamental.h
+wasi/include/c++/v1/__type_traits/is_implicitly_default_constructible.h
+wasi/include/c++/v1/__type_traits/is_integral.h
+wasi/include/c++/v1/__type_traits/is_literal_type.h
+wasi/include/c++/v1/__type_traits/is_member_function_pointer.h
+wasi/include/c++/v1/__type_traits/is_member_object_pointer.h
+wasi/include/c++/v1/__type_traits/is_member_pointer.h
+wasi/include/c++/v1/__type_traits/is_move_assignable.h
+wasi/include/c++/v1/__type_traits/is_move_constructible.h
+wasi/include/c++/v1/__type_traits/is_nothrow_assignable.h
+wasi/include/c++/v1/__type_traits/is_nothrow_constructible.h
+wasi/include/c++/v1/__type_traits/is_nothrow_convertible.h
+wasi/include/c++/v1/__type_traits/is_nothrow_copy_assignable.h
+wasi/include/c++/v1/__type_traits/is_nothrow_copy_constructible.h
+wasi/include/c++/v1/__type_traits/is_nothrow_default_constructible.h
+wasi/include/c++/v1/__type_traits/is_nothrow_destructible.h
+wasi/include/c++/v1/__type_traits/is_nothrow_move_assignable.h
+wasi/include/c++/v1/__type_traits/is_nothrow_move_constructible.h
+wasi/include/c++/v1/__type_traits/is_null_pointer.h
+wasi/include/c++/v1/__type_traits/is_object.h
+wasi/include/c++/v1/__type_traits/is_pod.h
+wasi/include/c++/v1/__type_traits/is_pointer.h
+wasi/include/c++/v1/__type_traits/is_polymorphic.h
+wasi/include/c++/v1/__type_traits/is_primary_template.h
+wasi/include/c++/v1/__type_traits/is_reference.h
+wasi/include/c++/v1/__type_traits/is_reference_wrapper.h
+wasi/include/c++/v1/__type_traits/is_referenceable.h
+wasi/include/c++/v1/__type_traits/is_same.h
+wasi/include/c++/v1/__type_traits/is_scalar.h
+wasi/include/c++/v1/__type_traits/is_scoped_enum.h
+wasi/include/c++/v1/__type_traits/is_signed.h
+wasi/include/c++/v1/__type_traits/is_signed_integer.h
+wasi/include/c++/v1/__type_traits/is_specialization.h
+wasi/include/c++/v1/__type_traits/is_standard_layout.h
+wasi/include/c++/v1/__type_traits/is_swappable.h
+wasi/include/c++/v1/__type_traits/is_trivial.h
+wasi/include/c++/v1/__type_traits/is_trivially_assignable.h
+wasi/include/c++/v1/__type_traits/is_trivially_constructible.h
+wasi/include/c++/v1/__type_traits/is_trivially_copy_assignable.h
+wasi/include/c++/v1/__type_traits/is_trivially_copy_constructible.h
+wasi/include/c++/v1/__type_traits/is_trivially_copyable.h
+wasi/include/c++/v1/__type_traits/is_trivially_default_constructible.h
+wasi/include/c++/v1/__type_traits/is_trivially_destructible.h
+wasi/include/c++/v1/__type_traits/is_trivially_move_assignable.h
+wasi/include/c++/v1/__type_traits/is_trivially_move_constructible.h
+wasi/include/c++/v1/__type_traits/is_unbounded_array.h
+wasi/include/c++/v1/__type_traits/is_union.h
+wasi/include/c++/v1/__type_traits/is_unsigned.h
+wasi/include/c++/v1/__type_traits/is_unsigned_integer.h
+wasi/include/c++/v1/__type_traits/is_valid_expansion.h
+wasi/include/c++/v1/__type_traits/is_void.h
+wasi/include/c++/v1/__type_traits/is_volatile.h
+wasi/include/c++/v1/__type_traits/lazy.h
+wasi/include/c++/v1/__type_traits/make_32_64_or_128_bit.h
+wasi/include/c++/v1/__type_traits/make_const_lvalue_ref.h
+wasi/include/c++/v1/__type_traits/make_signed.h
+wasi/include/c++/v1/__type_traits/make_unsigned.h
+wasi/include/c++/v1/__type_traits/maybe_const.h
+wasi/include/c++/v1/__type_traits/nat.h
+wasi/include/c++/v1/__type_traits/negation.h
+wasi/include/c++/v1/__type_traits/noexcept_move_assign_container.h
+wasi/include/c++/v1/__type_traits/promote.h
+wasi/include/c++/v1/__type_traits/rank.h
+wasi/include/c++/v1/__type_traits/remove_all_extents.h
+wasi/include/c++/v1/__type_traits/remove_const.h
+wasi/include/c++/v1/__type_traits/remove_const_ref.h
+wasi/include/c++/v1/__type_traits/remove_cv.h
+wasi/include/c++/v1/__type_traits/remove_cvref.h
+wasi/include/c++/v1/__type_traits/remove_extent.h
+wasi/include/c++/v1/__type_traits/remove_pointer.h
+wasi/include/c++/v1/__type_traits/remove_reference.h
+wasi/include/c++/v1/__type_traits/remove_volatile.h
+wasi/include/c++/v1/__type_traits/result_of.h
+wasi/include/c++/v1/__type_traits/strip_signature.h
+wasi/include/c++/v1/__type_traits/type_identity.h
+wasi/include/c++/v1/__type_traits/type_list.h
+wasi/include/c++/v1/__type_traits/underlying_type.h
+wasi/include/c++/v1/__type_traits/void_t.h
+wasi/include/c++/v1/__undef_macros
+wasi/include/c++/v1/__utility/as_const.h
+wasi/include/c++/v1/__utility/auto_cast.h
+wasi/include/c++/v1/__utility/cmp.h
+wasi/include/c++/v1/__utility/convert_to_integral.h
+wasi/include/c++/v1/__utility/declval.h
+wasi/include/c++/v1/__utility/exception_guard.h
+wasi/include/c++/v1/__utility/exchange.h
+wasi/include/c++/v1/__utility/forward.h
+wasi/include/c++/v1/__utility/forward_like.h
+wasi/include/c++/v1/__utility/in_place.h
+wasi/include/c++/v1/__utility/integer_sequence.h
+wasi/include/c++/v1/__utility/move.h
+wasi/include/c++/v1/__utility/pair.h
+wasi/include/c++/v1/__utility/piecewise_construct.h
+wasi/include/c++/v1/__utility/priority_tag.h
+wasi/include/c++/v1/__utility/rel_ops.h
+wasi/include/c++/v1/__utility/swap.h
+wasi/include/c++/v1/__utility/to_underlying.h
+wasi/include/c++/v1/__utility/unreachable.h
+wasi/include/c++/v1/__variant/monostate.h
+wasi/include/c++/v1/__verbose_abort
+wasi/include/c++/v1/algorithm
+wasi/include/c++/v1/any
+wasi/include/c++/v1/array
+wasi/include/c++/v1/atomic
+wasi/include/c++/v1/barrier
+wasi/include/c++/v1/bit
+wasi/include/c++/v1/bitset
+wasi/include/c++/v1/cassert
+wasi/include/c++/v1/ccomplex
+wasi/include/c++/v1/cctype
+wasi/include/c++/v1/cerrno
+wasi/include/c++/v1/cfenv
+wasi/include/c++/v1/cfloat
+wasi/include/c++/v1/charconv
+wasi/include/c++/v1/chrono
+wasi/include/c++/v1/cinttypes
+wasi/include/c++/v1/ciso646
+wasi/include/c++/v1/climits
+wasi/include/c++/v1/clocale
+wasi/include/c++/v1/cmath
+wasi/include/c++/v1/codecvt
+wasi/include/c++/v1/compare
+wasi/include/c++/v1/complex
+wasi/include/c++/v1/complex.h
+wasi/include/c++/v1/concepts
+wasi/include/c++/v1/condition_variable
+wasi/include/c++/v1/coroutine
+wasi/include/c++/v1/csetjmp
+wasi/include/c++/v1/csignal
+wasi/include/c++/v1/cstdarg
+wasi/include/c++/v1/cstdbool
+wasi/include/c++/v1/cstddef
+wasi/include/c++/v1/cstdint
+wasi/include/c++/v1/cstdio
+wasi/include/c++/v1/cstdlib
+wasi/include/c++/v1/cstring
+wasi/include/c++/v1/ctgmath
+wasi/include/c++/v1/ctime
+wasi/include/c++/v1/ctype.h
+wasi/include/c++/v1/cuchar
+wasi/include/c++/v1/cwchar
+wasi/include/c++/v1/cwctype
+wasi/include/c++/v1/cxxabi.h
+wasi/include/c++/v1/deque
+wasi/include/c++/v1/errno.h
+wasi/include/c++/v1/exception
+wasi/include/c++/v1/execution
+wasi/include/c++/v1/expected
+wasi/include/c++/v1/experimental/__config
+wasi/include/c++/v1/experimental/__memory
+wasi/include/c++/v1/experimental/algorithm
+wasi/include/c++/v1/experimental/coroutine
+wasi/include/c++/v1/experimental/deque
+wasi/include/c++/v1/experimental/forward_list
+wasi/include/c++/v1/experimental/functional
+wasi/include/c++/v1/experimental/iterator
+wasi/include/c++/v1/experimental/list
+wasi/include/c++/v1/experimental/map
+wasi/include/c++/v1/experimental/memory_resource
+wasi/include/c++/v1/experimental/propagate_const
+wasi/include/c++/v1/experimental/regex
+wasi/include/c++/v1/experimental/set
+wasi/include/c++/v1/experimental/simd
+wasi/include/c++/v1/experimental/string
+wasi/include/c++/v1/experimental/type_traits
+wasi/include/c++/v1/experimental/unordered_map
+wasi/include/c++/v1/experimental/unordered_set
+wasi/include/c++/v1/experimental/utility
+wasi/include/c++/v1/experimental/vector
+wasi/include/c++/v1/ext/__hash
+wasi/include/c++/v1/ext/hash_map
+wasi/include/c++/v1/ext/hash_set
+wasi/include/c++/v1/fenv.h
+wasi/include/c++/v1/filesystem
+wasi/include/c++/v1/float.h
+wasi/include/c++/v1/format
+wasi/include/c++/v1/forward_list
+wasi/include/c++/v1/fstream
+wasi/include/c++/v1/functional
+wasi/include/c++/v1/future
+wasi/include/c++/v1/initializer_list
+wasi/include/c++/v1/inttypes.h
+wasi/include/c++/v1/iomanip
+wasi/include/c++/v1/ios
+wasi/include/c++/v1/iosfwd
+wasi/include/c++/v1/iostream
+wasi/include/c++/v1/istream
+wasi/include/c++/v1/iterator
+wasi/include/c++/v1/latch
+wasi/include/c++/v1/libcxx.imp
+wasi/include/c++/v1/limits
+wasi/include/c++/v1/limits.h
+wasi/include/c++/v1/list
+wasi/include/c++/v1/locale
+wasi/include/c++/v1/locale.h
+wasi/include/c++/v1/map
+wasi/include/c++/v1/math.h
+wasi/include/c++/v1/memory
+wasi/include/c++/v1/memory_resource
+wasi/include/c++/v1/module.modulemap
+wasi/include/c++/v1/mutex
+wasi/include/c++/v1/new
+wasi/include/c++/v1/numbers
+wasi/include/c++/v1/numeric
+wasi/include/c++/v1/optional
+wasi/include/c++/v1/ostream
+wasi/include/c++/v1/queue
+wasi/include/c++/v1/random
+wasi/include/c++/v1/ranges
+wasi/include/c++/v1/ratio
+wasi/include/c++/v1/regex
+wasi/include/c++/v1/scoped_allocator
+wasi/include/c++/v1/semaphore
+wasi/include/c++/v1/set
+wasi/include/c++/v1/setjmp.h
+wasi/include/c++/v1/shared_mutex
+wasi/include/c++/v1/source_location
+wasi/include/c++/v1/span
+wasi/include/c++/v1/sstream
+wasi/include/c++/v1/stack
+wasi/include/c++/v1/stdatomic.h
+wasi/include/c++/v1/stdbool.h
+wasi/include/c++/v1/stddef.h
+wasi/include/c++/v1/stdexcept
+wasi/include/c++/v1/stdint.h
+wasi/include/c++/v1/stdio.h
+wasi/include/c++/v1/stdlib.h
+wasi/include/c++/v1/streambuf
+wasi/include/c++/v1/string
+wasi/include/c++/v1/string.h
+wasi/include/c++/v1/string_view
+wasi/include/c++/v1/strstream
+wasi/include/c++/v1/system_error
+wasi/include/c++/v1/tgmath.h
+wasi/include/c++/v1/thread
+wasi/include/c++/v1/tuple
+wasi/include/c++/v1/type_traits
+wasi/include/c++/v1/typeindex
+wasi/include/c++/v1/typeinfo
+wasi/include/c++/v1/uchar.h
+wasi/include/c++/v1/unordered_map
+wasi/include/c++/v1/unordered_set
+wasi/include/c++/v1/utility
+wasi/include/c++/v1/valarray
+wasi/include/c++/v1/variant
+wasi/include/c++/v1/vector
+wasi/include/c++/v1/version
+wasi/include/c++/v1/wchar.h
+wasi/include/c++/v1/wctype.h
+wasi/lib/wasm32-wasi/libc++.a
+wasi/lib/wasm32-wasi/libc++abi.a
+wasi/lib/wasm32-wasi/libc++experimental.a
diff --git a/wasi-libcxx/buildlink3.mk b/wasi-libcxx/buildlink3.mk
new file mode 100644
index 0000000000..f887991e3e
--- /dev/null
+++ b/wasi-libcxx/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.5 2022/12/15 01:11:17 gutteridge Exp $
+
+BUILDLINK_TREE+=	wasi-libcxx
+
+BUILDLINK_DEPMETHOD.wasi-libcxx?=	build
+
+.if !defined(WASI_LIBCXX_BUILDLINK3_MK)
+WASI_LIBCXX_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.wasi-libcxx+=	wasi-libcxx>=15.0.6
+BUILDLINK_PKGSRCDIR.wasi-libcxx?=	../../wip/wasi-libcxx
+
+.endif	# WASI_LIBCXX_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-wasi-libcxx
diff --git a/wasi-libcxx/distinfo b/wasi-libcxx/distinfo
new file mode 100644
index 0000000000..3ce5c21c27
--- /dev/null
+++ b/wasi-libcxx/distinfo
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.8 2023/01/12 19:32:54 adam Exp $
+
+BLAKE2s (cmake-16.0.1.src.tar.xz) = fd3cd5c2d4ccd381f41a62c46795e755eb6712a3f7a0ad30ea05054bceb52c51
+SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
+Size (cmake-16.0.1.src.tar.xz) = 9000 bytes
+BLAKE2s (libcxx-16.0.1.src.tar.xz) = 3ea6f3d89c23341e4979ef2173a15cf0a0616925c391a9d41c964499e5f48d6d
+SHA512 (libcxx-16.0.1.src.tar.xz) = 37f660d020c4943b94e5a9a060a57c2f1e4e51f154028f299050d8d9706788b7b14f9fe552adf8909d10b3fa1fb793034ff46a40849c6ac45dff99ea10df6e77
+Size (libcxx-16.0.1.src.tar.xz) = 3647592 bytes
+BLAKE2s (libcxxabi-16.0.1.src.tar.xz) = aef7f4df34e26876aa0700932b929aa04e0957d2170c4d8c2c02f075783273cc
+SHA512 (libcxxabi-16.0.1.src.tar.xz) = 7b5af2a83d9ab704219af75874b4c18248869d91141670794e31d6e2ba852313e2677ce2b83ba4d58abf236e3e01519a917117ad938475a9e1e4b74ec6b12b11
+Size (libcxxabi-16.0.1.src.tar.xz) = 573576 bytes
+SHA1 (patch-libcxx_include_CMakeLists.txt) = ca1d4f8dbc99bbcfdad6a0bd389f973a48a938d7
+SHA1 (patch-libcxxabi_src_CMakeLists.txt) = ccd70bb5902b31a6bb989521e9a5f50fe0a4021d
diff --git a/wasi-libcxx/patches/patch-libcxx_include_CMakeLists.txt b/wasi-libcxx/patches/patch-libcxx_include_CMakeLists.txt
new file mode 100644
index 0000000000..6c9a5f2342
--- /dev/null
+++ b/wasi-libcxx/patches/patch-libcxx_include_CMakeLists.txt
@@ -0,0 +1,19 @@
+$NetBSD: patch-libcxx_include_CMakeLists.txt,v 1.2 2022/11/14 18:44:07 adam Exp $
+
+* Generate __config_site under source directory. This is wrong.
+  This fixes non-pthreads wasi-libcxx-14.0.6 build.
+
+--- libcxx/include/CMakeLists.txt.orig	2022-11-13 10:03:36.918375190 +0000
++++ libcxx/include/CMakeLists.txt
+@@ -795,9 +795,11 @@ foreach(feature LIBCXX_ENABLE_FILESYSTEM
+   endif()
+ endforeach()
+ 
++configure_file("__config_site.in" "${CMAKE_CURRENT_SOURCE_DIR}/__config_site" @ONLY)
+ configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY)
+ configure_file("module.modulemap.in" "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap" @ONLY)
+ 
++set(_all_includes "${CMAKE_CURRENT_SOURCE_DIR}/__config_site")
+ set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site"
+                   "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap")
+ foreach(f ${files})
diff --git a/wasi-libcxx/patches/patch-libcxxabi_src_CMakeLists.txt b/wasi-libcxx/patches/patch-libcxxabi_src_CMakeLists.txt
new file mode 100644
index 0000000000..01928ea943
--- /dev/null
+++ b/wasi-libcxx/patches/patch-libcxxabi_src_CMakeLists.txt
@@ -0,0 +1,14 @@
+$NetBSD: patch-libcxxabi_src_CMakeLists.txt,v 1.1 2022/11/14 18:44:07 adam Exp $
+
+Fix build.
+
+--- libcxxabi/src/CMakeLists.txt.orig	2022-11-13 10:23:18.552841671 +0000
++++ libcxxabi/src/CMakeLists.txt
+@@ -57,6 +57,7 @@ if (MSVC_IDE OR XCODE)
+ endif()
+ 
+ # Some files depend on libc++ internals.
++include_directories("${LIBCXXABI_LIBCXX_PATH}/include")
+ include_directories("${LIBCXXABI_LIBCXX_PATH}/src")
+ 
+ if (LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)


Home | Main Index | Thread Index | Old Index