diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27f9ddd6..490d4c05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,6 +35,7 @@ jobs: - name: Extract seL4CP SDK run: unzip sel4cp-sdk.zip && tar -xf sel4cp-sdk-1.2.6.tar.gz - name: Install VMM dependencies (via apt) + # 'expect' is only a dependency for CI testing run: sudo apt update && sudo apt install -y make clang lld qemu-system-arm device-tree-compiler expect - name: Build and run VMM examples run: ./ci/examples.sh ${PWD}/sel4cp-sdk-1.2.6 @@ -58,9 +59,10 @@ jobs: - name: Extract seL4CP SDK run: unzip sel4cp-sdk.zip && tar -xf sel4cp-sdk-1.2.6.tar.gz - name: Install VMM dependencies (via Homebrew) + # 'expect' is only a dependency for CI testing run: | - brew tap messense/macos-cross-toolchains - brew install aarch64-unknown-linux-gnu qemu dtc make expect + brew install llvm qemu dtc make expect + echo "/usr/local/opt/llvm/bin:$PATH" >> $GITHUB_PATH - name: Build and run VMM examples run: ./ci/examples.sh ${PWD}/sel4cp-sdk-1.2.6 shell: bash diff --git a/ci/examples.sh b/ci/examples.sh index f79ee372..fa79eeb9 100755 --- a/ci/examples.sh +++ b/ci/examples.sh @@ -7,24 +7,30 @@ SDK_PATH=$1 [[ -z $SDK_PATH ]] && echo "usage: examples.sh [PATH TO SDK]" && exit 1 [[ ! -d $SDK_PATH ]] && echo "The path to SDK provided does not exist: '$SDK_PATH'" && exit 1 -build_simple() { +build_simple_make() { BOARD=$1 CONFIG=$2 - BUILD_DIR="build_simple_${CONFIG}_${BOARD}" - make -C examples/simple -B BUILD_DIR=${BUILD_DIR} CONFIG=${CONFIG} BOARD=${BOARD} SEL4CP_SDK=${SDK_PATH} + BUILD_DIR="${PWD}/build/simple/make/${BOARD}/${CONFIG}" + mkdir -p ${BUILD_DIR} + make -C examples/simple -B \ + BUILD_DIR=${BUILD_DIR} \ + CONFIG=${CONFIG} \ + BOARD=${BOARD} \ + SEL4CP_SDK=${SDK_PATH} \ + -j$(nproc) } -simulate_simple() { +simulate_simple_make() { BOARD=$1 CONFIG=$2 - BUILD_DIR="build_simple_${CONFIG}_${BOARD}" - ./ci/buildroot_login.exp examples/simple/${BUILD_DIR}/loader.img + BUILD_DIR="${PWD}/build/simple/make/${BOARD}/${CONFIG}" + ./ci/buildroot_login.exp ${BUILD_DIR}/loader.img } -build_simple "qemu_arm_virt_hyp" "debug" -simulate_simple "qemu_arm_virt_hyp" "debug" -build_simple "qemu_arm_virt_hyp" "release" -simulate_simple "qemu_arm_virt_hyp" "release" +build_simple_make "qemu_arm_virt_hyp" "debug" +simulate_simple_make "qemu_arm_virt_hyp" "debug" +build_simple_make "qemu_arm_virt_hyp" "release" +simulate_simple_make "qemu_arm_virt_hyp" "release" -build_simple "odroidc4_hyp" "debug" -build_simple "odroidc4_hyp" "release" +build_simple_make "odroidc4_hyp" "debug" +build_simple_make "odroidc4_hyp" "release" diff --git a/examples/simple/Makefile b/examples/simple/Makefile index b15bfbf5..820b0bc0 100644 --- a/examples/simple/Makefile +++ b/examples/simple/Makefile @@ -85,11 +85,14 @@ endif # FIXME: We should also consider whether -mgeneral-regs-only should be # used to avoid the use of the FPU and therefore seL4 does not have to # context switch the FPU. +# Note we only need -Wno-unused-command-line-argument because in Nix +# passes an extra `--gcc-toolchain` flag which we do not need. CFLAGS := -mstrict-align \ -g3 \ -O3 \ -ffreestanding \ -nostdlib \ + -Wno-unused-command-line-argument \ -Wall -Wno-unused-function -Werror \ -I$(VMM_SRC_DIR)/arch/aarch64 -I$(VMM_SRC_DIR) -I$(VMM_SRC_DIR)/util -I$(BOARD_DIR)/include \ -DBOARD_$(BOARD) \