Swift on RISC-V

June 2024 - Special Announcement

Hi everyone,

I am excited to announce the first release from the Swift on RISC-V project.

Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: riscv64-unknown-linux-gnu

This a complete swift toolchain for installation and use on riscv64 hardware such as the visionfive2 board.

Please Note ~
This release is not production ready and may have unexpected bugs!

Known Issues ~

  • swift repl - not working

  • swift scripting - not working - e.g. swift hello.swift

  • macros are unavailable as the toolchain is build with bootstrapping off

  • swiftc requires extra flags -Xlinker -latomic - e.g. swiftc -Xlinker -latomic hello.swift

  • swift build requires extra flags -Xlinker -latomic - e.g. swift build -Xlinker -latomic

  • swift run requires extra flags -Xlinker -latomic - e.g. swift run -Xlinker -latomic

  • swift test requires extra flags -Xlinker -latomic - e.g. swift test -Xlinker -latomic

Installation ~

The release includes both .tar.gz and .deb package files.

The easiest way to install swift is to download the .deb package and use the system apt installer.

wget https://github.com/swift-riscv/swift-riscv64/releases/download/swift-5.10.1-RELEASE/swiftlang_5.10.1-1.0.0-debian-sid_riscv64.deb

sudo apt install ./swiftlang_5.10.1-1.0.0-debian-sid_riscv64.deb

Docker ~

If you don't have any riscv64 hardware but would still like to test out swift on riscv64 there is a docker image available.

docker pull swiftarm/swift:5.10.1-debian-unstable-riscv64
docker run --platform linux/riscv64 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -it swiftarm/swift:5.10.1-debian-unstable-riscv64   /bin/bash

Project Update

  • All development has now moved to swift-5.10.1-RELEASE and the main-branch. Older swift versions have proved to be too difficult and not viable to continue.

  • Test release of swift-5.10.1-RELEASE for riscv64 is now available!

  • A new project, Patches to Upstream, has been set up to track upstream patches being submitted to swift and all the supporting projects.

  • New riscv64 hardware is coming soon! In the coming weeks we will be receiving a new Pioneer Box will hugely reduce build times and increase productivity.

Thats all for now, hope you enjoy using swift on riscv64.

Thanks.

One more thing ~

Included in the release there is a special riscv64 version of the Vapor Toolbox.

20 Likes