llvm clang源码编译安装
安装依赖
sudo apt install gcc-multilib
下载源码
git clone --branch llvmorg-13.0.0 --recursive https://github.com/llvm/llvm-project
编译安装
cd llvm-project
cmake -S llvm -B build_release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/llvm -G "Ninja" -DLLVM_USE_LINKER="gold" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb" -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt;libcxx;libcxxabi;libunwind"
cd build_release
ninja
sudo ninja install
check version
clang --version