Skip to content

Commit

Permalink
docs: Move CMake build instructions out of README
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrtonm committed Mar 6, 2024
1 parent a3f3624 commit f397325
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 36 deletions.
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,7 @@
# IA2 Phase 2
# Intent-capturing Annotations for Isolation and Assurance (IA<sup>2</sup> Phase 2)

This repo provides tools for compartmentalizing an application and its dependencies using Intel's memory protection keys (MPK) for userspace. The repo includes a tool that rewrites headers to create call gate wrappers as well as the runtime to initialize the protection keys for trusted compartments.

## Setup

Ubuntu 20.04 is used for testing. Other Linux distributions may or may not work. Adjust the commands below accordingly.

### Install the package prerequisites.

```
sudo apt install -y libusb-1.0-0-dev libclang-dev llvm-dev \
ninja-build zlib1g-dev python3-pip cmake \
libavformat-dev libavutil-dev pcregrep patchelf
pip install lit
rustup install nightly
```

### Configure with CMake

*Note*: Adjust paths to your version of Clang/LLVM

```
mkdir build && pushd build
cmake .. \
-DClang_DIR=/usr/lib/cmake/clang-12 \
-DLLVM_DIR=/usr/lib/llvm-12/cmake \
-DLLVM_EXTERNAL_LIT=`which lit` \
-G Ninja
```

### Build and run the tests

*Note*: Pass `-v` to ninja to see build commands and output from failing tests.

```
ninja check-ia2
```

## Usage

### Defining compartments
Expand Down
34 changes: 34 additions & 0 deletions docs/build_instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Setup

Ubuntu 20.04 is used for testing. Other Linux distributions may or may not work. Adjust the commands below accordingly.

## Install the package prerequisites.

```
sudo apt install -y libusb-1.0-0-dev libclang-dev llvm-dev \
ninja-build zlib1g-dev python3-pip cmake \
libavformat-dev libavutil-dev pcregrep patchelf
pip install lit
rustup install nightly
```

## Configure with CMake

*Note*: Adjust paths to your version of Clang/LLVM

```
mkdir build && pushd build
cmake .. \
-DClang_DIR=/usr/lib/cmake/clang-12 \
-DLLVM_DIR=/usr/lib/llvm-12/cmake \
-DLLVM_EXTERNAL_LIT=`which lit` \
-G Ninja
```

## Build and run the tests

*Note*: Pass `-v` to ninja to see build commands and output from failing tests.

```
ninja check-ia2
```

0 comments on commit f397325

Please sign in to comment.