interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / argus / lane_e.mk

44 lines · 1907 bytes Raw Blame History
1# Lane E: ARGUS-0 hard-invariant detectors.
2#
3# make -f lane_e.mk test-detect build and run the detector tests, plain
4# and under UBSan (+ bounds)
5# make -f lane_e.mk test-detect-asan the same under -fsanitize=address,undefined
6# make -f lane_e.mk clean-detect
7#
8# test-detect does not include ASan because the ASan runtime hangs during its
9# own start-up on macOS 26.6 (even for an empty main, with Apple clang 17 and
10# Homebrew clang 20). Run test-detect-asan on Linux or a fixed macOS.
11# Plain GNU make (macOS make 3.81 + clang, Linux gcc/clang).
12
13CC ?= cc
14CFLAGS ?= -std=gnu11 -O2 -Wall -Wextra -Werror -fstack-protector-strong
15UBSANFLAGS = -fsanitize=undefined,bounds -fno-sanitize-recover=all -fno-omit-frame-pointer -g
16ASANFLAGS = -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -g
17OUT ?= out
18
19DETECT_SRC = argus_detect.c tests/stub_state.c tests/test_argus_detect.c
20DETECT_HDR = argus_abi.h argus_detect.h tests/stub_state.h ../capability/aienos_capability.h
21
22$(OUT)/test_argus_detect: $(DETECT_SRC) $(DETECT_HDR)
23 mkdir -p $(OUT)
24 $(CC) $(CFLAGS) -o $@ $(DETECT_SRC)
25
26$(OUT)/test_argus_detect_ubsan: $(DETECT_SRC) $(DETECT_HDR)
27 mkdir -p $(OUT)
28 $(CC) $(CFLAGS) $(UBSANFLAGS) -o $@ $(DETECT_SRC)
29
30$(OUT)/test_argus_detect_asan: $(DETECT_SRC) $(DETECT_HDR)
31 mkdir -p $(OUT)
32 $(CC) $(CFLAGS) $(ASANFLAGS) -o $@ $(DETECT_SRC)
33
34test-detect: $(OUT)/test_argus_detect $(OUT)/test_argus_detect_ubsan
35 $(OUT)/test_argus_detect
36 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 $(OUT)/test_argus_detect_ubsan
37
38test-detect-asan: $(OUT)/test_argus_detect_asan
39 ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 $(OUT)/test_argus_detect_asan
40
41clean-detect:
42 rm -f $(OUT)/test_argus_detect $(OUT)/test_argus_detect_ubsan $(OUT)/test_argus_detect_asan
43
44.PHONY: test-detect test-detect-asan clean-detect