I'm trying to create a XCFramework for a static library that was handed over to us from a vendor (we have C sources and compile it ourselves) that doesn't include Bitcode when checking with otool -l <static_library>.a | grep __LLVM
.
Apparently bitcode is stripped by libtool despite using -fembed-bitcode
CFLAGS and LDFLAGS. xcodebuild -create-xcframework
is failing with the error message:
error: unable to find any architecture information in the binary at '<static_library>.a': Unknown header: 0xb17c0de
0xb17c0de
seems like a shorthand for "bitcode" according to posts I've found.
I understand why this fails on Xcode 13 and prior due to the Bitcode requirement, but I'm trying to use Xcode 14 RC to do the same and get the same error message despite Apple now dropping Bitcode support in Xcode 14.
Is there an option I can give xcodebuild -create-xcframework
to ignore this bitcode requirement and why is it still a requirement in Xcode 14?
Can I add a bitcode marker after compilation to the .a file to satisfy xcodebuild
with some fancy command?
My alternative is to figure out how to get libtool
not to drop the bitcode flags, but that seems like working backwards in time and will take me much longer to figure out given the unfamiliar compile setup (automake, cmake, etc.).