From 1d39b9c8343dd5393a4f31533cf5391af1bf6702 Mon Sep 17 00:00:00 2001 From: "liang.he" Date: Tue, 29 Apr 2025 10:05:02 +0800 Subject: [PATCH] bypass vptr santizier (#4231) LLVM, by default, disables the use of C++'s built-in Run-Time Type Information. This decision is primarily driven by concerns about code size and efficiency. But '-fsanitize=vptr' not allowed with '-fno-rtti'. --- tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt b/tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt index 8bb860788..60c6d92f2 100644 --- a/tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt +++ b/tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt @@ -90,8 +90,10 @@ add_compile_options(-Wno-unused-command-line-argument) # Enable fuzzer add_definitions(-DWASM_ENABLE_FUZZ_TEST=1) -add_compile_options(-fsanitize=fuzzer) -add_link_options(-fsanitize=fuzzer) +# '-fsanitize=vptr' not allowed with '-fno-rtti +# But, LLVM by default, disables the use of `rtti` in the compiler +add_compile_options(-fsanitize=fuzzer -fno-sanitize=vptr) +add_link_options(-fsanitize=fuzzer -fno-sanitize=vptr) # Enable sanitizers if not in oss-fuzz environment set(CFLAGS_ENV $ENV{CFLAGS})