Skip to content

Commit

Permalink
fix: add -fno-sanitize=undefined to every compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
tensorush committed Jul 22, 2024
1 parent 1edcb50 commit a2bb61f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ pub fn build(b: *std.Build) !void {
});
socketfuzz_lib.addCSourceFile(.{
.file = AFLplusplus_utl_path.path(b, "socket_fuzzing/socketfuzz.c"),
.flags = &.{ if (ptr_bit_width == 32) "-m32" else "-m64", "-Wall", "-Wextra" },
.flags = &.{ if (ptr_bit_width == 32) "-m32" else "-m64", "-Wall", "-Wextra", "-fno-sanitize=undefined" },
});
socketfuzz_lib.addIncludePath(AFLplusplus_inc_path);
socketfuzz_lib.linkLibC();
Expand All @@ -511,7 +511,7 @@ pub fn build(b: *std.Build) !void {
});
argvfuzz_lib.addCSourceFile(.{
.file = AFLplusplus_utl_path.path(b, "argv_fuzzing/argvfuzz.c"),
.flags = &.{ if (ptr_bit_width == 32) "-m32" else "-m64", "-Wall", "-Wextra" },
.flags = &.{ if (ptr_bit_width == 32) "-m32" else "-m64", "-Wall", "-Wextra", "-fno-sanitize=undefined" },
});
argvfuzz_lib.addIncludePath(AFLplusplus_inc_path);
argvfuzz_lib.linkLibC();
Expand Down Expand Up @@ -575,6 +575,7 @@ const EXE_FLAGS = .{
"-Wno-pointer-sign",
"-Wno-pointer-arith",
"-Wno-variadic-macros",
"-fno-sanitize=undefined",
"-DDOC_PATH=\"\"",
"-D_AFL_SPECIAL_PERFORMANCE",
};
Expand All @@ -590,6 +591,7 @@ const LLVM_EXE_C_FLAGS = .{
"-Wno-unused-result",
"-Wno-unused-function",
"-Wno-variadic-macros",
"-fno-sanitize=undefined",
"-Wno-deprecated-copy-with-dtor",
"-DUSE_BINDIR=1",
"-DAFL_REAL_LD=\"lld\"",
Expand Down Expand Up @@ -632,5 +634,6 @@ const UTIL_LIB_FLAGS = .{
"-funroll-loops",
"-Wall",
"-Wno-pointer-sign",
"-fno-sanitize=undefined",
"-D_FORTIFY_SOURCE=2",
};

0 comments on commit a2bb61f

Please sign in to comment.