# Linux PowerPC 32-bit support

**URL:** <https://forums.swift.org/t/linux-powerpc-32-bit-support/56276>\
**Category:** Compiler\
**Tags:** linux\
**Created:** [March 27, 2022, 11:09pm UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276 "2022-03-27T23:09:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ColemanCDA](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/colemancda/32/2454_2.png) [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Post date:** [March 27, 2022, 11:09pm UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/1 "2022-03-27T23:09:38Z")

</div>

I have been working on patches for compiling Swift 5.6 for PPC32 with Buildroot. First I compiled the patched compiler (swift, llvm-project and swift-core-tools-support) and then use Buildroot with patched compiler to cross compile the Swift Stdlib. I have gotten to the point where I can successfully compile libdispatch, the Swift StdLib and runtime's .c, .cpp and .swift files for PPC32, but the demo executable crashes with qemu.

> <https://github.com/apple/swift/issues/58206>
>
> | | |
> |------------------|-----------------|…
> |Previous ID | SR-15945 |
> |Radar | None |
> |Original Reporter | @colemancda |
> |Type | New Feature |
> 
> 
> Attachment: \[Download\](https://user-images.githubusercontent.com/2727770/164964475-e7ed9d87-7dde-466f-a623-d329b5d6ec9a.gz)
> 
>       
> \<details\>
> \<summary\>Additional Detail from JIRA\</summary\>
> 
> | | |
> |------------------|-----------------|
> |Votes | 0 |
> |Component/s | Compiler |
> |Labels | New Feature |
> |Assignee | None |
> |Priority | Medium |
> 
>    
> 
> md5: 5741c004b901bbdfd704755eb25f68fd
> 
> \</details\>
> 
> 
> 
> 
> 
> \*\*Issue Description:\*\*
> 
> 
> Swift should support compiling to ppc and ppcle.

> <https://gist.github.com/colemancda/6bc88cb7fb1f0a5c7853eb578c634461>

> <https://gist.github.com/colemancda/5bbd8ffd1e96330d8042704b89be60be>

> <https://gist.github.com/colemancda/8ba15edde6d3d2ff52367f69922f8457>

> <https://gist.github.com/colemancda/885b0e170acdf4c8ddf8afec586e3bdc>

> <https://gist.github.com/colemancda/6c1ccbb314f99ee1a614418be631e55a>

> <https://gist.github.com/colemancda/874768239d45023a16acc3585097af92>

---

<div class="post-metadata">

**Author:** ![benrimmington](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/benrimmington/32/695_2.png) [@benrimmington](https://forums.swift.org/u/benrimmington)\
**Post date:** [March 28, 2022, 12:29am UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/2 "2022-03-28T00:29:19Z")

</div>

I have a question about your [standard library changes](https://github.com/apple/swift/pull/41656) for PowerPC 32-bit, which were merged into the main branch a few weeks ago. There are files such as [SmallString.swift](https://github.com/apple/swift/blob/main/stdlib/public/core/SmallString.swift) and [StringObject.swift](https://github.com/apple/swift/blob/main/stdlib/public/core/StringObject.swift) which haven't been updated to include `arch(powerpc)`. Is this an intentional omission?

* * *

The language needs better conditional compilation for pointer size. For example, in Swift 5.6:

```swift
// warning: unknown architecture for build configuration 'arch'
#if arch(i386) || arch(arm) || arch(powerpc)
// ^

// note: did you mean 'powerpc64'?
#if arch(i386) || arch(arm) || arch(powerpc)
// ^ ~~~~~~
// powerpc64

```

(Also, the `_endian(big)` and `_endian(little)` conditions are still private.)

---

<div class="post-metadata">

**Author:** ![ColemanCDA](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/colemancda/32/2454_2.png) [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Post date:** [March 28, 2022, 12:36am UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/3 "2022-03-28T00:36:05Z")

</div>

@benrimmington That PR is based on `main` and is missing some additional changes needed.

> <https://gist.github.com/colemancda/6bc88cb7fb1f0a5c7853eb578c634461/revisions>

I'll open a new PR with those changes, and update for the String internals.

Note: I am not even able to run a Pure C hello world compiled with SwiftPM, so not sure why event that is crashing. I tried calling clang manually to build a main.c file specifying the triple, and that also crashes.

---

<div class="post-metadata">

**Author:** ![ColemanCDA](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/colemancda/32/2454_2.png) [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Post date:** [March 28, 2022, 12:48am UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/4 "2022-03-28T00:48:05Z")

</div>

@benrimmington TBH, there is no immediate need to patch SmallString, that change is purely an optimization and there has been no testing done to suggest it improves performance on PPC32, although it's very likely it helps. My goal is to get a working compiler and runtime.

---

<div class="post-metadata">

**Author:** ![ColemanCDA](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/colemancda/32/2454_2.png) [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Post date:** [March 28, 2022, 1:05am UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/5 "2022-03-28T01:05:37Z")

</div>

> <https://github.com/apple/swift/pull/42054>
>
> Add fixes PowerPC 32-bit support:
> \- Add \`\_\_multi3\` shim
> \- Specify PPC32 as big… endian (e.g. \`#if \_endian(big)\`)
> 
> 
> Resolves \[SR-15945\](https://bugs.swift.org/browse/SR-15945)
> 
> \<!--
> Before merging this pull request, you must run the Swift continuous integration tests.
> For information about triggering CI builds via @swift-ci, see:
> https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci
> 
> Thank you for your contribution to Swift!
> \--\>

---

<div class="post-metadata">

**Author:** ![ColemanCDA](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/colemancda/32/2454_2.png) [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Post date:** [June 23, 2026, 11:58pm UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/6 "2026-06-23T23:58:09Z")

</div>

> <https://github.com/llvm/llvm-project/pull/205457>
>
> Adds Swift calling-convention (swiftcc/swifttailcc) support to the 32-bit PowerP…C SVR4/EABI target. Without it, clang aborts with "Swift ABI info has not been initialized" because the 32-bit PowerPC target registered no SwiftABIInfo, which prevents Swift (e.g. Embedded Swift) from targeting 32-bit PowerPC platforms such as the Nintendo Wii/GameCube (PPC750).
> 
> Mirrors the existing X86-32, ARM, AArch64 and 64-bit PowerPC handling.

---

<div class="post-metadata">

**Author:** ![ColemanCDA](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/colemancda/32/2454_2.png) [@ColemanCDA](https://forums.swift.org/u/ColemanCDA)\
**Post date:** [July 10, 2026, 1:38pm UTC](https://forums.swift.org/t/linux-powerpc-32-bit-support/56276/7 "2026-07-10T13:38:10Z")

</div>

PowerPC Swift Buildroot External updated for 6.3.3 [Release 0.4.0 · MillerTechnologyPeru/buildroot-swift · GitHub](https://github.com/MillerTechnologyPeru/buildroot-swift/releases/tag/0.4.0)
