Soliciting community help in maintaining Power/LE support in Swift


(Atul Sowani) #1


I have completed adding preliminary support for Power8/LE (ppc64le) support in Swift v4.2 compiler. Jenkins build node for Power has also been added, along with required configurations.

There are a few tasks which are still pending. For example, master branch is still not building on Power. Though most of the test cases included in the built-in test-suite pass, there are few cases which are failing on Power and need some analysis.

The effort involved is a bit heavy to handle for me alone. Hence I solicit help from community in sustaining Power support in Swift.

It is now easily possible to obtain resources required for development like Power VMs and Jenkins CI setup for Power using the resources available on the Internet.

If you are interested in joining me in this effort, please let me or @seth-priya know and we can provide you further details.


(Atul Sowani) #2

Still optimistic and still hanging on hoping I would get some help! :slight_smile:


Any insights on the above errors?

(John McCall) #6

Hi, Sarvesh. I’m sorry you haven’t gotten any responses, but I suspect there’s just not a lot of interest in ppc64 these days.

The sort of problem you’re stuck at is endemic to compiler development, I’m afraid. Ports aren’t always easy. You have to approach debugging with a very open and patient mind and be willing to trace backwards laboriously from the place where things blew up to to the place where things first started looking wrong.

Here there’s a crash. Why specifically is it crashing? Does the code there seem wrong, or is it working on invalid data, like a bad pointer? If so, where did the invalid pointer come from? Where did that come from? And so on until you find code that’s clearly something that doesn’t look right. And if that’s generated code, you have to figure out why the code was generated like that, tracing back through N levels of IR until you find something that looks right that’s being turned into something that looks wrong.

At most of those stages, you’ll be knee-deep in unfamiliar code, trying to understand a ton of things at once. We can try to help some, but without sitting over your shoulder, there’s only so much we can do on the minimal amount of information here.


On closer investigation, realised that the string implemetation has changed in Swift 4.2 from that in Swift 4.1 to a large extent.
The crash involves changes in String.swift besides the newly introduced StringGuts.swift and StringObject.swift files.

In the StringGuts.swift file there are comments such as "// FIXME: what about ppc64 and s390x?" indicating that the support for PowerPC(ppc64) might still be incomplete.

Can we confirm that the new string implementation in Swift 4.2 has complete support for PowerPC(ppc64)?

(John McCall) #8

ppc64 is not a core target for anyone working on Swift. If someone wants to step up to implement and maintain the port, we'd welcome that, but it is not going to spontaneously happen, and there's really no point in just periodically asking if it has.


Built and verified Swift 5.0 master on PowerPC(powerpc64le). I was able to run all the samples given in which confirms that 'swiftc'(Swift compiler), REPL environment and LLDB debugger are working correctly. Also package manager seems to work fine. Built a sample package using the ported Swift 5.0 binaries.