PSA: godbolt/compiler-explorer updates

as the compiler-explorer site appears to have updated today, the changes[1] to add a new swift compiler configuration to display aarch64 assembly are now live. you can test it out by selecting a compiler from the 'swift (aarch64)' group in the dropdown menu (e.g. like this).

this new configuration works by invoking the corresponding x86 compiler with the additional arguments for cross compiling via the Musl SDK implicitly added to the swiftc invocation. currently, only the 6.0 release compiler supports this cross compilation mode, but once we figure this out, i think we should be able to get something analogous working for the development branches too.

as an aside – thanks to those of you who contributed ideas over the years in the associated feature request thread for how this might be implemented. in particular @Finagolfin, who, as far as i can tell, has helped many people better understand how cross compilation in Swift can be made to work. and of course, thanks to those involved in implementing the static linux SDK feature, without which this task would presumably have been much more involved.


  1. associated PRs here & here ↩︎

10 Likes