Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Driver/SanitizerArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ bool SanitizerArgs::needsFuzzerInterceptors() const {
bool SanitizerArgs::needsUbsanRt() const {
// All of these include ubsan.
if (needsAsanRt() || needsMsanRt() || needsNsanRt() || needsHwasanRt() ||
needsTsanRt() || needsDfsanRt() || needsLsanRt() ||
needsTsanRt() || needsDfsanRt() || needsLsanRt() || needsTysanRt() ||
needsCfiCrossDsoDiagRt() || (needsScudoRt() && !requiresMinimalRuntime()))
return false;

Expand Down
4 changes: 4 additions & 0 deletions compiler-rt/lib/tysan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ if(APPLE)
OBJECT_LIBS RTTysan_dynamic
RTInterception
RTSanitizerCommon
RTSanitizerCommonCoverage
RTSanitizerCommonLibc
RTSanitizerCommonSymbolizer
RTUbsan
CFLAGS ${TYSAN_DYNAMIC_CFLAGS}
LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
DEFS ${TYSAN_DYNAMIC_DEFINITIONS}
Expand All @@ -71,8 +73,10 @@ else()
SOURCES ${TYSAN_SOURCES}
OBJECT_LIBS RTInterception
RTSanitizerCommon
RTSanitizerCommonCoverage
RTSanitizerCommonLibc
RTSanitizerCommonSymbolizer
RTUbsan
CFLAGS ${TYSAN_CFLAGS}
PARENT_TARGET tysan)
endforeach()
Expand Down
7 changes: 7 additions & 0 deletions compiler-rt/test/ubsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ foreach(arch ${UBSAN_TEST_ARCH})
if(COMPILER_RT_HAS_TSAN AND ";${TSAN_SUPPORTED_ARCH};" MATCHES ";${arch};" AND NOT ANDROID)
add_ubsan_testsuites("ThreadSanitizer" tsan ${arch})
endif()
if(COMPILER_RT_HAS_TYSAN AND ";${TYSAN_SUPPORTED_ARCH};" MATCHES ";${arch};")
add_ubsan_testsuites("TypeSanitizer" tysan ${arch})
endif()
endforeach()

macro(add_ubsan_device_testsuite test_mode sanitizer platform arch)
Expand Down Expand Up @@ -124,6 +127,10 @@ if(APPLE)
if(COMPILER_RT_HAS_TSAN AND ";${TSAN_SUPPORTED_ARCH};" MATCHES ";${arch};")
add_ubsan_device_testsuite("ThreadSanitizer" tsan ${platform} ${arch})
endif()

if(COMPILER_RT_HAS_TYSAN AND ";${TYSAN_SUPPORTED_ARCH};" MATCHES ";${arch};")
add_ubsan_device_testsuite("TypeSanitizer" tysan ${platform} ${arch})
endif()
endforeach()
endforeach()
endif()
Expand Down
3 changes: 3 additions & 0 deletions compiler-rt/test/ubsan/TestCases/Misc/Posix/sigaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// Reason unknown, needs debugging.
// UNSUPPORTED: target=aarch64{{.*}} && ubsan-tsan

// TySan doesn't build a shared library
// UNSUPPORTED: ubsan-tysan

#include <assert.h>
#include <signal.h>
#include <stdio.h>
Expand Down
3 changes: 2 additions & 1 deletion compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=edge,trace-pc-guard %s -o %t
// RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%t-dir"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN

// Coverage is not yet implemented in TSan.
// Coverage is not yet implemented in TSan or TySan.
// XFAIL: ubsan-tsan
// XFAIL: ubsan-tysan
// UNSUPPORTED: ubsan-standalone-static
// No coverage support
// UNSUPPORTED: target={{.*openbsd.*}}
Expand Down
3 changes: 3 additions & 0 deletions compiler-rt/test/ubsan/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def get_required_attr(config, attr_name):
elif ubsan_lit_test_mode == "ThreadSanitizer":
config.available_features.add("ubsan-tsan")
clang_ubsan_cflags = ["-fsanitize=thread"]
elif ubsan_lit_test_mode == "TypeSanitizer":
config.available_features.add("ubsan-tysan")
clang_ubsan_cflags = ["-fsanitize=type"]
else:
lit_config.fatal("Unknown UBSan test mode: %r" % ubsan_lit_test_mode)

Expand Down
1 change: 1 addition & 0 deletions llvm/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Changes to BOLT
Changes to Sanitizers
---------------------

* Support running TypeSanitizer with UndefinedBehaviourSanitizer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Support running TypeSanitizer with UndefinedBehaviourSanitizer
* Support running TypeSanitizer with UndefinedBehaviourSanitizer.

nit: for consistency with the list item below

* TypeSanitizer no longer inlines all instrumentation by default. Added the
`-f[no-]sanitize-type-outline-instrumentation` flags to give users control
over this behaviour.
Expand Down