目录
笔记:编译基于llvm8.0的Xcode混淆器toolchain

以下是本人学习编译ollvm时的笔记,由于本人水平有限,不足之处还请大家多多指正。

cd /Users/Name/Documents/workspace/llvm/xcodetoolchain

cmake -G Unix\ Makefiles -DLLVM_CREATE_XCODE_TOOLCHAIN=On ../llvm

sudo make install-xcode-toolchain

参考:

https://github.com/obfuscator-llvm/obfuscator/issues/130

From Xcode9 onwards you can just do make install-xcode-toolchain and none of the Plugin hassle

Xcode9及以上用Xcode toolchain

https://stackoverflow.com/questions/23071024/how-do-i-make-xcode-use-an-alternative-version-of-clang

Its an old question, but since I wanted to install more recent clang/libc++ to use with Xcode 9+, here is my solution in hope it would be useful for someone.

  1. If you are building from source, make sure to pass -DLLVM_CREATE_XCODE_TOOLCHAIN=ON to cmake, afterwards run make install-xcode-toolchain. If you install with homebrew, use the brew install --with-toolchain llvm
  2. Copy the toolchain folder from wherewher its installed (/usr/local/Toolchains probably) to /Library/Developer/Toolchains
  3. Restart Xcode, you will see a Toolchains option in the Xcode menu.

以上是构建xcode toolchain的方法

cmake -G “Unix Makefiles” -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_APPEND_VC_REV=on -DLLVM_CREATE_XCODE_TOOLCHAIN=on -DCMAKE_INSTALL_PREFIX=~/Library/Developer/ ../llvm && make && make install-xcode-toolchain

https://github.com/HikariObfuscator/Hikari/wiki/Compile-&-Install

参考 Hikari的 build xcode toolchain 的方法

llvm8.0生成的xcode toolchain 只支持iOS9及以上

更新:上面一行错了,支持iOS8,需要rsync一下,命令如下:

rsync -a –ignore-existing /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ ~/Library/Developer/Toolchains/LLVM8.0.0svn.xctoolchain/

rm ~/Library/Developer/Toolchains/LLVM8.0.0svn.xctoolchain/ToolchainInfo.plist

参考:https://github.com/HikariObfuscator/Hikari/wiki/Compile-&-Install

另一种替换Clang为可以混淆的版本的方法是:

The easiest option (also the easiest to reverse) is to add the CC build flag. Go to your project’s or target’s build settings, and choose Editor –> Add Build Setting –> Add User-Defined Setting from the menu.

xcode连接真机运行时,报错cannot specify -o when generating multiple output files,解决方法:Build Setting 中搜索 Index-While-Building 设置为 NO 可编译成功

https://www.jianshu.com/p/398f844c45f3

文章作者: Evi1024
文章链接: https://www.evi1024.com/2019/12/23/%E7%AC%94%E8%AE%B0%EF%BC%9A%E7%BC%96%E8%AF%91%E5%9F%BA%E4%BA%8Ellvm8-0%E7%9A%84Xcode%E6%B7%B7%E6%B7%86%E5%99%A8toolchain/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Evi1024

评论