-
Notifications
You must be signed in to change notification settings - Fork 153
Building LLVM from Source
Karsten Poeck edited this page May 8, 2022
·
4 revisions
- Alternatively you might get llvm13 from your package manager, e.g.
brewon macos git clone https://github.com/llvm/llvm-project.gitcd llvm-projectgit checkout tags/llvmorg-13.0.0mkdir -p buildcd build- after each line, there should be a ´\´
- edit the
LLVM_BINUTILS_INCDIRcorrectly, or you get afatal error: 'plugin-api.h' file not found - for macosx it might be just
brew install binutils. I didn't had ld.gold installed, so I did following https://llvm.org/docs/GoldPlugin.html
cmake -G "Unix Makefiles" \
$xcode \
-DLLVM_BINUTILS_INCDIR=/usr/local/opt/binutils/include \
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \
-DLINK_POLLY_INTO_TOOLS=ON \
-DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_LIBCXX=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_ENABLE_PROJECTS=clang\;libcxxabi\;libcxx\;lldb\; \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_POLLY=ON \
-DCMAKE_INSTALL_PREFIX=/opt/clasp \
-DLLVM_CREATE_XCODE_TOOLCHAIN=ON \
../llvm- my cmake tells me, the following, so perhaps these 2 variables need something else or are outdated:
CMake Warning:
Manually-specified variables were not used by the project:
LINK_POLLY_INTO_TOOLS
WITH_POLLYcmake --build .cmake --build . --target install