Xcode fails to copy standard swift library when linking certain frameworks

Number:rdar://27191710 Date Originated:
Status:Open Resolved:
Product:Developer Tools Product Version:8S162m
Classification: Reproducible:Always
When a project uses swift, Xcode 8 beta 2 (8S162m) fails to copy the standard swift library when linking against specific frameworks.
More specifically, the "Copy Swift standard libraries" build step fails with the following error:
"Found an unexpected Mach-O header code: 0x72613c21"

Removing the offending frameworks from the link phase gets the build through.
So far, I've only seen the Crashlytics/Fabric frameworks to be causing this.
Building a pure objective c project does not trigger the problem.
Xcode 7.3.1 (7D1014) is not affected by this problem either.

It's worth noting that these 2 frameworks are actually static libs packaged as in a framework bundle.

Steps to Reproduce:
1. Open attached MachoHeader project
2. Attempt to build and run
3. Open attached MachoHeaderNoSwift project
4. Attempt to build and run

Expected Results:
Both project build and run

Actual Results:
MachoHeader fails to build with error "Found an unexpected Mach-O header code: 0x72613c21"
MachoHeaderNoSwift builds and runs successfully

Xcode 8S162m
OSX 10.11.5 (15F34)

I've attached 2 projects to this bug report, both projects are the canned "single view" Xcode templates to which I've simply added the aforementioned frameworks.

MachoHeader.zip is a pure swift project exhibits the issue.
MachoHeaderNoSwift.zip is a pure objc project and is not affected.


'SampleProjects.zip' was successfully uploaded.


Fixed in Version 8.0 beta 3 (8S174q)

I downloaded Xcode 8.0 beta 3 and tested with an app that was failing with this exact problem and it is now resolved for me.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!