Cross-architecture compilation on Linux

I'd love to see aarch64 Swift support on the Compiler Explorer. Right now it's limited to x86-64 because Compiler Explorer happens to use x86-64 Linux servers, and the official Swift toolchains for Linux don't support cross-architecture compilation.

I saw that SE-0387: Swift SDKs for Cross-Compilation got accepted, but I don't see any apparent implementation of it…?

I saw that @Finagolfin tried to implement this support but it was rejected by Apple…?

Is there a viable way to compile for aarch64 from x86-64 Linux today?

See also compiler-explorer issue #566: ARM compiler option for Swift.

1 Like

They do, it's just not drop-dead simple or documented yet.

I believe it is implemented and will ship with the upcoming Swift 5.9, but can't speak to any remaining issues that might hold that back, as I have not used it yet.

That is more of an ancillary issue with placing the Swift runtime libraries for multiple architectures of one non-Darwin/Windows platform in a single Swift resource directory, which is easily worked around.

I have gone into more detail there.

1 Like