diff options
-rw-r--r-- | cmake/Modules/SanitizerUtils.cmake | 5 | ||||
-rw-r--r-- | test/ubsan_minimal/lit.common.cfg | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/cmake/Modules/SanitizerUtils.cmake b/cmake/Modules/SanitizerUtils.cmake index c80fc3b1e..9d029337b 100644 --- a/cmake/Modules/SanitizerUtils.cmake +++ b/cmake/Modules/SanitizerUtils.cmake @@ -81,7 +81,7 @@ macro(add_sanitizer_rt_version_list name) endmacro() # Add target to check code style for sanitizer runtimes. -if(CMAKE_HOST_UNIX) +if(CMAKE_HOST_UNIX AND NOT OS_NAME MATCHES "OpenBSD") add_custom_target(SanitizerLintCheck COMMAND env LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR= PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} @@ -90,5 +90,8 @@ if(CMAKE_HOST_UNIX) DEPENDS ${SANITIZER_LINT_SCRIPT} COMMENT "Running lint check for sanitizer sources..." VERBATIM) +else() + add_custom_target(SanitizerLintCheck + COMMAND echo "No lint check") endif() diff --git a/test/ubsan_minimal/lit.common.cfg b/test/ubsan_minimal/lit.common.cfg index e8b42bb82..7630b617f 100644 --- a/test/ubsan_minimal/lit.common.cfg +++ b/test/ubsan_minimal/lit.common.cfg @@ -22,6 +22,12 @@ target_cflags = [get_required_attr(config, "target_cflags")] clang_ubsan_cflags = ["-fsanitize-minimal-runtime"] + target_cflags clang_ubsan_cxxflags = config.cxx_mode_flags + clang_ubsan_cflags +# OpenBSD needs lld linker to function +# TODO update the frontend driver +if config.host_os == 'OpenBSD': + clang_ubsan_cflags.append("-fuse-ld=lld") + clang_ubsan_cxxflags.append("-fuse-ld=lld") + # Define %clang and %clangxx substitutions to use in test RUN lines. config.substitutions.append( ("%clang ", build_invocation(clang_ubsan_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags)) ) @@ -30,7 +36,7 @@ config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags config.suffixes = ['.c', '.cc', '.cpp'] # Check that the host supports UndefinedBehaviorSanitizerMinimal tests -if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin']: # TODO: Windows +if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin', 'OpenBSD']: # TODO: Windows config.unsupported = True # Don't target x86_64h if the test machine can't execute x86_64h binaries. |