-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (154 loc) · 5.35 KB
/
ci.yml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: CI
on:
push:
branches:
- main
- github-actions*
pull_request:
jobs:
test-on-pkru-enabled-host:
runs-on: self-hosted
continue-on-error: ${{ matrix.ia2-tracer == 'ON' }}
strategy:
fail-fast: true
matrix:
build-type: [Release, Debug]
c_compiler: [clang, gcc]
linker: [lld, bfd]
ia2-debug: [ON, OFF]
ia2-tracer: [ON, OFF]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build
run: |
LLVM_DIR=`llvm-config --cmakedir`
Clang_DIR=`realpath $LLVM_DIR/../clang`
mkdir build
pushd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS="-fuse-ld=${{ matrix.linker }}" \
-DClang_DIR=$Clang_DIR \
-DLLVM_DIR=$LLVM_DIR \
-DLLVM_EXTERNAL_LIT=$HOME/.local/bin/lit \
-DLIBIA2_DEBUG=${{ matrix.ia2-debug }} \
-DIA2_TRACER=${{ matrix.ia2-tracer }} \
-G Ninja
ninja
popd
- name: Check
run: |
pushd build
ninja -v check
popd
build-nginx:
runs-on: self-hosted
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build nginx
run: |
LLVM_DIR=`llvm-config --cmakedir`
Clang_DIR=`realpath $LLVM_DIR/../clang`
pushd external/nginx
IA2_CMAKE_FLAGS="
-DCMAKE_BUILD_TYPE=Release
-DClang_DIR=$Clang_DIR
-DLLVM_DIR=$LLVM_DIR" \
./reconfigure
pushd build/nginx
make
popd
popd
aarch64-wip-test:
runs-on: ubuntu-latest
steps:
- name: Install dep packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: |
gcc-aarch64-linux-gnu
g++-aarch64-linux-gnu
libc6-arm64-cross
libc6-dev-arm64-cross
clang-15
pkg-config
cmake
ninja-build
llvm-15-dev
libclang-15-dev
zlib1g-dev
libcapstone-dev
version: 1.0 # version of cache to load
- name: Check out code
uses: actions/checkout@v4
- name: Cache built QEMU
id: cache-qemu
uses: actions/cache@v4
with:
path: qemu/build
key: ${{ runner.os }}-qemu
- name: Check out QEMU
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: immunant/qemu
path: ${{ github.workspace }}/qemu
- name: Build QEMU
if: steps.cache-qemu.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/qemu
run: ./build.sh
- name: Cache built Clang
id: cache-clang
uses: actions/cache@v4
with:
path: |
llvm-project/build/bin
llvm-project/build/lib/clang
key: ${{ runner.os }}-clang
- name: Check out Clang
if: steps.cache-clang.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: immunant/llvm-project
ref: am/mte_instrumentation
path: ${{ github.workspace }}/llvm-project
- name: Build Clang
if: steps.cache-clang.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/llvm-project
run: |
# first free up space used by unnecessary host tool cache to make room to build clang
df -h /
cd /opt
find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache \
'!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
df -h /
cd -
./build.sh
# free up space used by libs; our desired clang binary statically links them
rm -rf build/lib/*.a
- name: Test ARM build
run: |
LLVM_DIR=`llvm-config-15 --cmakedir`
Clang_DIR=`realpath $LLVM_DIR/../clang`
mkdir build
pushd build
cross_flags="-isystem /usr/aarch64-linux-gnu/include --gcc-toolchain=/usr -march=armv8+memtag"
export LDFLAGS="-L/usr/aarch64-linux-gnu/lib"
cmake .. \
-DCMAKE_CROSSCOMPILING_EMULATOR=${{ github.workspace }}/qemu/build/qemu-aarch64 \
-DCMAKE_TOOLCHAIN_FILE=../cmake/aarch64-toolchain.cmake \
-DCMAKE_C_COMPILER=`pwd`/../llvm-project/build/bin/clang-19 \
-DCMAKE_CXX_COMPILER=`pwd`/../llvm-project/build/bin/clang-19 \
-DCMAKE_OBJCOPY=/usr/bin/llvm-objcopy-15 \
-DCMAKE_C_FLAGS="$cross_flags" \
-DCMAKE_CXX_FLAGS="$cross_flags" \
-DClang_DIR=$Clang_DIR \
-DCLANG_EXE=`which clang-15` \
-DLLVM_DIR=$LLVM_DIR \
-G Ninja
ninja -v check
popd