1 Reply
      Latest reply on Feb 10, 2020 9:28 AM by sanvital_IO
      ohernandezIBM Level 1 Level 1 (0 points)

        I am creating a universal dynamic library

         

        # Build the framework for device and for simulator (using

        # all needed architectures).

        xcodebuild -target "${TARGET_NAME}" -configuration Release -arch arm64e -arch arm64 -arch armv7 -arch armv7s only_active_arch=no defines_module=yes -sdk "iphoneos" ENABLE_BITCODE=YES OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE=bitcode CONFIGURATION_BUILD_DIR="${SRCROOT}/build/Release-iphoneos" UseModernBuildSystem=YES SUPPORTS_MACCATALYST=NO OBJROOT="$OBJROOT/DependentBuilds"

        xcodebuild -target "${TARGET_NAME}" -configuration Release -arch x86_64 -arch i386 only_active_arch=no defines_module=yes -sdk "iphonesimulator" ENABLE_BITCODE=YES OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE=bitcode CONFIGURATION_BUILD_DIR="${SRCROOT}/build/Release-iphonesimulator" UseModernBuildSystem=YES SUPPORTS_MACCATALYST=NO OBJROOT="$OBJROOT/DependentBuilds"

         

        # Replace the framework executable within the framework with

        # a new version created by merging the device and simulator

        # frameworks' executables with lipo.

        lipo -create -output "${HOME}/Desktop/${FRAMEWORK_NAME}Dynamic/Release/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" "${SRCROOT}/build/Release-iphoneos/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" "${SRCROOT}/build/Release-iphonesimulator/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"

        lipo -create -output "${SRCROOT}/../../../iOSAutoSrc/LibraryBuilds/DynamicFrameworks/Release/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" "${SRCROOT}/build/Release-iphoneos/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" "${SRCROOT}/build/Release-iphonesimulator/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"

         

        Then using:

         

        otool -arch arm64e -l "${HOME}/Desktop/${FRAMEWORK_NAME}Dynamic/Release/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" | grep  __LLVM

         

        This works for arm64 and armv7s, but not for arm64e. What is missing?

        • Re: How to create arm64e slice with bitcode enabled?
          sanvital_IO Level 1 Level 1 (0 points)

          I just added arm64e support to the framework that I work on, and I have run into the exact same question. My build script expects to find a BCSymbolMap for every UUID in the universal/fat framework executable file. This expectation is no longer true since I added arm64e to the build process. Obviously, this missing BCSymbolMap is appropriate given that the arm64e slice does not include bitcode, so the underlying question is why no bitcode?

           

          I am left to wonder if this missing bitcode is a result of arm64e continuing to be considered a "preview" of the technology. The original announcement of arm64e in the Xcode 10.1 Release Notes calls it a preview and further states that, "The App Store and TestFlight don't accept submissions containing arm64e. Xcode will remove arm64e content from your app when you distribute from the Organizer window." I had presumed that, by now, this caveat would no longer apply. However, I cannot find any mention of there being a final/non-preview version of arm64e support in any of the subsequent Xcode Release Notes. Furthermore, the Preparing Your App to Work with Pointer Authentication continues to exist, and it makes a similar claim.