-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (44 loc) · 1.43 KB
/
Makefile
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
CC=gcc
WAT2WASM=../wabt-1.0.19-ubuntu/wabt-1.0.19/bin/wat2wasm
LUCETC=../lucet-spectre-repro/target/release/lucetc
BINDINGS=../safeside/build-lucet/bindings.json
LUCETC_ARGS= --guard-size 4GiB --min-reserved-size 4GiB --max-reserved-size 4GiB
stock/%:
loadlfence/%: LUCETC_ARGS += --spectre-mitigation=loadlfence
strawman/%: LUCETC_ARGS += --spectre-mitigation=strawman
sfi_full/%: LUCETC_ARGS += --spectre-mitigation=sfi
sfi_aslr/%: LUCETC_ARGS += --spectre-mitigation=sfiaslr
cet_full/%: LUCETC_ARGS += --spectre-mitigation=cet
cet_aslr/%: LUCETC_ARGS += --spectre-mitigation=cetaslr
SONAMES=btb_leakage.so btb_breakout.so
.PHONY: all
all: $(addprefix stock/, $(SONAMES)) \
$(addprefix loadlfence/, $(SONAMES)) \
$(addprefix strawman/, $(SONAMES)) \
$(addprefix sfi_full/, $(SONAMES)) \
$(addprefix sfi_aslr/, $(SONAMES)) \
$(addprefix cet_full/, $(SONAMES)) \
$(addprefix cet_aslr/, $(SONAMES)) \
copycode.so
.PRECIOUS:%.wasm
%.wasm: %.wat
$(WAT2WASM) $< -o $@
%/btb_leakage.so: btb_leakage.wasm
mkdir -p $(dir $@)
$(LUCETC) --bindings $(BINDINGS) $(LUCETC_ARGS) --pinned-heap-reg $< -o $@
%/btb_breakout.so: btb_breakout.wasm
mkdir -p $(dir $@)
$(LUCETC) --bindings $(BINDINGS) $(LUCETC_ARGS) $< -o $@
copycode.so: copycode.c
$(CC) -fPIC -shared $< -o $@
.PHONY: clean
clean:
-rm *.wasm
-rm *.so
-rm -rf stock
-rm -rf loadlfence
-rm -rf strawman
-rm -rf sfi_full
-rm -rf sfi_aslr
-rm -rf cet_full
-rm -rf cet_aslr