I need to create a bundle with embedded bitcode, for that purpose I’ve all the dependencies compiled with embedded bitcode* and I was expecting that generating the final build would be a matter of adding the proper -Xlinker -bitcode_bundle and/or -fembed-bitcode to clang, but the final build does not have any bitcode in it.
This is the command I’m using (removing many paths to simplify):
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -O0 -filelist … -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker …Runner.swiftmodule -fembed-bitcode -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker …Runner_dependency_info.dat -o …/Products/Debug-iphoneos/Runner.app/Runner -Wl,-bitcode_bundle -Xlinker -bitcode_bundle
But Runner.app/Runner does not contain any bitcode, what would be the proper way to embedded bitcode?
*Running otool -l on the *.o files show the __LLVM segments in it, also failing to add the bitcode in the dependencies triggers the error <...> does not contain bitcode. You must rebuild it with bitcode enabled so the bitcode must be there.




