@@ -491,7 +491,13 @@ pub fn build(b: *std.Build) !void {
491
491
});
492
492
socketfuzz_lib .addCSourceFile (.{
493
493
.file = AFLplusplus_utl_path .path (b , "socket_fuzzing/socketfuzz.c" ),
494
- .flags = &.{ if (ptr_bit_width == 32 ) "-m32" else "-m64" , "-Wall" , "-Wextra" , "-fno-sanitize=undefined" },
494
+ .flags = &.{
495
+ if (ptr_bit_width == 32 ) "-m32" else "-m64" ,
496
+ "-Wall" ,
497
+ "-Wextra" ,
498
+ "-fsanitize=undefined" ,
499
+ "-fsanitize-trap=undefined" ,
500
+ },
495
501
});
496
502
socketfuzz_lib .addIncludePath (AFLplusplus_inc_path );
497
503
socketfuzz_lib .linkLibC ();
@@ -511,7 +517,13 @@ pub fn build(b: *std.Build) !void {
511
517
});
512
518
argvfuzz_lib .addCSourceFile (.{
513
519
.file = AFLplusplus_utl_path .path (b , "argv_fuzzing/argvfuzz.c" ),
514
- .flags = &.{ if (ptr_bit_width == 32 ) "-m32" else "-m64" , "-Wall" , "-Wextra" , "-fno-sanitize=undefined" },
520
+ .flags = &.{
521
+ if (ptr_bit_width == 32 ) "-m32" else "-m64" ,
522
+ "-Wall" ,
523
+ "-Wextra" ,
524
+ "-fsanitize=undefined" ,
525
+ "-fsanitize-trap=undefined" ,
526
+ },
515
527
});
516
528
argvfuzz_lib .addIncludePath (AFLplusplus_inc_path );
517
529
argvfuzz_lib .linkLibC ();
@@ -575,7 +587,8 @@ const EXE_FLAGS = .{
575
587
"-Wno-pointer-sign" ,
576
588
"-Wno-pointer-arith" ,
577
589
"-Wno-variadic-macros" ,
578
- "-fno-sanitize=undefined" ,
590
+ "-fsanitize=undefined" ,
591
+ "-fsanitize-trap=undefined" ,
579
592
"-DDOC_PATH=\"\" " ,
580
593
"-D_AFL_SPECIAL_PERFORMANCE" ,
581
594
};
@@ -591,7 +604,8 @@ const LLVM_EXE_C_FLAGS = .{
591
604
"-Wno-unused-result" ,
592
605
"-Wno-unused-function" ,
593
606
"-Wno-variadic-macros" ,
594
- "-fno-sanitize=undefined" ,
607
+ "-fsanitize=undefined" ,
608
+ "-fsanitize-trap=undefined" ,
595
609
"-Wno-deprecated-copy-with-dtor" ,
596
610
"-DUSE_BINDIR=1" ,
597
611
"-DAFL_REAL_LD=\" lld\" " ,
@@ -634,6 +648,7 @@ const UTIL_LIB_FLAGS = .{
634
648
"-funroll-loops" ,
635
649
"-Wall" ,
636
650
"-Wno-pointer-sign" ,
637
- "-fno-sanitize=undefined" ,
651
+ "-fsanitize=undefined" ,
652
+ "-fsanitize-trap=undefined" ,
638
653
"-D_FORTIFY_SOURCE=2" ,
639
654
};
0 commit comments