Skip to content

Precompiled binaries + libraries for iOS

Compare
Choose a tag to compare
@holzschu holzschu released this 19 Apr 10:50
· 23941 commits to master since this release

For easier portability: this release contains the content of "build_ios/bin" and "build_ios/lib/*.dylib" after the bootstrap.sh script.

In theory, it should be enough for brave developers to run LLVM and the associated tools inside OpenTerm or other applications. I would recommend the latest version of my OpenTerm fork: https://github.com/holzschu/terminal

To compile projects, use:

  • on your Mac: clang -S -emit-llvm -arch arm64 -target arm64-apple-darwin17.5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk <other flags as needed> <filename>.c

  • on your iOS device: clang -S -emit-llvm -Wno-nullability-completeness -I <path to headers> <filename>.c
    (you will need to transfer C and C++ headers to your iOS device. Where you place them is up to you).

In both cases, this creates a ".ll" file in LLVM intermediate representation, which you can then run using lli: lli <filename>.ll You can link together multiple ".ll" files using llvm-link -only-needed -o <resultname>.

If you have an existing command that was compiled using "-fembed-bitcode", you can extract the LLVM bitcode from the binary using bitcode retriever: https://github.com/AlexDenisov/bitcode_retriever
This produces a ".bc" file for each source file that was in the original app. You can link them with "llvm-link" and run lli with the result.

"llvm-dis" converts between binary bitcode representation (.bc) and text-based bitcode (.ll). It is included.

"nm" displays the list of symbols in a dynamic library (often, a lot of them).