<div dir="ltr">Hello all!<br><br>I&#39;ve been stumped by a compiler assertion I&#39;m hitting in <a href="https://github.com/apple/swift-corelibs-xctest/pull/43">https://github.com/apple/swift-corelibs-xctest/pull/43</a>, and was wondering if anyone could offer some insight.<br><br>The pull request has swift-corelibs-xctest depend upon swift-corelibs-foundation (I&#39;ll refer to these as XCTest and Foundation in this email).<br><br>On Linux, this works like a dream. All it takes is linking Foundation when building XCTest:<br><br><div>$ swiftc -emit-library path/to/XCTest.o \<br>    -L path/to/Foundation \<br>    -lswiftGlibc -lswiftCore -lFoundation -lm<br><br>On OS X, I use an Xcode workspace that includes XCTest.xcodeproj and Foundation.xcodeproj. In the &quot;Link Binary with Libraries&quot; step, I link SwiftFoundation.framework. However, when compiling the project I encounter the following stack trace: <a href="https://gist.github.com/modocache/ad562405d19aa4ad6194">https://gist.github.com/modocache/ad562405d19aa4ad6194</a><br><br>The problem appears to be in swift::ModuleFile::resolveCrossReference, where an assertion is hit: &quot;error deserializing an individual record&quot;. Looking at the resolveCrossReference method, it appears error() is called when a BitstreamCursor encounters an entry that is not a kind of lvm::BitstreamEntry::Record. I guess there&#39;s some sort of malformed bitcode getting generated somewhere?<br><br>This is about as far as I&#39;ve gotten. I seem to recall a conversation in <a href="https://github.com/apple/swift-corelibs-xctest/commit/6a1e7836e91940be94856bfda245deb125a66729#commitcomment-16253578">https://github.com/apple/swift-corelibs-xctest/commit/6a1e7836e91940be94856bfda245deb125a66729#commitcomment-16253578</a>, in which people commented that Foundation is always built in Debug mode. Could that be causing this?<br><br>Any advice would be much appreciated!</div><div><br></div><div>- Brian Gesiak</div></div>