gpt4 book ai didi

ios - 标记位码(-fembed-bitcode-marker)的意义是什么?

转载 作者:行者123 更新时间:2023-12-03 21:45:28 24 4
gpt4 key购买 nike

这在 Apple 开发中经常出现——当使用 bitcode 提交到应用商店时,你当然必须包含完整的 bitcode (-fembed-bitcode)。但是有这种中间“标记”模式的原因是什么,它包括部分而不是位码本身?这一定是有原因的,为什么它经常被打开用于调试版本。

最佳答案

重点是在开发过程中使您的构建更快。
来源:您可以阅读提交的代码审查,添加 embed-bitcode标记到 clang 编译器前端以获取更多详细信息:

  • Introduce -fembed-bitcode driver option

    This is the clang driver part of the change to embedded bitcode. Thisincludes:

    1. -fembed-bitcode option which breaks down the compilation into twostages. The first stage emits optimized bitcode and the second stagecompiles bitcode into object file.

    2. -fembed-bitcode-marker option which doesn't really break down to twostages to speedup the compilation flow.

    3. pass the correct linker flag to darwin linker if tool chains supportsembedded bitcode.


  • Embed bitcode in object file (clang cc1 part)

    marker only mode is used to speed up the compilation while stillproducing enough information in the final output to check if all thefiles are containing a bitcode section.-fembed-bitcode option will split the compilation into two stages and itadds measurable costs to compile time due to the extra process launch,the serialization and the verifier.-fembed-bitcode-marker is just a way to avoid that costs but still markthe section for the sanity check later (done by linker in our case).



  • 上下文:
    Guardsquare blog article讨论启用位码的构建。相关说明如下:

    What does Apple do with the embedded bitcode?

    The question remains: why does Apple offer the option to embedbitcode? The answer is straightforward. With the bitcode embedded inthe executable, Apple is able to recompile applications withoutinteracting with the developer. This has a lot of advantages.

    1. Apple is continuously enhancing the optimization performed by theClang compiler to further improve the performance of mobileapplications and reduce their size. Using the embedded bitcode, Appleitself can recompile applications using the latest, improved versionof the compiler. This frees app developers from the burden ofcontinuously having to update their development environment andrecompile and reupload their applications to benefit from the latestimprovements.

    2. By embedding the bitcode, developers enable Apple to migrate theirapplications to new types of devices. The embedded bitcode enablesApple to recompile existing applications and make them compatiblewith the chipsets of new devices.


    如果您只是调试和/或测试您的应用程序,您将不会执行上述任何操作。那么,当您真的只想确保一切都正确构建和运行时,为什么要浪费时间和资源来实际包括位码呢? embed-bitcode-marker因此启用标志是为了在开发过程中伪造构建过程的这一部分。

    关于ios - 标记位码(-fembed-bitcode-marker)的意义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64768561/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com