# Failed to build toolchain due to architecture error

**URL:** <https://forums.swift.org/t/failed-to-build-toolchain-due-to-architecture-error/80862>\
**Category:** Compiler\
**Tags:** toolchain, swift\
**Created:** [July 2, 2025, 3:35pm UTC](https://forums.swift.org/t/failed-to-build-toolchain-due-to-architecture-error/80862 "2025-07-02T15:35:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Max\_Desiatov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/max_desiatov/32/20654_2.png) [@Max\_Desiatov](https://forums.swift.org/u/Max_Desiatov)\
**Post date:** [July 4, 2025, 3:10pm UTC](https://forums.swift.org/t/failed-to-build-toolchain-due-to-architecture-error/80862/3 "2025-07-04T15:10:18Z")

</div>

Downgrading CMake won't help, this issue is not specific to a CMake version. Although I do agree that using CMake version built with the toolchain is more reliable, as I did see issues with CMake 4.x before, but it didn't cause this exact issue.

This was previously discussed in this thread: [Unable to build toolchain due to thin libzstd.dylib](https://forums.swift.org/t/unable-to-build-toolchain-due-to-thin-libzstd-dylib/67043)

There are two options here:

1. `brew uninstall zstd`, which means `build-script` will no longer pick up zstd build from Homebrew, which doesn't have universal binaries supplied that are required for universal toolchain binaries produced by `build-toolchain`.
2. Or don't use `build-toolchain` script at all and use `build-script` instead to produce the toolchain, which I personally recommend. Decide which preset you're going to use with `build-script` and ensure that this preset doesn't have `infer-cross-compile-hosts-on-darwin` setting passed, which will also make you build take only half as long, because it won't have to cross-compile anymore for Intel on Apple Silicon or vice versa.

---

_[View the full topic](https://forums.swift.org/t/failed-to-build-toolchain-due-to-architecture-error/80862)._
