-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sh
executable file
·62 lines (52 loc) · 2.14 KB
/
build.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# This scripts checkout seL4 and wasmedge, and create an seL4 example app for running WebAssembly in seL4.
# If you see error like "undefined reference `__getauxval`", your aarch64-linux-gcc's version is 10 or greater.
# You can add this line to `projects/musllibc/src/misc/getauxval.c`
# ```
# weak_alias(getauxval, __getauxval);
# ```
set -xuo pipefail
# Install dependency
# See https://docs.sel4.systems/projects/buildsystem/host-dependencies.html
sudo apt update && sudo apt install -y \
cmake ccache ninja-build cmake-curses-gui \
python3-dev python3-pip \
libxml2-utils ncurses-dev \
curl git doxygen device-tree-compiler \
u-boot-tools \
protobuf-compiler python-protobuf \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
qemu-system-aarch64 libc6-dev-arm64-cross \
haskell-stack bc cpio
pip3 install --user setuptools sel4-deps camkes-deps simpleeval
# Create root directory
mkdir -pv sel4_wasmedge
cd sel4_wasmedge
# Setup project files
git clone --branch v1.13.11 https://gerrit.googlesource.com/git-repo .repo/repo
if [ -n "${GITHUB_ACTIONS:-}" ]; then
git branch "$GITHUB_REF_NAME"
.repo/repo/repo init -b "$GITHUB_REF_NAME" -m "$MANIFEST" -u ..
else
.repo/repo/repo init -b main -u https://github.com/second-state/wasmedge-seL4.git
fi
# Update and checkout files
.repo/repo/repo sync
# Apply patches
patch -p1 -d projects/camkes-tool < .repo/manifests/patches/01-camkes-tool.patch
patch -p1 -d projects/llvm < .repo/manifests/patches/02-llvm.patch
patch -p1 -d projects/seL4_libs < .repo/manifests/patches/03-seL4_libs.patch
patch -p1 -d projects/seL4_projects_libs < .repo/manifests/patches/04-seL4_projects_libs.patch
patch -p1 -d projects/vm-examples < .repo/manifests/patches/05-vm-examples.patch
patch -p1 -d projects/vm-linux < .repo/manifests/patches/06-vm-linux.patch
patch -p1 -d projects/wasmedge < .repo/manifests/patches/07-wasmedge.patch
# Copy wasm examples
cp .repo/manifests/wasm-examples/*.wasm projects/vm-examples/apps/Arm/wasmedge/overlay_files/
# Configure seL4
mkdir -p build
cd build
../init-build.sh -DCAMKES_VM_APP=wasmedge -DPLATFORM=qemu-arm-virt
# Build image
ninja
ninja