svn commit: r295850 - in vendor/compiler-rt/dist: lib/msan lib/sanitizer_common lib/tsan/go test/asan/TestCases test/tsan
Dimitry Andric
dim at FreeBSD.org
Sun Feb 21 13:53:14 UTC 2016
Author: dim
Date: Sun Feb 21 13:53:12 2016
New Revision: 295850
URL: https://svnweb.freebsd.org/changeset/base/295850
Log:
Vendor import of compiler-rt release_38 branch r261369:
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_38@261369
Modified:
vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc
vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc
vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh
vendor/compiler-rt/dist/test/asan/TestCases/throw_catch.cc
vendor/compiler-rt/dist/test/tsan/CMakeLists.txt
vendor/compiler-rt/dist/test/tsan/ignore_lib0.cc
vendor/compiler-rt/dist/test/tsan/printf-1.c
Modified: vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc
==============================================================================
--- vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Sun Feb 21 13:53:12 2016 (r295850)
@@ -1408,12 +1408,12 @@ int OnExit() {
__msan_unpoison(ptr, size)
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
if (msan_init_is_running) return REAL(func)(__VA_ARGS__); \
+ ENSURE_MSAN_INITED(); \
MSanInterceptorContext msan_ctx = {IsInInterceptorScope()}; \
ctx = (void *)&msan_ctx; \
(void)ctx; \
InterceptorScope interceptor_scope; \
- __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */ \
- ENSURE_MSAN_INITED();
+ __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */
#define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
do { \
} while (false)
Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc
==============================================================================
--- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc Sun Feb 21 13:53:12 2016 (r295850)
@@ -222,6 +222,11 @@ uptr ThreadDescriptorSize() {
char *end;
int minor = internal_simple_strtoll(buf + 8, &end, 10);
if (end != buf + 8 && (*end == '\0' || *end == '.')) {
+ int patch = 0;
+ if (*end == '.')
+ // strtoll will return 0 if no valid conversion could be performed
+ patch = internal_simple_strtoll(end + 1, nullptr, 10);
+
/* sizeof(struct pthread) values from various glibc versions. */
if (SANITIZER_X32)
val = 1728; // Assume only one particular version for x32.
@@ -235,9 +240,9 @@ uptr ThreadDescriptorSize() {
val = FIRST_32_SECOND_64(1136, 1712);
else if (minor == 10)
val = FIRST_32_SECOND_64(1168, 1776);
- else if (minor <= 12)
+ else if (minor == 11 || (minor == 12 && patch == 1))
val = FIRST_32_SECOND_64(1168, 2288);
- else if (minor == 13)
+ else if (minor <= 13)
val = FIRST_32_SECOND_64(1168, 2304);
else
val = FIRST_32_SECOND_64(1216, 2304);
Modified: vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh
==============================================================================
--- vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh Sun Feb 21 13:53:12 2016 (r295850)
@@ -50,19 +50,20 @@ if [ "`uname -a | grep Linux`" != "" ];
../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
"
elif [ "`uname -a | grep FreeBSD`" != "" ]; then
- SUFFIX="freebsd_amd64"
- OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"
- OSLDFLAGS="-lpthread -fPIC -fpie"
- SRCS="
- $SRCS
- ../rtl/tsan_platform_linux.cc
- ../../sanitizer_common/sanitizer_posix.cc
- ../../sanitizer_common/sanitizer_posix_libcdep.cc
- ../../sanitizer_common/sanitizer_procmaps_common.cc
- ../../sanitizer_common/sanitizer_procmaps_freebsd.cc
- ../../sanitizer_common/sanitizer_linux.cc
- ../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
- "
+ SUFFIX="freebsd_amd64"
+ OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"
+ OSLDFLAGS="-lpthread -fPIC -fpie"
+ SRCS="
+ $SRCS
+ ../rtl/tsan_platform_linux.cc
+ ../../sanitizer_common/sanitizer_posix.cc
+ ../../sanitizer_common/sanitizer_posix_libcdep.cc
+ ../../sanitizer_common/sanitizer_procmaps_common.cc
+ ../../sanitizer_common/sanitizer_procmaps_freebsd.cc
+ ../../sanitizer_common/sanitizer_linux.cc
+ ../../sanitizer_common/sanitizer_linux_libcdep.cc
+ ../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+ "
elif [ "`uname -a | grep Darwin`" != "" ]; then
SUFFIX="darwin_amd64"
OSCFLAGS="-fPIC -Wno-unused-const-variable -Wno-unknown-warning-option"
Modified: vendor/compiler-rt/dist/test/asan/TestCases/throw_catch.cc
==============================================================================
--- vendor/compiler-rt/dist/test/asan/TestCases/throw_catch.cc Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/test/asan/TestCases/throw_catch.cc Sun Feb 21 13:53:12 2016 (r295850)
@@ -1,8 +1,5 @@
// RUN: %clangxx_asan -O %s -o %t && %run %t
-// Clang doesn't support exceptions on Windows yet.
-// XFAIL: win32
-
#include <assert.h>
#include <stdio.h>
#include <sanitizer/asan_interface.h>
Modified: vendor/compiler-rt/dist/test/tsan/CMakeLists.txt
==============================================================================
--- vendor/compiler-rt/dist/test/tsan/CMakeLists.txt Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/test/tsan/CMakeLists.txt Sun Feb 21 13:53:12 2016 (r295850)
@@ -47,6 +47,7 @@ if(COMPILER_RT_INCLUDE_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg)
list(APPEND TSAN_TEST_DEPS TsanUnitTests)
+ list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit)
endif()
add_lit_testsuite(check-tsan "Running ThreadSanitizer tests"
Modified: vendor/compiler-rt/dist/test/tsan/ignore_lib0.cc
==============================================================================
--- vendor/compiler-rt/dist/test/tsan/ignore_lib0.cc Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/test/tsan/ignore_lib0.cc Sun Feb 21 13:53:12 2016 (r295850)
@@ -1,9 +1,9 @@
// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib0.so
// RUN: %clangxx_tsan -O1 %s -L%T -lignore_lib0 -o %t
// RUN: echo running w/o suppressions:
-// RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
+// RUN: env LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
// RUN: echo running with suppressions:
-// RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
+// RUN: env LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
// Tests that interceptors coming from a library specified in called_from_lib
// suppression are ignored.
Modified: vendor/compiler-rt/dist/test/tsan/printf-1.c
==============================================================================
--- vendor/compiler-rt/dist/test/tsan/printf-1.c Sun Feb 21 13:52:51 2016 (r295849)
+++ vendor/compiler-rt/dist/test/tsan/printf-1.c Sun Feb 21 13:53:12 2016 (r295850)
@@ -1,6 +1,6 @@
// RUN: %clang_tsan -O2 %s -o %t
-// RUN: ASAN_OPTIONS=check_printf=1 %run %t 2>&1 | FileCheck %s
-// RUN: ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck %s
+// RUN: %env_tsan_opts=check_printf=1 %run %t 2>&1 | FileCheck %s
+// RUN: %env_tsan_opts=check_printf=0 %run %t 2>&1 | FileCheck %s
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
More information about the svn-src-all
mailing list