Skip to content

Commit 7fe2d3b

Browse files
committed
optimize how to involve sanitizer flags
1 parent f1e34d3 commit 7fe2d3b

3 files changed

Lines changed: 17 additions & 19 deletions

File tree

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

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,23 @@ set(IWASM_DIR ${REPO_ROOT_DIR}/core/iwasm)
172172
# Global setting
173173
add_compile_options(-Wno-unused-command-line-argument)
174174

175-
# Enable fuzzer
176-
add_definitions(-DWASM_ENABLE_FUZZ_TEST=1)
177-
# '-fsanitize=vptr' not allowed with '-fno-rtti
178-
# But, LLVM by default, disables the use of `rtti` in the compiler
179-
add_compile_options(-fsanitize=fuzzer -fno-sanitize=vptr)
180-
add_link_options(-fsanitize=fuzzer -fno-sanitize=vptr)
181-
182-
# Enable sanitizers if not in oss-fuzz environment
183-
set(CFLAGS_ENV $ENV{CFLAGS})
184-
string(FIND "${CFLAGS_ENV}" "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" FUZZ_POS)
185-
if (FUZZ_POS GREATER -1)
186-
set(IN_OSS_FUZZ 1)
187-
else()
188-
set(IN_OSS_FUZZ 0)
189-
endif()
175+
# # Enable fuzzer
176+
# add_definitions(-DWASM_ENABLE_FUZZ_TEST=1)
177+
# # '-fsanitize=vptr' not allowed with '-fno-rtti
178+
# # But, LLVM by default, disables the use of `rtti` in the compiler
179+
# add_compile_options(-fsanitize=fuzzer -fno-sanitize=vptr)
180+
# add_link_options(-fsanitize=fuzzer -fno-sanitize=vptr)
181+
182+
# # Enable sanitizers if not in oss-fuzz environment
183+
# set(CFLAGS_ENV $ENV{CFLAGS})
184+
# string(FIND "${CFLAGS_ENV}" "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" FUZZ_POS)
185+
# if (FUZZ_POS GREATER -1)
186+
# set(IN_OSS_FUZZ 1)
187+
# else()
188+
# set(IN_OSS_FUZZ 0)
189+
# endif()
190+
191+
# include(${CMAKE_CURRENT_LIST_DIR}/../sanitizer_flags.cmake)
190192

191193
add_subdirectory(aot-compiler)
192194
add_subdirectory(wasm-mutator)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ target_link_libraries(aotclib PUBLIC ${REQUIRED_LLVM_LIBS})
6969

7070
add_executable(aot_compiler_fuzz aot_compiler_fuzz.cc)
7171
target_link_libraries(aot_compiler_fuzz PRIVATE stdc++ aotclib)
72-
73-
include(${CMAKE_CURRENT_LIST_DIR}/../sanitizer_flags.cmake)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,3 @@ target_link_libraries(vmlib PUBLIC ${REQUIRED_LLVM_LIBS})
5959

6060
add_executable(wasm_mutator_fuzz wasm_mutator_fuzz.cc)
6161
target_link_libraries(wasm_mutator_fuzz PRIVATE vmlib m)
62-
63-
include(${CMAKE_CURRENT_LIST_DIR}/../sanitizer_flags.cmake)

0 commit comments

Comments
 (0)