git: 230591a79164 - main - lang/swift6: add powerpc64le support

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Mon, 19 Oct 2026 09:32:17 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=230591a7916480f270c35e24d43ac384a7fb01cb

commit 230591a7916480f270c35e24d43ac384a7fb01cb
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-19 08:29:34 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-19 09:31:51 +0000

    lang/swift6: add powerpc64le support
    
    Two bootstrap tarballs are needed because the long double ABI changed in
    16.0: freebsd14 works on 14.x and on 15.x with misc/compat14x, freebsd16 is
    for 16.0 and newer. Both were built with the port's own BOOTSTRAP_MODE.
    
    PR:             299357
    Approved by:    tagattie (maintainer)
---
 lang/swift6/Makefile                               |  44 ++++++--
 lang/swift6/distinfo                               |   8 ++
 ...atch-llvm-project_clang_lib_Basic_Targets_PPC.h |  16 +++
 ...ch-llvm-project_clang_lib_CodeGen_CGBuiltin.cpp |  19 ++++
 ...tch-llvm-project_clang_lib_Driver_ToolChain.cpp |  13 +++
 ...tch-swift-asn1_cmake_modules_SwiftSupport.cmake |  14 +++
 ...-swift-build_Sources_SWBUtil_Architecture.swift |  22 ++++
 .../patch-swift-corelibs-libdispatch_src_queue.c   |  34 ++++++
 ...-crypto_Sources_CCryptoBoringSSL_CMakeLists.txt |  12 +++
 ...ptoBoringSSL_include_CCryptoBoringSSL__target.h |  13 +++
 ...h-swift-crypto_cmake_modules_SwiftSupport.cmake |  14 +++
 ...tch-swift_cmake_modules_SwiftConfigureSDK.cmake |  11 ++
 .../swift6/files/patch-swift_lib_IRGen_GenCall.cpp |  18 ++++
 .../files/patch-swift_lib_IRGen_GenOpaque.cpp      |  31 ++++++
 .../files/patch-swift_lib_IRGen_IRGenSIL.cpp       | 103 ++++++++++++++++++
 ...dlib_public_SwiftShims_swift_shims_Visibility.h |  15 +++
 .../files/patch-swift_utils_build-script-impl      |  10 ++
 ...build__support_swift__build__support_targets.py |  20 ++++
 lang/swift6/pkg-plist                              | 120 ++++++++++-----------
 19 files changed, 469 insertions(+), 68 deletions(-)

diff --git a/lang/swift6/Makefile b/lang/swift6/Makefile
index 78fcc8fe6c9f..bd6d2dd03710 100644
--- a/lang/swift6/Makefile
+++ b/lang/swift6/Makefile
@@ -7,19 +7,39 @@ CATEGORIES=	lang
 PKGNAMESUFFIX=	6
 DIST_SUBDIR=	${PORTNAME}
 
+OPTIONS_DEFINE=	DOCS
+
+.include <bsd.port.options.mk>
+
+# powerpc64le bootstrap toolchains exist for both long-double ABIs: freebsd14
+# (64-bit long double, also usable on 15.x via misc/compat14x) and freebsd16
+# (IEEE binary128, for the ABI flag day at OSVERSION 1600019).
+.if ${ARCH} == powerpc64le
+.   if ${OSVERSION} >= 1600019
+_BOOTSTRAP_OSSUFX=	16
+.   else
+_BOOTSTRAP_OSSUFX=	14
+.   endif
+.endif
+_BOOTSTRAP_OSSUFX?=	# empty
+
 OLD_SWIFT_VERSION=		6.3.3
 .if !defined(BOOTSTRAP_MODE)
 BOOTSTRAP_SWIFT_VERSION=	${DISTVERSION}
 .else
 BOOTSTRAP_SWIFT_VERSION=	${OLD_SWIFT_VERSION}
 .endif
+.if ${ARCH} == powerpc64le
+MASTER_SITES=	LOCAL/pkubaj/${PORTNAME}:bootstrap
+.else
 MASTER_SITES=	LOCAL/tagattie/${PORTNAME}:bootstrap
+.endif
 .if make(makesum) && defined(MAKESUM_MODE)
 .   for version in ${OLD_SWIFT_VERSION} ${DISTVERSION}
-DISTFILES+=	${PORTNAME}${PKGNAMESUFFIX}-bootstrap-${version}-${SWIFT_ARCH}-unknown-${OPSYS:tl}${EXTRACT_SUFX}:bootstrap
+DISTFILES+=	${PORTNAME}${PKGNAMESUFFIX}-bootstrap-${version}-${SWIFT_ARCH}-unknown-${OPSYS:tl}${_BOOTSTRAP_OSSUFX}${EXTRACT_SUFX}:bootstrap
 .   endfor
 .else
-DISTFILES=	${PORTNAME}${PKGNAMESUFFIX}-bootstrap-${BOOTSTRAP_SWIFT_VERSION}-${SWIFT_ARCH}-unknown-${OPSYS:tl}${EXTRACT_SUFX}:bootstrap
+DISTFILES=	${PORTNAME}${PKGNAMESUFFIX}-bootstrap-${BOOTSTRAP_SWIFT_VERSION}-${SWIFT_ARCH}-unknown-${OPSYS:tl}${_BOOTSTRAP_OSSUFX}${EXTRACT_SUFX}:bootstrap
 .endif
 
 MAINTAINER=	tagattie@FreeBSD.org
@@ -29,8 +49,8 @@ WWW=		https://www.swift.org/
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/swift/LICENSE.txt
 
-ONLY_FOR_ARCHS=		amd64
-ONLY_FOR_ARCHS_REASON=	bootstrap is available only on amd64 architecture
+ONLY_FOR_ARCHS=		amd64 powerpc64le
+ONLY_FOR_ARCHS_REASON=	bootstrap is available only on amd64 and powerpc64le
 
 BUILD_DEPENDS=	rsync:net/rsync \
 		bash:shells/bash
@@ -109,10 +129,18 @@ WRKSRC=		${WRKDIR}/swift-${DISTVERSION}
 
 PLIST_SUB=	SWIFT_ARCH=${SWIFT_ARCH} \
 		SWIFT_TARGET_TRIPLE=${SWIFT_ARCH}-unknown-${OPSYS:tl}
+# Sanitizer/profiling runtimes that compiler-rt does not support on
+# FreeBSD/powerpc64le (ASan, UBSan, profile and static XRay do build there).
+.if ${ARCH} == powerpc64le
+PLIST_SUB+=	MSAN="@comment " TSAN="@comment " CFI="@comment " \
+		FUZZER="@comment " SAFESTACK="@comment " XRAYDSO="@comment " \
+		ORCRT="@comment " BUILTINSI386="@comment "
+.else
+PLIST_SUB+=	MSAN="" TSAN="" CFI="" FUZZER="" SAFESTACK="" XRAYDSO="" \
+		ORCRT="" BUILTINSI386=""
+.endif
 PORTDOCS=	CHANGELOG.md CONTRIBUTING.md README.md
 
-OPTIONS_DEFINE=	DOCS
-
 SWIFT_ARCH=	${ARCH:S/amd64/x86_64/}
 # SwiftPM expects swift toolchain executables are located in
 # <sdk root>/usr/local/bin.
@@ -159,7 +187,7 @@ COMMON_BUILDFLAGS=	\
 		--extra-cmake-options="-DSWIFT_USE_LINKER=lld" \
 		--verbose-build true \
 		--skip-clean-libdispatch true \
-		--llvm-targets-to-build "AArch64;X86" \
+		--llvm-targets-to-build "AArch64;PowerPC;X86" \
 		--llvm-install-components "llvm-ar;llvm-nm;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;libclang;lld;LTO;clang-features-file" \
 		--bootstrapping hosttools \
 		${CCACHE_BUILDFLAGS} \
@@ -397,7 +425,7 @@ make-bootstrap-archive:
 		-f ${WRKDIR}/${PORTNAME}${PKGNAMESUFFIX}-${DISTVERSION}.pkg \
 		-C ${STAGEDIR} \
 		--include '/usr/local/swift6/*'
-	${TAR} -cJf ${WRKDIR}/${PORTNAME}${PKGNAMESUFFIX}-bootstrap-${DISTVERSION}-${SWIFT_ARCH}-unknown-${OPSYS:tl}${EXTRACT_SUFX} \
+	${TAR} -cJf ${WRKDIR}/${PORTNAME}${PKGNAMESUFFIX}-bootstrap-${DISTVERSION}-${SWIFT_ARCH}-unknown-${OPSYS:tl}${_BOOTSTRAP_OSSUFX}${EXTRACT_SUFX} \
 		--options 'xz:threads=${MAKE_JOBS_NUMBER}' \
 		-s '|^\./|${PORTNAME}${PKGNAMESUFFIX}-bootstrap/|' \
 		-C ${STAGEDIR} .
diff --git a/lang/swift6/distinfo b/lang/swift6/distinfo
index dec701f6f6a2..180e22a007c7 100644
--- a/lang/swift6/distinfo
+++ b/lang/swift6/distinfo
@@ -99,3 +99,11 @@ SHA256 (swift/WebAssembly-wasi-libc-wasi-sdk-32_GH0.tar.gz) = ea9827495c0f35bca3
 SIZE (swift/WebAssembly-wasi-libc-wasi-sdk-32_GH0.tar.gz) = 1637111
 SHA256 (swift/swiftwasm-WasmKit-0.3.1_GH0.tar.gz) = bdde81dccfedb18cfbaca91ae20c04adbdbfe8cbdc0c13652b9e2201f0870f48
 SIZE (swift/swiftwasm-WasmKit-0.3.1_GH0.tar.gz) = 599781
+SHA256 (swift/swift6-bootstrap-6.3.3-powerpc64le-unknown-freebsd14.tar.xz) = 7c7ca7263d1db1cbd676f57bf7efa9490e0134b20fcdb86165f3c01ba6df4913
+SIZE (swift/swift6-bootstrap-6.3.3-powerpc64le-unknown-freebsd14.tar.xz) = 575623480
+SHA256 (swift/swift6-bootstrap-6.3.3-powerpc64le-unknown-freebsd16.tar.xz) = 655dbee525189882bc34ae216539ad05efc33e888b14126413d369a27e4eaab3
+SIZE (swift/swift6-bootstrap-6.3.3-powerpc64le-unknown-freebsd16.tar.xz) = 588906812
+SHA256 (swift/swift6-bootstrap-6.4.0-powerpc64le-unknown-freebsd16.tar.xz) = 21f214390f6d865f47ec0cc976da80d6e19fdf62833a501f95ebfbf0532e5edd
+SIZE (swift/swift6-bootstrap-6.4.0-powerpc64le-unknown-freebsd16.tar.xz) = 762590568
+SHA256 (swift/swift6-bootstrap-6.4.0-powerpc64le-unknown-freebsd14.tar.xz) = caf9e83f2174a24ac2ed7553999c2010e7690fb552b449375ee641853a38beae
+SIZE (swift/swift6-bootstrap-6.4.0-powerpc64le-unknown-freebsd14.tar.xz) = 742118740
diff --git a/lang/swift6/files/patch-llvm-project_clang_lib_Basic_Targets_PPC.h b/lang/swift6/files/patch-llvm-project_clang_lib_Basic_Targets_PPC.h
new file mode 100644
index 000000000000..f871c1ee5aaa
--- /dev/null
+++ b/lang/swift6/files/patch-llvm-project_clang_lib_Basic_Targets_PPC.h
@@ -0,0 +1,16 @@
+--- llvm-project/clang/lib/Basic/Targets/PPC.h.orig	2026-10-10 18:48:34 UTC
++++ llvm-project/clang/lib/Basic/Targets/PPC.h
+@@ -468,7 +468,12 @@
+       DataLayout += "-i64:64-i128:128-n32:64";
+     }
+ 
+-    if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
++    if (Triple.isOSFreeBSD() && Triple.getArch() == llvm::Triple::ppc64le &&
++        Triple.getOSMajorVersion() >= 16) {
++      LongDoubleWidth = LongDoubleAlign = 128;
++      LongDoubleFormat = &llvm::APFloat::IEEEquad();
++    } else if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() ||
++               Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     }
diff --git a/lang/swift6/files/patch-llvm-project_clang_lib_CodeGen_CGBuiltin.cpp b/lang/swift6/files/patch-llvm-project_clang_lib_CodeGen_CGBuiltin.cpp
new file mode 100644
index 000000000000..0a2fad6cff69
--- /dev/null
+++ b/lang/swift6/files/patch-llvm-project_clang_lib_CodeGen_CGBuiltin.cpp
@@ -0,0 +1,19 @@
+--- llvm-project/clang/lib/CodeGen/CGBuiltin.cpp.orig	2026-10-10 18:48:34 UTC
++++ llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
+@@ -228,7 +228,7 @@
+   else {
+     // TODO: This mutation should also be applied to other targets other than
+     // PPC, after backend supports IEEE 128-bit style libcalls.
+-    if (getTriple().isPPC64() &&
++    if (getTriple().isPPC64() && !getTriple().isOSFreeBSD() &&
+         &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() &&
+         F128Builtins.contains(BuiltinID))
+       Name = F128Builtins[BuiltinID];
+@@ -2601,6 +2601,7 @@
+   // TODO: This mutation should also be applied to other targets other than PPC,
+   // after backend supports IEEE 128-bit style libcalls.
+   if (getTarget().getTriple().isPPC64() &&
++      !getTarget().getTriple().isOSFreeBSD() &&
+       &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
+     BuiltinID = mutateLongDoubleBuiltin(BuiltinID);
+ 
diff --git a/lang/swift6/files/patch-llvm-project_clang_lib_Driver_ToolChain.cpp b/lang/swift6/files/patch-llvm-project_clang_lib_Driver_ToolChain.cpp
new file mode 100644
index 000000000000..7f8491f15601
--- /dev/null
+++ b/lang/swift6/files/patch-llvm-project_clang_lib_Driver_ToolChain.cpp
@@ -0,0 +1,13 @@
+--- llvm-project/clang/lib/Driver/ToolChain.cpp.orig	2026-10-10 18:51:43 UTC
++++ llvm-project/clang/lib/Driver/ToolChain.cpp
+@@ -193,6 +193,10 @@
+ }
+ 
+ bool ToolChain::defaultToIEEELongDouble() const {
++  if (getTriple().isOSFreeBSD() &&
++      getTriple().getArch() == llvm::Triple::ppc64le &&
++      getTriple().getOSMajorVersion() >= 16)
++    return true;
+   return PPC_LINUX_DEFAULT_IEEELONGDOUBLE && getTriple().isOSLinux();
+ }
+ 
diff --git a/lang/swift6/files/patch-swift-asn1_cmake_modules_SwiftSupport.cmake b/lang/swift6/files/patch-swift-asn1_cmake_modules_SwiftSupport.cmake
new file mode 100644
index 000000000000..833536e96277
--- /dev/null
+++ b/lang/swift6/files/patch-swift-asn1_cmake_modules_SwiftSupport.cmake
@@ -0,0 +1,14 @@
+--- swift-asn1/cmake/modules/SwiftSupport.cmake.orig	2026-10-10 18:48:34 UTC
++++ swift-asn1/cmake/modules/SwiftSupport.cmake
+@@ -28,9 +28,9 @@
+     else()
+       set("${result_var_name}" "aarch64" PARENT_SCOPE)
+     endif()
+-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64")
++  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "powerpc64")
+     set("${result_var_name}" "powerpc64" PARENT_SCOPE)
+-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le")
++  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "powerpc64le")
+     set("${result_var_name}" "powerpc64le" PARENT_SCOPE)
+   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "s390x")
+     set("${result_var_name}" "s390x" PARENT_SCOPE)
diff --git a/lang/swift6/files/patch-swift-build_Sources_SWBUtil_Architecture.swift b/lang/swift6/files/patch-swift-build_Sources_SWBUtil_Architecture.swift
new file mode 100644
index 000000000000..7921e46cc3b9
--- /dev/null
+++ b/lang/swift6/files/patch-swift-build_Sources_SWBUtil_Architecture.swift
@@ -0,0 +1,22 @@
+--- swift-build/Sources/SWBUtil/Architecture.swift.orig	2026-10-11 19:59:42 UTC
++++ swift-build/Sources/SWBUtil/Architecture.swift	2026-10-11 19:59:42 UTC
+@@ -105,6 +105,19 @@
+                         return "x86_64"
+                     case "arm64":
+                         return "aarch64"
++                    case "powerpc":
++                        // FreeBSD utsname.machine holds the platform
++                        // ("powerpc" for every PowerPC flavor), not the CPU
++                        // architecture (MACHINE_ARCH, e.g. powerpc64le).
++                        // A native process's compile-time architecture is
++                        // the host architecture.
++                        #if arch(powerpc64le)
++                        return "powerpc64le"
++                        #elseif arch(powerpc64)
++                        return "powerpc64"
++                        #else
++                        break
++                        #endif
+                     default:
+                         break
+                     }
diff --git a/lang/swift6/files/patch-swift-corelibs-libdispatch_src_queue.c b/lang/swift6/files/patch-swift-corelibs-libdispatch_src_queue.c
new file mode 100644
index 000000000000..5694001a91b7
--- /dev/null
+++ b/lang/swift6/files/patch-swift-corelibs-libdispatch_src_queue.c
@@ -0,0 +1,34 @@
+--- swift-corelibs-libdispatch/src/queue.c.orig	2026-10-10 18:48:34 UTC
++++ swift-corelibs-libdispatch/src/queue.c
+@@ -6198,14 +6198,25 @@
+ 	dq->dgq_thread_pool_size = thread_pool_size;
+ 	qos_class_t cls = _dispatch_qos_to_qos_class(_dispatch_priority_qos(pri) ?:
+ 			_dispatch_priority_fallback_qos(pri));
+-	if (cls) {
+ #if !defined(_WIN32)
+-		pthread_attr_t *attr = &pqc->dpq_thread_attr;
+-		int r = pthread_attr_init(attr);
+-		dispatch_assume_zero(r);
+-		r = pthread_attr_setdetachstate(attr, PTHREAD_CREATE_DETACHED);
+-		dispatch_assume_zero(r);
++	// Always initialize the worker thread attributes: platforms without QoS
++	// classes (such as FreeBSD) never enter the cls branch, but targets that
++	// need a larger worker stack (see below) still require the attributes.
++	pthread_attr_t *attr = &pqc->dpq_thread_attr;
++	int r = pthread_attr_init(attr);
++	dispatch_assume_zero(r);
++	r = pthread_attr_setdetachstate(attr, PTHREAD_CREATE_DETACHED);
++	dispatch_assume_zero(r);
++#if defined(__powerpc64__)
++	// LLVM cannot emit guaranteed tail calls for the indirect continuation
++	// calls Swift concurrency relies on (swifttailcc) on PowerPC, so async
++	// continuations consume real stack frames.  Give pool worker threads a
++	// large stack so bounded async call chains do not overflow the default.
++	r = pthread_attr_setstacksize(attr, 512 * 1024 * 1024);
++	dispatch_assume_zero(r);
++#endif // defined(__powerpc64__)
+ #endif // !defined(_WIN32)
++	if (cls) {
+ #if HAVE_PTHREAD_WORKQUEUE_QOS
+ 		r = pthread_attr_set_qos_class_np(attr, cls, 0);
+ 		dispatch_assume_zero(r);
diff --git a/lang/swift6/files/patch-swift-crypto_Sources_CCryptoBoringSSL_CMakeLists.txt b/lang/swift6/files/patch-swift-crypto_Sources_CCryptoBoringSSL_CMakeLists.txt
new file mode 100644
index 000000000000..7a7cf72f73b2
--- /dev/null
+++ b/lang/swift6/files/patch-swift-crypto_Sources_CCryptoBoringSSL_CMakeLists.txt
@@ -0,0 +1,12 @@
+--- swift-crypto/Sources/CCryptoBoringSSL/CMakeLists.txt.orig	2026-10-10 18:48:34 UTC
++++ swift-crypto/Sources/CCryptoBoringSSL/CMakeLists.txt
+@@ -353,6 +353,9 @@
+     gen/bcm/vpaes-armv8-win.S
+     gen/crypto/chacha-armv8-win.S
+     gen/crypto/chacha20_poly1305_armv8-win.S)
++elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc64|ppc64")
++  # BoringSSL carries no PowerPC assembly; use the portable C implementation.
++  target_compile_definitions(CCryptoBoringSSL PRIVATE OPENSSL_NO_ASM)
+ else()
+    message(FATAL_ERROR "platform sources are not defined here for ${CMAKE_SYSTEM_NAME} on ${CMAKE_SYSTEM_PROCESSOR}")
+ endif()
diff --git a/lang/swift6/files/patch-swift-crypto_Sources_CCryptoBoringSSL_include_CCryptoBoringSSL__target.h b/lang/swift6/files/patch-swift-crypto_Sources_CCryptoBoringSSL_include_CCryptoBoringSSL__target.h
new file mode 100644
index 000000000000..74487d758c53
--- /dev/null
+++ b/lang/swift6/files/patch-swift-crypto_Sources_CCryptoBoringSSL_include_CCryptoBoringSSL__target.h
@@ -0,0 +1,13 @@
+--- swift-crypto/Sources/CCryptoBoringSSL/include/CCryptoBoringSSL_target.h.orig	2026-10-10 18:48:34 UTC
++++ swift-crypto/Sources/CCryptoBoringSSL/include/CCryptoBoringSSL_target.h
+@@ -54,6 +54,10 @@
+ #define OPENSSL_32_BIT
+ #elif defined(__myriad2__)
+ #define OPENSSL_32_BIT
++#elif defined(__powerpc64__) || defined(__PPC64__)
++// 64-bit PowerPC.  Assembly support was dropped upstream; the portable C
++// implementation (OPENSSL_NO_ASM) is used on this target.
++#define OPENSSL_64_BIT
+ #else
+ // The list above enumerates the platforms that BoringSSL supports. For these
+ // platforms we keep a reasonable bar of not breaking them: automated test
diff --git a/lang/swift6/files/patch-swift-crypto_cmake_modules_SwiftSupport.cmake b/lang/swift6/files/patch-swift-crypto_cmake_modules_SwiftSupport.cmake
new file mode 100644
index 000000000000..4b75775e66f6
--- /dev/null
+++ b/lang/swift6/files/patch-swift-crypto_cmake_modules_SwiftSupport.cmake
@@ -0,0 +1,14 @@
+--- swift-crypto/cmake/modules/SwiftSupport.cmake.orig	2026-10-10 18:48:34 UTC
++++ swift-crypto/cmake/modules/SwiftSupport.cmake
+@@ -28,9 +28,9 @@
+     else()
+       set("${result_var_name}" "aarch64" PARENT_SCOPE)
+     endif()
+-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64")
++  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "powerpc64")
+     set("${result_var_name}" "powerpc64" PARENT_SCOPE)
+-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le")
++  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "powerpc64le")
+     set("${result_var_name}" "powerpc64le" PARENT_SCOPE)
+   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "s390x")
+     set("${result_var_name}" "s390x" PARENT_SCOPE)
diff --git a/lang/swift6/files/patch-swift_cmake_modules_SwiftConfigureSDK.cmake b/lang/swift6/files/patch-swift_cmake_modules_SwiftConfigureSDK.cmake
new file mode 100644
index 000000000000..7278a9da8549
--- /dev/null
+++ b/lang/swift6/files/patch-swift_cmake_modules_SwiftConfigureSDK.cmake
@@ -0,0 +1,11 @@
+--- swift/cmake/modules/SwiftConfigureSDK.cmake.orig	2026-10-10 18:48:34 UTC
++++ swift/cmake/modules/SwiftConfigureSDK.cmake
+@@ -426,7 +426,7 @@
+           message(FATAL_ERROR "unknown arch for ${prefix}: ${arch}")
+         endif()
+       elseif("${prefix}" STREQUAL "FREEBSD")
+-        if(NOT arch MATCHES "(aarch64|x86_64)")
++        if(NOT arch MATCHES "(aarch64|powerpc64le|x86_64)")
+           message(FATAL_ERROR "unsupported arch for FreeBSD: ${arch}")
+         endif()
+ 
diff --git a/lang/swift6/files/patch-swift_lib_IRGen_GenCall.cpp b/lang/swift6/files/patch-swift_lib_IRGen_GenCall.cpp
new file mode 100644
index 000000000000..14c3d764ee4e
--- /dev/null
+++ b/lang/swift6/files/patch-swift_lib_IRGen_GenCall.cpp
@@ -0,0 +1,18 @@
+--- swift/lib/IRGen/GenCall.cpp.orig	2026-10-10 18:48:34 UTC
++++ swift/lib/IRGen/GenCall.cpp
+@@ -5508,8 +5508,13 @@
+ 
+   // Initialize at the alloca point.
+   if (setSwiftErrorFlag) {
+-    auto nullError = llvm::ConstantPointerNull::get(
+-        cast<llvm::PointerType>(errorStorageType));
++    // errorStorageType is a pointer for the swifterror flag, but on targets
++    // that do not reserve a swifterror register a typed error slot has the
++    // error's concrete (possibly non-pointer aggregate) storage type.
++    // getNullValue produces the correct zero for either case; a
++    // ConstantPointerNull carrying an aggregate type is ill-formed and gets
++    // scalarized into invalid `extractvalue <agg> null` stores downstream.
++    auto *nullError = llvm::Constant::getNullValue(errorStorageType);
+     builder.CreateStore(nullError, addr);
+   }
+ 
diff --git a/lang/swift6/files/patch-swift_lib_IRGen_GenOpaque.cpp b/lang/swift6/files/patch-swift_lib_IRGen_GenOpaque.cpp
new file mode 100644
index 000000000000..e4501e3317f4
--- /dev/null
+++ b/lang/swift6/files/patch-swift_lib_IRGen_GenOpaque.cpp
@@ -0,0 +1,31 @@
+--- swift/lib/IRGen/GenOpaque.cpp.orig	2026-10-10 18:48:34 UTC
++++ swift/lib/IRGen/GenOpaque.cpp
+@@ -179,15 +179,26 @@
+   case ValueWitness::Destroy:
+   case ValueWitness::DestructiveInjectEnumTag:
+   case ValueWitness::DestructiveProjectEnumData:
+-  case ValueWitness::GetEnumTag:
+   case ValueWitness::StoreEnumTagSinglePayload:
+     return attrs.addParamAttribute(ctx, 0, llvm::Attribute::NoAlias);
+ 
++  // getEnumTag returns the case index as an unsigned value.  Mark the result
++  // zeroext so that on targets which return sub-word integers in the low bits
++  // of a wider register without guaranteeing the high bits (e.g. PowerPC64,
++  // where a GPR is 64 bits and has no zeroing narrow sub-registers), the
++  // callee extends the result.  Otherwise callers that consume the tag as a
++  // full-width index read stale high bits and compute an out-of-bounds field
++  // record address.
++  case ValueWitness::GetEnumTag:
++    return attrs.addParamAttribute(ctx, 0, llvm::Attribute::NoAlias)
++        .addRetAttribute(ctx, llvm::Attribute::ZExt);
++
+   case ValueWitness::GetEnumTagSinglePayload:
+     return attrs
+         .addFnAttribute(ctx, llvm::Attribute::getWithMemoryEffects(
+                                  ctx, llvm::MemoryEffects::readOnly()))
+-        .addParamAttribute(ctx, 0, llvm::Attribute::NoAlias);
++        .addParamAttribute(ctx, 0, llvm::Attribute::NoAlias)
++        .addRetAttribute(ctx, llvm::Attribute::ZExt);
+ 
+   // These have two arguments and they don't alias each other.
+   case ValueWitness::AssignWithTake:
diff --git a/lang/swift6/files/patch-swift_lib_IRGen_IRGenSIL.cpp b/lang/swift6/files/patch-swift_lib_IRGen_IRGenSIL.cpp
new file mode 100644
index 000000000000..f65da1d44d5a
--- /dev/null
+++ b/lang/swift6/files/patch-swift_lib_IRGen_IRGenSIL.cpp
@@ -0,0 +1,103 @@
+--- swift/lib/IRGen/IRGenSIL.cpp.orig	2026-10-10 18:48:34 UTC
++++ swift/lib/IRGen/IRGenSIL.cpp
+@@ -4067,10 +4067,37 @@
+     // Zero the error slot to maintain the invariant that it always
+     // contains null.  This will frequently become a dead store.
+     auto nullError = llvm::Constant::getNullValue(errorValue->getType());
++
++    // On targets that do not reserve a swifterror register, a typed error slot
++    // has the error's concrete storage type, which may be a non-scalar
++    // aggregate.  Such a value cannot be used with icmp/ptrtoint, and storing
++    // its zero-initializer gets scalarized into invalid `extractvalue <agg>
++    // null` sequences that crash instruction selection.  In that case operate
++    // on an integer view of the slot of the same size instead.
++    bool errorIsScalar = errorValue->getType()->isPointerTy() ||
++                         errorValue->getType()->isIntegerTy();
++    llvm::IntegerType *errorIntTy = nullptr;
++    Address errorIntSlot;
++    if (!errorIsScalar) {
++      auto sizeInBits =
++          IGM.DataLayout.getTypeSizeInBits(errorValue->getType());
++      errorIntTy = llvm::IntegerType::get(IGM.getLLVMContext(),
++                                          sizeInBits.getFixedValue());
++      errorIntSlot = Address(calleeErrorSlot.getAddress(), errorIntTy,
++                             calleeErrorSlot.getAlignment());
++    }
++    auto zeroErrorSlot = [&] {
++      if (errorIsScalar)
++        Builder.CreateStore(nullError, calleeErrorSlot);
++      else
++        Builder.CreateStore(llvm::ConstantInt::get(errorIntTy, 0),
++                            errorIntSlot);
++    };
++
+     if (!tryApplyInst->getErrorBB()->getSinglePredecessorBlock()) {
+       // Only do that here if we can't move the store to the error block.
+       // See below.
+-      Builder.CreateStore(nullError, calleeErrorSlot);
++      zeroErrorSlot();
+     }
+     auto hasTypedDirectError =
+         substConv.isTypedError() && !substConv.hasIndirectSILErrorResults();
+@@ -4080,14 +4107,37 @@
+     }
+ 
+     // If the error value is non-null, branch to the error destination.
+-    auto hasError = Builder.CreateICmpNE(errorValue, nullError);
++    llvm::Value *hasError;
++    if (errorIsScalar) {
++      hasError = Builder.CreateICmpNE(errorValue, nullError);
+ 
+-    // Create a dummy use of 'errorValue' in the catch BB to workaround an
+-    // LLVM miscompile that ends up taking the wrong branch if there are no
+-    // uses of 'errorValue' in the catch block.
+-    // FIXME: Remove this when the following radar is fixed: rdar://116636601
+-    Builder.CreatePtrToInt(errorValue, IGM.IntPtrTy);
++      // Create a dummy use of 'errorValue' in the catch BB to workaround an
++      // LLVM miscompile that ends up taking the wrong branch if there are no
++      // uses of 'errorValue' in the catch block.
++      // FIXME: Remove this when the following radar is fixed: rdar://116636601
++      Builder.CreatePtrToInt(errorValue, IGM.IntPtrTy);
++    } else {
++      // Compare the raw storage bits against zero through the integer view.
++      auto *errorBits = Builder.CreateLoad(errorIntSlot);
++      hasError = Builder.CreateICmpNE(errorBits,
++                                      llvm::ConstantInt::get(errorIntTy, 0));
++    }
+ 
++    // Precompute the value fed to the single error-edge PHI (see below) while
++    // we are still in the predecessor block, before the conditional branch.
++    // The PHI is typed with the error's native representation, which may differ
++    // from the slot's storage type; reinterpret the slot through the PHI's type
++    // when they disagree.
++    llvm::Value *errorPHIValue = errorValue;
++    if (!errorIsScalar && !typedErrorLoadBB && errorDest.phis.size() == 1) {
++      auto *phiTy = errorDest.phis[0]->getType();
++      if (errorPHIValue->getType() != phiTy) {
++        Address phiSlot(calleeErrorSlot.getAddress(), phiTy,
++                        calleeErrorSlot.getAlignment());
++        errorPHIValue = Builder.CreateLoad(phiSlot);
++      }
++    }
++
+     // Emit profile metadata if available.
+     llvm::MDNode *Weights = nullptr;
+     auto NormalBBCount = tryApplyInst->getNormalBBCount();
+@@ -4112,7 +4162,7 @@
+              (substConv.hasIndirectSILErrorResults() &&
+               errorDest.phis.empty()));
+       if (errorDest.phis.size() == 1)
+-        errorDest.phis[0]->addIncoming(errorValue, Builder.GetInsertBlock());
++        errorDest.phis[0]->addIncoming(errorPHIValue, Builder.GetInsertBlock());
+     } else {
+       Builder.emitBlock(typedErrorLoadBB);
+ 
+@@ -4161,7 +4211,7 @@
+       // that it will become a dead store.
+       auto origBB = Builder.GetInsertBlock();
+       Builder.SetInsertPoint(errorDest.bb);
+-      Builder.CreateStore(nullError, calleeErrorSlot);
++      zeroErrorSlot();
+       Builder.SetInsertPoint(origBB);
+     }
+   }
diff --git a/lang/swift6/files/patch-swift_stdlib_public_SwiftShims_swift_shims_Visibility.h b/lang/swift6/files/patch-swift_stdlib_public_SwiftShims_swift_shims_Visibility.h
new file mode 100644
index 000000000000..528c8868badb
--- /dev/null
+++ b/lang/swift6/files/patch-swift_stdlib_public_SwiftShims_swift_shims_Visibility.h
@@ -0,0 +1,15 @@
+--- swift/stdlib/public/SwiftShims/swift/shims/Visibility.h.orig	2026-10-10 18:48:34 UTC
++++ swift/stdlib/public/SwiftShims/swift/shims/Visibility.h
+@@ -110,8 +110,10 @@
+ #endif
+ 
+ // WASM says yes to __has_attribute(musttail) but doesn't support using it, so
+-// exclude WASM from SWIFT_MUSTTAIL.
+-#if __has_attribute(musttail) && !defined(__wasm__)
++// exclude WASM from SWIFT_MUSTTAIL.  PowerPC also reports support, but LLVM
++// cannot emit guaranteed tail calls for indirect calls there and clang
++// rejects them with a hard error, so exclude PowerPC as well.
++#if __has_attribute(musttail) && !defined(__wasm__) && !defined(__powerpc__)
+ #define SWIFT_MUSTTAIL [[clang::musttail]]
+ #else
+ #define SWIFT_MUSTTAIL
diff --git a/lang/swift6/files/patch-swift_utils_build-script-impl b/lang/swift6/files/patch-swift_utils_build-script-impl
new file mode 100644
index 000000000000..eaa37371129e
--- /dev/null
+++ b/lang/swift6/files/patch-swift_utils_build-script-impl
@@ -0,0 +1,10 @@
+--- swift/utils/build-script-impl.orig	2026-10-10 18:48:34 UTC
++++ swift/utils/build-script-impl
+@@ -467,6 +467,7 @@
+     case ${host} in
+       freebsd-aarch64           \
+       | freebsd-x86_64          \
++      | freebsd-powerpc64le     \
+       | openbsd-x86_64          \
+       | openbsd-aarch64         \
+       | cygwin-x86_64           \
diff --git a/lang/swift6/files/patch-swift_utils_swift__build__support_swift__build__support_targets.py b/lang/swift6/files/patch-swift_utils_swift__build__support_swift__build__support_targets.py
new file mode 100644
index 000000000000..9325f1e7eeaa
--- /dev/null
+++ b/lang/swift6/files/patch-swift_utils_swift__build__support_swift__build__support_targets.py
@@ -0,0 +1,20 @@
+--- swift/utils/swift_build_support/swift_build_support/targets.py.orig	2026-10-10 18:48:34 UTC
++++ swift/utils/swift_build_support/swift_build_support/targets.py
+@@ -290,7 +290,7 @@
+         "riscv64",
+         "s390x"])
+ 
+-    FreeBSD = Platform("freebsd", archs=["x86_64", "aarch64"])
++    FreeBSD = Platform("freebsd", archs=["x86_64", "aarch64", "powerpc64le"])
+ 
+     LinuxStatic = Platform('linux-static', sdk_name='LINUX_STATIC', archs=[
+         'x86_64',
+@@ -400,6 +400,8 @@
+                 return StdlibDeploymentTarget.FreeBSD.x86_64
+             elif machine == 'arm64':
+                 return StdlibDeploymentTarget.FreeBSD.aarch64
++            elif machine == 'powerpc' and platform.processor() == 'powerpc64le':
++                return StdlibDeploymentTarget.FreeBSD.powerpc64le
+ 
+         elif system == 'OpenBSD':
+             if machine == 'amd64':
diff --git a/lang/swift6/pkg-plist b/lang/swift6/pkg-plist
index 9b1ac16a8704..65ac225e004b 100644
--- a/lang/swift6/pkg-plist
+++ b/lang/swift6/pkg-plist
@@ -400,26 +400,26 @@ swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.asan-%%SWIFT_ARCH%%.so
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.asan_cxx-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.asan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.asan_static-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.builtins-i386.a
+%%BUILTINSI386%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.builtins-i386.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.builtins-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.cfi-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.cfi_diag-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.fuzzer-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.fuzzer_interceptors-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.fuzzer_no_main-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a.syms
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a.syms
+%%CFI%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.cfi-%%SWIFT_ARCH%%.a
+%%CFI%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.cfi_diag-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.fuzzer-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.fuzzer_interceptors-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.fuzzer_no_main-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a.syms
+%%MSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.profile-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.safestack-%%SWIFT_ARCH%%.a
+%%SAFESTACK%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.safestack-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.stats-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.stats_client-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a.syms
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.so
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a.syms
+%%TSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a
+%%TSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a.syms
+%%TSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.so
+%%TSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a
+%%TSAN%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.so
@@ -429,14 +429,14 @@ swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.ubsan_standalone-%%SWIFT_A
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.ubsan_standalone_cxx-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.ubsan_standalone_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.xray-basic-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.xray-dso-%%SWIFT_ARCH%%.a
+%%XRAYDSO%%swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.xray-dso-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.xray-fdr-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.xray-profiling-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/lib/freebsd/libclang_rt.xray-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/clang/21/lib/freebsd/liborc_rt-%%SWIFT_ARCH%%.a
+%%ORCRT%%swift6/usr/local/lib/clang/21/lib/freebsd/liborc_rt-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/clang/21/share/asan_ignorelist.txt
-swift6/usr/local/lib/clang/21/share/cfi_ignorelist.txt
-swift6/usr/local/lib/clang/21/share/msan_ignorelist.txt
+%%CFI%%swift6/usr/local/lib/clang/21/share/cfi_ignorelist.txt
+%%MSAN%%swift6/usr/local/lib/clang/21/share/msan_ignorelist.txt
 swift6/usr/local/lib/libIndexStore.so
 swift6/usr/local/lib/libIndexStore.so.21.0
 swift6/usr/local/lib/libLTO.so
@@ -1111,26 +1111,26 @@ swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.asan-%%SWIFT_ARCH%%.so
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.asan_cxx-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.asan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.asan_static-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.builtins-i386.a
+%%BUILTINSI386%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.builtins-i386.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.builtins-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.cfi-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.cfi_diag-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.fuzzer-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.fuzzer_interceptors-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.fuzzer_no_main-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a.syms
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a.syms
+%%CFI%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.cfi-%%SWIFT_ARCH%%.a
+%%CFI%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.cfi_diag-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.fuzzer-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.fuzzer_interceptors-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.fuzzer_no_main-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a.syms
+%%MSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.profile-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.safestack-%%SWIFT_ARCH%%.a
+%%SAFESTACK%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.safestack-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.stats-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.stats_client-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a.syms
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.so
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a.syms
+%%TSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a
+%%TSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a.syms
+%%TSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.so
+%%TSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a
+%%TSAN%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.so
@@ -1140,14 +1140,14 @@ swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.ubsan_standalone-%%SWIF
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.ubsan_standalone_cxx-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.ubsan_standalone_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.xray-basic-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.xray-dso-%%SWIFT_ARCH%%.a
+%%XRAYDSO%%swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.xray-dso-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.xray-fdr-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.xray-profiling-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/lib/freebsd/libclang_rt.xray-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift/clang/lib/freebsd/liborc_rt-%%SWIFT_ARCH%%.a
+%%ORCRT%%swift6/usr/local/lib/swift/clang/lib/freebsd/liborc_rt-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift/clang/share/asan_ignorelist.txt
-swift6/usr/local/lib/swift/clang/share/cfi_ignorelist.txt
-swift6/usr/local/lib/swift/clang/share/msan_ignorelist.txt
+%%CFI%%swift6/usr/local/lib/swift/clang/share/cfi_ignorelist.txt
+%%MSAN%%swift6/usr/local/lib/swift/clang/share/msan_ignorelist.txt
 swift6/usr/local/lib/swift/dispatch/base.h
 swift6/usr/local/lib/swift/dispatch/block.h
 swift6/usr/local/lib/swift/dispatch/data.h
@@ -2051,26 +2051,26 @@ swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.asan-%%SWIFT_ARC
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.asan_cxx-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.asan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.asan_static-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.builtins-i386.a
+%%BUILTINSI386%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.builtins-i386.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.builtins-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.cfi-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.cfi_diag-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.fuzzer-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.fuzzer_interceptors-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.fuzzer_no_main-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a.syms
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a.syms
+%%CFI%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.cfi-%%SWIFT_ARCH%%.a
+%%CFI%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.cfi_diag-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.fuzzer-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.fuzzer_interceptors-%%SWIFT_ARCH%%.a
+%%FUZZER%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.fuzzer_no_main-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan-%%SWIFT_ARCH%%.a.syms
+%%MSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a
+%%MSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.msan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.profile-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.safestack-%%SWIFT_ARCH%%.a
+%%SAFESTACK%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.safestack-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.stats-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.stats_client-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a.syms
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.so
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a.syms
+%%TSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a
+%%TSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.a.syms
+%%TSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan-%%SWIFT_ARCH%%.so
+%%TSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a
+%%TSAN%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.tsan_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.ubsan_minimal-%%SWIFT_ARCH%%.so
@@ -2080,14 +2080,14 @@ swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.ubsan_standalone
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.ubsan_standalone_cxx-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.ubsan_standalone_cxx-%%SWIFT_ARCH%%.a.syms
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.xray-basic-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.xray-dso-%%SWIFT_ARCH%%.a
+%%XRAYDSO%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.xray-dso-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.xray-fdr-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.xray-profiling-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/lib/freebsd/libclang_rt.xray-%%SWIFT_ARCH%%.a
-swift6/usr/local/lib/swift_static/clang/lib/freebsd/liborc_rt-%%SWIFT_ARCH%%.a
+%%ORCRT%%swift6/usr/local/lib/swift_static/clang/lib/freebsd/liborc_rt-%%SWIFT_ARCH%%.a
 swift6/usr/local/lib/swift_static/clang/share/asan_ignorelist.txt
-swift6/usr/local/lib/swift_static/clang/share/cfi_ignorelist.txt
-swift6/usr/local/lib/swift_static/clang/share/msan_ignorelist.txt
+%%CFI%%swift6/usr/local/lib/swift_static/clang/share/cfi_ignorelist.txt
+%%MSAN%%swift6/usr/local/lib/swift_static/clang/share/msan_ignorelist.txt
 swift6/usr/local/lib/swift_static/dispatch/base.h
 swift6/usr/local/lib/swift_static/dispatch/block.h
 swift6/usr/local/lib/swift_static/dispatch/data.h