On building an universal binary on Xcode 12.3, why are the dynamic libraries under Example.app/Contents/Frameworks directory buillt for x86_64 archirecture only and not for arm64?

I build my application as an universal binary, for both arm64 and x86_64 architectures. The app is linked to frameworks like CoreFoundation and CoreData.

However on building the app using Xcode 12.3, the dynamic libraries under my app directory Example.app/Contents/Frameworks are built for x86_64 architecture only, and not for arm64.

On going through the build logs, I see that these libraries are copied from the location

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/macosx/libswiftCoreData.dylib

All the libraries under this ndirectory are for x86_64 architecture only.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/macosx/libswiftCoreData.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Does anyone know the reason for this? Is it fine to discard these libraries or build them for arm64 too?

PS - The application does not seem to use these libraries, as my app runs on arm64 architecture without any hassle.

Swift ABI got stable in 10.14.4, this means that those libraries are now bundled with macOS. Probably you set the deployment target to a version older than 10.14.4, so Xcode bundles the Swift libraries, but only for Intel because the first macOS version for arm was 11, and it already includes those libraries.

On building an universal binary on Xcode 12.3, why are the dynamic libraries under Example.app/Contents/Frameworks directory buillt for x86_64 archirecture only and not for arm64?
 
 
Q