Getting Started
Develop
To build FORMOSA LLVM, you have to ensure you have successfully install nix package manger on your machine and follow these steps:
-
Enter the development shell
-
configure
Note: If you don't havecmake -G Ninja -S llvm -B build \ -DLLVM_ENABLE_PROJECTS="clang;lld;libclc" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER="gcc" \ -DCMAKE_CXX_COMPILER="g++" \ -DLLVM_DEFAULT_TARGET_TRIPLE=riscv64-unknown-elf \ -DLLVM_TARGETS_TO_BUILD="RISCV;X86" \ -DLLVM_USE_LINKER=lld \ -DLIBCLC_TARGETS_TO_BUILD="riscv64-unknown-elf" \ -DLLVM_BUILD_LLVM_DYLIB=ON
lld
, you could install with: Usinglld
is strongly suggested to save your time and memory. -
build
Note: If your memory is not enough for parallel linking, consider adding-DLLVM_PARALLEL_LINK_JOBS=2
to restrict the jobs for linking.