Cross Compiling Swift 5.10.1 for Linux ARMv7

It seems like it's an ever-elusive topic, but I have been working on being able to cross compile Swift 5.10.1 (stdlibs and corelibs only) to armv7 using a Debian 12 sysroot and run it on my Raspberry Pi. Since I hate not sharing such knowledge, I've created I guide on my blog here:

My hope is that anyone else who is interested in targeting an armv7 board can use these instructions as a starting point. I am working on pull requesting my cross compilation buildbot profile back to swiftlang/swift, but who knows if that'll get accepted. Either way, it's just another step towards the dream of eventually having an official build of Swift for armv7!

5 Likes

Nice writeup, have you thought about adding armv7 support to the new static linux Musl SDK? That may be a good way to get linux armv7 cross-compilation going, by adding armv7 support to the build scripts that generate that Swift Musl SDK for 64-bit platforms now.

1 Like

That sounds like an interesting thing to try. I've struggled to try to get the whole "compiling for armv7" momentum going, so maybe this could be a simple way to do it without requiring too much effort...I'll put a note to look into it next.