Bitcode linker errors in Release

What do I need to do in order to build a Release version of my App for Apple TV with Bitcode fully enabled? I can build and deploy my game to the Apple TV device fine in Debug but when I try to build in Release I get the following error that's related to a static library that I also build and try to link in:


ld: bitcode bundle could not be generated because '/Development/DSCore/build/Release-appletvos/libDSCore_AppleTV.a(Matrix_Struct.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64

I've set ENABLE_BITCODE on the static library and on my project that's linking to it. I've read somewhere that I might need to use

-fembed-bitcode
somewhere but I don't know where.



I meet this same issue too. It is OK in debug version. The link error is very similar to you. I do not know how to solve it. I think it is a bug of XCode 7 (7.0.1 or 7.1).

I was able to fix this by adding "-fembed-bitcode" to Other C Flags of the project I am building a static lib of. It will give you a warning because a normal build adds "-fembed-bitcode-marker" but -fembed-bitcode takes precedence over the dummy marker. Apparently -fembed-bitcode does not get added usually unless building for archive or installation, but I don't know how to get a .a lib out of that, i'd rather just build.

Bitcode linker errors in Release
 
 
Q