Skip to content

Commit 54b0e73

Browse files
authored
wasm-mutator-fuzz: Use another variable to check if in oss-fuzz environment (bytecodealliance#3518)
In order to pass a oss-fuzz build step *check_build*. Previous `HELPER` is only for local test.
1 parent 028f43b commit 54b0e73

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ add_compile_options(-fsanitize=fuzzer)
120120
add_link_options(-fsanitize=fuzzer)
121121

122122
# if not calling from oss-fuzz helper, enable all support sanitizers
123-
# oss-fuzz always defines `HELPER=True`
124-
if (NOT "$ENV{HELPER}" STREQUAL "True")
123+
# oss-fuzz will define FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION in CFLAGS and CXXFLAGS
124+
set(CFLAGS_ENV $ENV{CFLAGS})
125+
string(FIND "${CFLAGS_ENV}" "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" IN_OSS_FUZZ)
126+
if (IN_OSS_FUZZ EQUAL -1)
127+
message("[ceith]:Enable ASan and UBSan in non-oss-fuzz environment")
125128
add_compile_options(
126129
-fsanitize=signed-integer-overflow
127130
-fprofile-instr-generate -fcoverage-mapping

0 commit comments

Comments
 (0)