Same issue here after updating to Xcode 13.3:
error: backend command failed due to signal 6 (use -v to see invocation)
LLVM ERROR: out of memory
Allocation failed
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /Applications/Xcode-13.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /var/folders/7q/ywjd0rsx6zd7vqsy2pgsn_1h0000gp/T/TemporaryDirectory.Vhfg03/CardStackComponents-1.bc -embed-bitcode -target arm64-apple-ios12.2 -Xllvm -aarch64-use-tbi -Osize -disable-llvm-optzns -module-name CardStackComponents -o buck-out/gen/Libraries/uCardStackComponents/CardStackComponents#apple-swift-compile,iphoneos-arm64/CardStackComponents.o
1. Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
2. Compiling with the current language version
3. Running pass 'Function Pass Manager' on module '/var/folders/7q/ywjd0rsx6zd7vqsy2pgsn_1h0000gp/T/TemporaryDirectory.Vhfg03/CardStackComponents-1.bc'.
4. Running pass 'ObjC ARC contraction' on function '@UI_USER_INTERFACE_IDIOM'
For curiosity, the error doesn't happen if I build with -Onone instead of -Osize. This is not a workaround, obviously. I want to build my releases with optimization.
Post
Replies
Boosts
Views
Activity
I had this issue and found the solution. It's not about Xcode 12.5, but running on a device with iOS 14.5+.
My project was embedding 2 static frameworks (see @idelfonso answer) and the issue was fixed when I changed them to [Do Not Embed].
However, the correct answer here is not to [Do Not Embed] every framework you have, as you actually need to embed dynamic frameworks, your app will crash upon launch otherwise.
Use 'file' command line to find out if the framework is dynamic or static. For example:
bash
file Frameworks/Flutter.framework/Flutter
Frameworks/Flutter.framework/Flutter: Mach-O universal binary with 3 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm_v7] [arm64]
Frameworks/Flutter.framework/Flutter (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
Frameworks/Flutter.framework/Flutter (for architecture armv7): Mach-O dynamically linked shared library arm_v7
Frameworks/Flutter.framework/Flutter (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
As you can see, in this example Flutter is dynamically linked and therefore needs to be embedded. If 'file' doesn't give any hint that a framework is dynamic, then it's static and should not be embedded.
Embedding static frameworks is wrong because their code is already merged into the final binary. For some reason it was "ok" to do that before iOS 14.5.
Hope this helps.