-
Notifications
You must be signed in to change notification settings - Fork 438
Build LLVM and Clang from source code
Yulei Sui edited this page Mar 16, 2022
·
9 revisions
Build LLVM and Clang (if you have already done both, just skip it and jump to build SVF)
1. Download LLVM-13.0.0, clang-13.0.0
2. Unzip the LLVM and Clang source files
tar xf llvm-13.0.0.src.tar.xz
tar xf clang-13.0.0.src.tar.xz
mv clang-13.0.0.src llvm-13.0.0.src/tools/clang
3. Create your target build folder and make
mkdir llvm-13.0.0.obj
cd llvm-13.0.0.obj
cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../llvm-13.0.0.src (or add "-DCMAKE_BUILD_TYPE:STRING=Debug" for debug version)
make -j8
4. Add paths for LLVM and Clang
export LLVM_SRC=your_path_to_llvm-10.0.0.src
export LLVM_OBJ=your_path_to_llvm-10.0.0.obj
export LLVM_DIR=your_path_to_llvm-10.0.0.obj
export PATH=$LLVM_DIR/bin:$PATH
5. Build SVF