Matt Jacobson
Swift is officially supported on Darwin, Linux, and Windows. Some people have put in work to get it running on FreeBSD and OpenBSD, but over time the FreeBSD port succumbed to bit rot.
In October 2022, I started working on getting the FreeBSD port working again. I'm going to try something new where I attempt to use a blog entry for my project notes, with the hopes that it'll force me to organize them better.
This document is likely incomplete and incorrect. Last updated: Mar. 16, 2023.
Completed work
- Build system fix in
configure_unix_sdk
; PR merged Workaround forabandoned<unwind.h>
craziness; PR- Build fix in
swift-dependency-tool
; PR merged - Define
CLongDouble
; PR merged - Define
RTLD_DEFAULT
; PR merged - Another build system fix in
configure_unix_sdk
; PR merged - Use
lld
, notgold
; PR merged, swift-driver PR merged - Fix bootstrapped build; PR merged
Don't passabandoned in favor of LLVM change-nostdsysteminc
in ClangImporter; PR- Fix FreeBSD build in
lib/Threading
; PR merged - Recognize
amd64
inCMAKE_SYSTEM_PROCESSOR
(minor); PR merged - Fix build of
SwiftReflectionTest
; PR merged - Install
SwiftGlibc.h
inswift_static
resources; PR merged - Set rpath of stdlib dylibs to
$ORIGIN
; PR - Implement clock functions; PR merged
- Move clang include path management from frontend to driver; patch accepted, apple/llvm-project cherry-pick merged
- Fix implicit
_Concurrency
import; PR merged - Fix rebranch build failure (post-5.8); PR
- Implement
POSIXErrorCode
; PR merged
Work in progress
Float
methods use LLVM intrinsics like@llvm.round
, which require libm, which is not linked; patch prepared- Changes to libdispatch to make it build on FreeBSD (again)
- Changes to Foundation to make it build on FreeBSD
- Fix various unit tests on FreeBSD
This stuff will be updated on an ongoing basis:
- A docs page on how to build on FreeBSD
- A ports tree entry
Swift 5.7 + FreeBSD fixes branchno longer maintained
Future directions
- Add swift-driver to build
- SwiftPM