This repository has been archived by the owner on Nov 27, 2021. It is now read-only.
forked from ctshepherd/cpc-qemu-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_host.sh
executable file
·109 lines (85 loc) · 2 KB
/
build_host.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/sh -e
# Use DONTCLEAN=1 ./build_host.sh to avoid rebuilding everything
ROOTDIR="$(pwd)"
CONFIGOPTS="--disable-werror --target-list=x86_64-softmmu"
CILOPTS="--save-temps --noMakeStaticGlobal --useLogicalOperators \
--useCaseRange"
GCCOPTS="-U__SSE2__ -Wno-unused-variable -Wno-redundant-decls \
-Wno-deprecated-declarations -Dcoroutine_fn='__attribute__((cps))' -w"
COROOPTS="--load=$ROOTDIR/corocheck/_build/corocheck.cma \
--doCoroCheck --coopAttr=cps --blockAttr=nocps"
CILBIN="$ROOTDIR/cil/bin/cilly"
CPCBIN="$ROOTDIR/cpc/bin/cpc"
# Make CIL
cd cil
if [ -z "$DONTCLEAN" ]; then
git clean -fdx
fi
git checkout develop
git pull
./configure
make
cd ..
# Make CoroCheck
cd corocheck
if [ -z "$DONTCLEAN" ]; then
git clean -fdx
fi
git checkout master
git pull
# Force clean: fast to build, make sure its consistent with latest CIL
make clean all OCAMLPATH=$ROOTDIR/cil/lib
cd ..
# Make CPC
cd cpc
if [ -z "$DONTCLEAN" ]; then
git clean -fdx
fi
git checkout develop
git pull
./configure
make
cd ..
# Prepare QEMU
cd qemu
if [ -z "$DONTCLEAN" ]; then
git clean -fdx
fi
mkdir -p bin/gcc-ucontext
mkdir -p bin/cil-ucontext
mkdir -p bin/cpc-ucontext
mkdir -p bin/cpc-cpc
# Build gcc-ucontext QEMU
# We want to use the same code for all four binaries
git checkout convert-block-part2
git pull
cd bin/gcc-ucontext
../../configure $CONFIGOPTS \
--with-coroutine=ucontext \
--extra-cflags="$GCCOPTS"
make -j8
cd ../..
# Build cil-ucontext QEMU (with CoroCheck)
cd bin/cil-ucontext
../../configure $CONFIGOPTS \
--with-coroutine=ucontext \
--cc="$CILBIN" \
--extra-cflags="$GCCOPTS $CILOPTS $COROOPTS"
make -j8
cd ../..
# Build cpc-ucontext QEMU
cd bin/cpc-ucontext
../../configure $CONFIGOPTS \
--with-coroutine=ucontext \
--cc="$CPCBIN" \
--extra-cflags="--dontcpc $GCCOPTS $CILOPTS"
make -j8
cd ../..
# Build CPC QEMU
cd bin/cpc-cpc
../../configure $CONFIGOPTS \
--with-coroutine=cpc \
--cc="$CPCBIN" \
--extra-cflags="$GCCOPTS $CILOPTS"
make -j8
cd ../..