-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmake_command
37 lines (34 loc) · 1.37 KB
/
cmake_command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
git clone https://github.com/riscv-collab/riscv-gcc.git
cd riscv-gnu-toolchain
mkdir build
cd build
../configure --prefix=/home/sole/opt/riscv/gcc --with-arch=rv64gcv
make linux
# down load llvm ZIP to get the newest LLVM from github
cd llvm-project-main
mkdir build-host
CC=gcc CXX=g++ cmake ../llvm -DLLVM_ENABLE_PROJECTS='clang' -G Ninja -DCMAKE_BUILD_TYPE=Debug
ninja llvm-tblgen clang-tblgen
cd ..
mkdir build-riscv
cd build-riscv
cmake ../llvm -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DLLVM_HOST_TRIPLE=riscv64-unknown-linux-gnu \
-DCMAKE_CROSSCOMPILING=True \
-DCMAKE_SYSTEM_NAME=Linux \
-DLLVM_DEFAULT_TARGET_TRIPLE=riscv64-unknown-linux-gnu \
-DCMAKE_TOOLCHAIN_FILE=/home/sole/work/qemu_rvv/llvm-project-main/ToolchainExample.cmake \
-DLLVM_TARGET_ARCH=riscv64 \
-DLLVM_TARGETS_TO_BUILD=RISCV \
-DLLVM_ENABLE_PROJECTS='clang;lld' \
-DLLVM_OCAML_INSTALL_PATH=/home/sole/work/qemu_rvv/opt/llvm-0/ocaml-llvm \
-DCMAKE_INSTALL_PREFIX=/home/sole/work/qemu_rvv/opt/llvm-0/llvm \
-DLLVM_TABLEGEN=/home/sole/work/qemu_rvv/llvm-project-main/build-host/bin/llvm-tblgen \
-DCLANG_TABLEGEN=/home/sole/work/qemu_rvv/llvm-project-main/build-host/bin/clang-tblgen \
-DLLVM_BUILD_LLVM_DYLIB=On \
-DLLVM_LINK_LLVM_DYLIB=On \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=On \
-DHAVE_STEADY_CLOCK=0 \
-DHAVE_PTHREAD_AFFINITY=0 \
-DHAVE_POSIX_REGEX=0
ninja