美文网首页
Bitcode编译

Bitcode编译

作者: 偶是星爷 | 来源:发表于2017-04-25 11:06 被阅读111次

    检查.a是否包含bitcode方法

    otool -l xxx.a | grep __bitcode | wc -l #输出大于0表示已支持
    

    Xcode开启bitcode方法简单,不多叙述。通常要支持的多是第三方库,且多半是clang编译。核心思想就一个:在CFLAGS后面加上-fembed-bitcode

    otool 和 nm 有一样的问题,默认不是真机架构。需要自己加上 -arch arm64

    • fdk-aac

    解压源代码,运行config_fdk_aac_ios.sh。出现以下错误

    libtool: Version mismatch error. This is libtool 2.4.6, revision 2.4.6,libtool: but the definition of this LT_INIT comes from revision 1.3337.libtool: You should recreate aclocal.m4 with macros from revision 2.4.6libtool: of libtool 2.4.6 and run autoconf again.make: *** [libAACdec/src/aacdec_drc.lo] Error 63

    对于这中makefile编译错误,最快速的解决办法是直接修改文本文件。
    再目录中搜索2.4.2,找到文件ltversion.m4。替换为2.4.6
    ltversion.m4
    然后再按照提示 autoconf 一次。
    只有这几种架构才支持 ARCHS="arm64 armv7s x86_64 i386 armv7"

    • stand alone .a project

    独立的.a工程,打开Enable Bitcode没有什么卵用,还是需要在“Other C Link Flags”上加上-fembed-bitcode。

    • xcodebuild

    命令行加上ENABLE_BITCODE=YES,等同于工程里打开Enable Bitcode

    相关文章

      网友评论

          本文标题:Bitcode编译

          本文链接:https://www.haomeiwen.com/subject/ayamzttx.html