cheri sample C programs for RISC-V and Morello targets in pure capability (purecap) mode.
Build all the example code with CMake using default settings :
-
Create a separate build directory (<build-dir>) outside the source directory (<source-dir>).
-
Generate the build files using either Unix Makefiles (default) or Ninja (specfied with -G). Currently only the RISC-V and Morello cheri-purecap toolchain files have been created.
- If executing from inside the build directory :
cmake -DCMAKE_TOOLCHAIN_FILE=riscv64-purecap.cmake <relative-path-to-source-dir>
- If executing from outside the build directory :
cmake -B <build-dir> -S <source-dir> -DCMAKE_TOOLCHAIN_FILE=riscv64-purecap.cmake
-
Build all the examples
- If executing from inside the build directory,
make all
ORninja all
- If executing from outside the build directory,
cmake --build <build-dir>
- If executing from inside the build directory,
- -DCMAKE_TOOLCHAIN_FILE: Use
-DCMAKE_TOOLCHAIN_FILE=<toolchain-file>
to select architecture to compile binary for. Only riscv64-purecap.cmake and morello-purecap.cmake are currently supported. - -DSDK: Use
-DSDK=<source-to-sdk>
to point to the CHERI SDK directory. Default paths:- RISC-V: ${HOME}/cheri/output/sdk
- Morello: ${HOME}/cheri/output/morello-sdk
- -G: Choose preferred build system
- Use
-G "Unix Makefiles"
to build using makefiles (default). - Use
-G Ninja
to build using ninja.
- Use