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 lately the FreeBSD port has succumbed to bit rot.
A few weeks ago, 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.
Completed work
Changes required for Swift 5.7
- 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 - Use
lld
, notgold
; PR merged, PR merged - Fix bootstrapped build; PR merged
- Don't pass
-nostdsysteminc
in ClangImporter; PR - Recognize
amd64
inCMAKE_SYSTEM_PROCESSOR
(minor); PR - Fix build of
SwiftReflectionTest
; PR - Install
SwiftGlibc.h
inswift_static
resources; PR
Other changes
These are fixes for bugs introduced after 5.7.
- Fix FreeBSD build in
lib/Threading
; PR merged - Move clang include path management from frontend to driver; patch accepted
Work in progress
- Problem finding SwiftGlibc due to ClangImporter's looking at driver arguments—need to backport clang change
- stdlib dylibs are not being given an RPATH, which prevents them from being linked; patch prepared
Float
methods use LLVM intrinsics like@llvm.round
, which require libm, which is not linked; patch prepared
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 branch
Future directions
- Get dispatch up and running
- Add swift-driver to build