Skip to content

Commit 19949b7

Browse files
committed
remove vptr sanitize because it's not included in future features
If `vptr` is enabled, the following errors are raised during build steps because the vptr sanitizer requires RTTI, but RTTI is disabled (by default). ``` [397/398] Linking C executable src/suggest/groonga-suggest-create-dataset FAILED: src/suggest/groonga-suggest-create-dataset : && /usr/bin/clang -fsanitize=undefined -fno-sanitize=alignment -g src/suggest/CMakeFiles/groonga-suggest-create-dataset.dir/groonga_suggest_create_dataset.c.o -o src/suggest/groonga-suggest-create-dataset -Wl,-rpath,/groonga.ubsan/lib:/groonga.ubsan/_deps/llama_cpp-build/src:/groonga.ubsan/_deps/llama_cpp-build/ggml/src: lib/libgroonga.so.0.0.0 /usr/lib/x86_64-linux-gnu/libmsgpackc.so.2.0.0 _deps/llama_cpp-build/src/libgroonga-llama.so.0.0.0 _deps/llama_cpp-build/ggml/src/libgroonga-ggml.so.0.0.0 _deps/llama_cpp-build/ggml/src/libgroonga-ggml-base.so.0.0.0 && : /usr/bin/ld: lib/libgroonga.so.0.0.0: undefined reference to `__ubsan_vptr_type_cache' /usr/bin/ld: lib/libgroonga.so.0.0.0: undefined reference to `__ubsan_handle_dynamic_type_cache_miss' clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` llvm/llvm-project#121115
1 parent f1920f6 commit 19949b7

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -525,21 +525,10 @@ option(GRN_WITH_UBSAN "Enable Undefined Behavior Sanitizer (UBSAN) checking"
525525
OFF)
526526
if(GRN_WITH_UBSAN)
527527
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
528-
set(GRN_UBSAN_FLAGS "-fsanitize=undefined -fno-sanitize=alignment")
528+
set(GRN_UBSAN_FLAGS "-fsanitize=undefined -fno-sanitize=alignment,vptr")
529529
string(APPEND CMAKE_C_FLAGS " ${GRN_UBSAN_FLAGS}")
530530
string(APPEND CMAKE_CXX_FLAGS " ${GRN_UBSAN_FLAGS}")
531531
message(STATUS "UBSAN flags: ${GRN_UBSAN_FLAGS}")
532-
execute_process(
533-
COMMAND ${CMAKE_C_COMPILER}
534-
-print-file-name=libclang_rt.ubsan_standalone-x86_64.so
535-
OUTPUT_VARIABLE GRN_UBSAN_LIB_PATH
536-
OUTPUT_STRIP_TRAILING_WHITESPACE)
537-
if(GRN_UBSAN_LIB_PATH)
538-
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${GRN_UBSAN_LIB_PATH}")
539-
message(STATUS "Found UBSAN runtime library: ${GRN_UBSAN_LIB_PATH}")
540-
else()
541-
message(FATAL_ERROR "No UBSAN runtime library found")
542-
endif()
543532
else()
544533
message(FATAL_ERROR "UBSAN support is available only for Clang")
545534
endif()

0 commit comments

Comments
 (0)