Last active
April 28, 2024 03:05
-
-
Save azk-mochi/7441fd86a58ade6e88e513e8850eb8dd to your computer and use it in GitHub Desktop.
Script to build LLVM+Clang for jailbroken iOS (ARM64)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#LICENSE: retain the following license | |
#BSD 3-Clause "New" or "Revised" License | |
#and this: https://github.com/leetal/ios-cmake/blob/master/LICENSE.md | |
#Tested on LLVM 6.0.0 and Clang 6.0.0 | |
#using XCode 9.1, iOS11.1 SDK | |
#make build directory | |
mkdir llvm-clang-ios | |
cd llvm-clang-ios | |
#download tarball : version is 6.0.0 | |
#LLVM | |
wget "http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz" | |
#Clang | |
wget "http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz" | |
#unpack xz files | |
xz -d "llvm-6.0.0.src.tar.xz" | |
xz -d "cfe-6.0.0.src.tar.xz" | |
#unpack tar archives | |
tar zxf "llvm-6.0.0.src.tar" | |
tar zxf "cfe-6.0.0.src.tar" | |
#rename clang folder and move the folder into llvm/tools | |
mv "cfe-6.0.0.src" "clang" | |
mv "clang" "llvm-6.0.0.src/tools/clang" | |
git clone "https://github.com/leetal/ios-cmake.git" | |
cp "ios-cmake/ios.toolchain.cmake" . | |
cd llvm-6.0.0.src | |
mkdir build | |
cd build | |
cmake ../ \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_OPTIMIZED_TABLEGEN=True \ | |
-DLLVM_ENABLE_PIC=False \ | |
-DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \ | |
-DIOS_PLATFORM=OS \ | |
-DENABLE_ARC=FALSE \ | |
-DENABLE_BITCODE=FALSE \ | |
-DIOS_ARCH=arm64 \ | |
-DCMAKE_INSTALL_PREFIX=/iosdev/llvm-clang6.0.0 \ | |
-DPYTHON_EXECUTABLE=$(which python) \ | |
-DCMAKE_CROSSCOMPILING=True \ | |
-DLLVM_DEFAULT_TARGET_TRIPLE=arm-apple-darwin \ | |
-DLLVM_TARGET_ARCH=ARM | |
unset CC CXX CFLAGS CXXFLAGS LD LDFLAGS CPP CXXCPP RANLIB AR LIBTOOL | |
#make -j8 | |
#make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment