File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -295,16 +295,26 @@ where
295
295
296
296
// add some flags to sanitizers to make them work with Rust code
297
297
let asan_options = env:: var ( "ASAN_OPTIONS" ) . unwrap_or_default ( ) ;
298
- let asan_options = format ! ( "detect_odr_violation=0:abort_on_error=1:symbolize=0:{}" , asan_options) ;
298
+ let asan_options = format ! (
299
+ "detect_odr_violation=0:abort_on_error=1:symbolize=0:{}" ,
300
+ asan_options
301
+ ) ;
299
302
300
303
let tsan_options = env:: var ( "TSAN_OPTIONS" ) . unwrap_or_default ( ) ;
301
304
let tsan_options = format ! ( "report_signal_unsafe=0:{}" , tsan_options) ;
302
305
306
+ let passes = if rustc_version:: version ( ) . unwrap ( ) . minor >= 57 {
307
+ // New LLVM pass manager introduced in Rust 1.57
308
+ "sancov-module"
309
+ } else {
310
+ "sancov"
311
+ } ;
312
+
303
313
let mut rustflags = format ! (
304
314
"--cfg fuzzing \
305
315
-C debug-assertions \
306
316
-C overflow_checks \
307
- -C passes=sancov \
317
+ -C passes={} \
308
318
-C llvm-args=-sanitizer-coverage-level=3 \
309
319
-C llvm-args=-sanitizer-coverage-trace-pc-guard \
310
320
-C llvm-args=-sanitizer-coverage-prune-blocks=0 \
@@ -313,6 +323,7 @@ where
313
323
-C debuginfo=0 \
314
324
-l afl-llvm-rt \
315
325
-L {} ",
326
+ passes,
316
327
common:: afl_llvm_rt_dir( ) . display( )
317
328
) ;
318
329
@@ -323,14 +334,15 @@ where
323
334
"--cfg fuzzing \
324
335
-C debug-assertions \
325
336
-C overflow_checks \
326
- -C passes=sancov \
337
+ -C passes={} \
327
338
-C llvm-args=-sanitizer-coverage-level=3 \
328
339
-C llvm-args=-sanitizer-coverage-trace-pc-guard \
329
340
-C llvm-args=-sanitizer-coverage-prune-blocks=0 \
330
341
-C opt-level=3 \
331
342
-C target-cpu=native \
332
343
-C debuginfo=0 \
333
344
-L {} ",
345
+ passes,
334
346
common:: afl_llvm_rt_dir( ) . display( )
335
347
) ;
336
348
You can’t perform that action at this time.
0 commit comments