56
56
run : cd libafl_bolts && cargo test --no-default-features
57
57
- name : Test libafl_targets no_std
58
58
run : cd libafl_targets && cargo test --no-default-features
59
-
59
+
60
+ llvm-tester :
61
+ runs-on : ubuntu-22.04
62
+ continue-on-error : true
63
+ strategy :
64
+ matrix :
65
+ llvm-version : ["11", "12", "13", "14", "16", "17"]
66
+ steps :
67
+ - name : Remove Dotnet & Haskell
68
+ run : rm -rf /usr/share/dotnet && rm -rf /opt/ghc
69
+ - uses : actions-rs/toolchain@v1
70
+ with :
71
+ profile : minimal
72
+ toolchain : stable
73
+ - uses : actions/checkout@v3
74
+ - uses : Swatinem/rust-cache@v2
75
+ - name : Install LLVM and Clang
76
+ uses : KyleMayes/install-llvm-action@v1
77
+ with :
78
+ version : " ${{matrix.llvm-version}}"
79
+ - name : Build and test with llvm-${{ matrix.llvm-version }}
80
+ run : pwd && ls & cd libafl_cc && cargo build --release
81
+
82
+
60
83
ubuntu :
61
84
runs-on : ubuntu-22.04
62
85
steps :
@@ -67,20 +90,20 @@ jobs:
67
90
profile : minimal
68
91
toolchain : stable
69
92
- name : Remove existing clang and LLVM
70
- run : sudo apt purge llvm* clang*
93
+ run : sudo apt purge llvm* clang* lld* lldb* opt*
71
94
- name : Install and cache deps
72
-
73
- with :
74
- packages : llvm-15 llvm-15-dev clang-15 ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
75
- - name : get clang version
76
- run : command -v llvm-config-15 && clang-15 -v
95
+ run : sudo apt install ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
77
96
- name : Add nightly rustfmt and clippy
78
97
run : rustup toolchain install nightly --component rustfmt --component clippy --component miri --allow-downgrade
79
98
- name : Install ucd-generate
80
99
run : cargo install -f ucd-generate
81
100
- uses : actions/checkout@v3
82
101
- uses : Swatinem/rust-cache@v2
83
-
102
+ - name : Install LLVM and Clang
103
+ uses : KyleMayes/install-llvm-action@v1
104
+ with :
105
+ directory : ${{ runner.temp }}/llvm
106
+ version : 16
84
107
# ---- format check ----
85
108
# pcguard edges and pcguard hitcounts are not compatible and we need to build them seperately
86
109
- name : Check pcguard edges
@@ -118,16 +141,18 @@ jobs:
118
141
with :
119
142
profile : minimal
120
143
toolchain : stable
144
+
121
145
- name : Install and cache deps
122
-
123
- with :
124
- packages : llvm-15 clang-15 llvm-15-dev ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
125
- - name : get clang version
126
- run : command -v llvm-config-15 && clang-15 -v
146
+ run : sudo apt install ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
127
147
- name : Add nightly rustfmt and clippy
128
148
run : rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly
129
149
- uses : actions/checkout@v3
130
150
- uses : Swatinem/rust-cache@v2
151
+ - name : Install LLVM and Clang
152
+ uses : KyleMayes/install-llvm-action@v1
153
+ with :
154
+ directory : ${{ runner.temp }}/llvm
155
+ version : 16
131
156
- name : Run clippy
132
157
run : ./scripts/clippy.sh
133
158
@@ -153,11 +178,7 @@ jobs:
153
178
- name : Remove existing clang and LLVM
154
179
run : sudo apt purge llvm* clang*
155
180
- name : Install and cache deps
156
-
157
- with :
158
- packages : llvm-15 llvm-15-dev clang-15 ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
159
- - name : get clang version
160
- run : command -v llvm-config-15 && clang-15 -v
181
+ run : sudo apt install ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
161
182
- name : Install cargo-hack
162
183
run : curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
163
184
- name : Install ucd-generate
@@ -166,14 +187,18 @@ jobs:
166
187
run : rustup toolchain install nightly --allow-downgrade
167
188
- uses : actions/checkout@v3
168
189
- uses : Swatinem/rust-cache@v2
169
-
190
+ - name : Install LLVM and Clang
191
+ uses : KyleMayes/install-llvm-action@v1
192
+ with :
193
+ directory : ${{ runner.temp }}/llvm
194
+ version : 16
170
195
# ---- build and feature check ----
171
196
# cargo-hack's --feature-powerset would be nice here but libafl has a too many knobs
172
197
- name : Check each feature
173
198
# Skipping `python` as it has to be built with the `maturin` tool
174
199
# `agpl`, `nautilus` require nightly
175
- # `sancov_pcguard_edges` is tested seperately
176
- run : LLVM_CONFIG=llvm-config-15 cargo hack check --workspace --each-feature --clean-per-run --exclude-features=prelude,agpl,nautilus,python,sancov_pcguard_edges,arm,aarch64,i386,be,systemmode,whole_archive --no-dev-deps --exclude libafl_libfuzzer
200
+ # `sancov_pcguard_edges` is tested seperatelyc
201
+ run : LLVM_CONFIG=llvm-config cargo hack check --workspace --each-feature --clean-per-run --exclude-features=prelude,agpl,nautilus,python,sancov_pcguard_edges,arm,aarch64,i386,be,systemmode,whole_archive --no-dev-deps --exclude libafl_libfuzzer
177
202
- name : Check nightly features
178
203
run : cargo +nightly check --features=agpl && cargo +nightly check --features=nautilus
179
204
@@ -200,14 +225,19 @@ jobs:
200
225
toolchain : stable
201
226
- name : Remove existing clang and LLVM
202
227
run : sudo apt purge llvm* clang*
228
+ - name : Install LLVM and Clang
229
+ uses : KyleMayes/install-llvm-action@v1
230
+ with :
231
+ directory : ${{ runner.temp }}/llvm
232
+ version : 16
203
233
- name : Install deps
204
- run : sudo apt-get install -y llvm-15 llvm-15-dev clang-15 ninja-build python3-dev python3-pip python3-venv libz3-dev
234
+ run : sudo apt-get install -y ninja-build python3-dev python3-pip python3-venv libz3-dev
205
235
- name : Install maturin
206
236
run : python3 -m pip install maturin
207
237
- uses : actions/checkout@v3
208
238
- uses : Swatinem/rust-cache@v2
209
239
- name : Run a maturin build
210
- run : export LLVM_CONFIG=llvm-config-15 && cd ./bindings/pylibafl && python3 -m venv .env && . .env/bin/activate && pip install --upgrade --force-reinstall . && ./test.sh
240
+ run : export LLVM_CONFIG=llvm-config-16 && cd ./bindings/pylibafl && python3 -m venv .env && . .env/bin/activate && pip install --upgrade --force-reinstall . && ./test.sh
211
241
- name : Run python test
212
242
run : . ./bindings/pylibafl/.env/bin/activate && cd ./fuzzers/baby_fuzzer && python3 baby_fuzzer.py 2>&1 | grep "Bye"
213
243
@@ -246,13 +276,13 @@ jobs:
246
276
run : cargo install -f ucd-generate
247
277
- name : Remove obsolete llvm (Linux)
248
278
run : sudo apt purge llvm* clang*
249
- - uses : lyricwulf/abc@v1
250
- with :
251
- linux : llvm-15 llvm-15-dev clang-15 nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev
252
- - name : Set clang version
253
- run : sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
254
- - name : Set clang++ version
255
- run : sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang ++-15 100
279
+ - name : Install LLVM and Clang
280
+ uses : KyleMayes/install-llvm-action@v1
281
+ with :
282
+ directory : ${{ runner.temp }}/llvm
283
+ version : 16
284
+ - name : Install deps
285
+ run : sudo apt install nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g ++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev
256
286
- name : pip install
257
287
run : python3 -m pip install msgpack jinja2 find_libpython
258
288
# Note that nproc needs to have coreutils installed on macOS, so the order of CI commands matters.
@@ -281,7 +311,7 @@ jobs:
281
311
run : sudo ln -s /usr/include/asm-generic /usr/include/asm
282
312
- name : Build and run example fuzzers (Linux)
283
313
if : runner.os == 'Linux'
284
- run : RUN_ON_CI=1 LLVM_CONFIG=llvm-config-15 ./scripts/test_all_fuzzers.sh
314
+ run : RUN_ON_CI=1 LLVM_CONFIG=llvm-config ./scripts/test_all_fuzzers.sh
285
315
286
316
qemu_fuzzers :
287
317
strategy :
@@ -320,17 +350,13 @@ jobs:
320
350
- name : Remove obsolete llvm (Linux)
321
351
if : runner.os == 'Linux'
322
352
run : sudo apt purge llvm* clang*
323
- - uses : lyricwulf/abc@v1
324
- with :
325
- linux : llvm-15 llvm-15-dev clang-15 nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev
326
- # update bash for macos to support `declare -A` command`
327
- macos : llvm@15 libpng nasm coreutils z3 bash wget
328
- - name : Set clang version
329
- if : runner.os == 'Linux'
330
- run : sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
331
- - name : Set clang++ version
332
- if : runner.os == 'Linux'
333
- run : sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100
353
+ - name : Install LLVM and Clang
354
+ uses : KyleMayes/install-llvm-action@v1
355
+ with :
356
+ directory : ${{ runner.temp }}/llvm
357
+ version : 16
358
+ - name : Install deps
359
+ run : sudo apt install nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev
334
360
- name : pip install
335
361
run : python3 -m pip install msgpack jinja2 find_libpython
336
362
# Note that nproc needs to have coreutils installed on macOS, so the order of CI commands matters.
@@ -359,7 +385,7 @@ jobs:
359
385
run : sudo ln -s /usr/include/asm-generic /usr/include/asm
360
386
- name : Build and run example fuzzers (Linux)
361
387
if : runner.os == 'Linux'
362
- run : RUN_ON_CI=1 RUN_QEMU_FUZZER=1 LLVM_CONFIG=llvm-config-15 ./scripts/test_all_fuzzers.sh
388
+ run : RUN_ON_CI=1 RUN_QEMU_FUZZER=1 LLVM_CONFIG=llvm-config ./scripts/test_all_fuzzers.sh
363
389
364
390
365
391
nostd-build :
0 commit comments