[compiler-rt] r335166 - [TSan] fix build and couple of unit tests on FreeBSD

David Carlier via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 13:17:44 PDT 2018


Author: devnexen
Date: Wed Jun 20 13:17:44 2018
New Revision: 335166

URL: http://llvm.org/viewvc/llvm-project?rev=335166&view=rev
Log:
[TSan] fix build and couple of unit tests on FreeBSD

Similarly to Msan adding -pie provokes linkage issue, was spotted with pie_test.cc
Set to XFAIL for couple of unit tests.

Reviewers: vitalybuka, krytarowski, dim

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D48317

Modified:
    compiler-rt/trunk/lib/tsan/CMakeLists.txt
    compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc
    compiler-rt/trunk/test/tsan/strerror_r.cc

Modified: compiler-rt/trunk/lib/tsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/CMakeLists.txt?rev=335166&r1=335165&r2=335166&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/CMakeLists.txt Wed Jun 20 13:17:44 2018
@@ -5,7 +5,10 @@ include_directories(..)
 set(TSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 # SANITIZER_COMMON_CFLAGS contains -fPIC, but it's performance-critical for
 # TSan runtime to be built with -fPIE to reduce the number of register spills.
-append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE TSAN_CFLAGS)
+# On FreeBSD however it provokes linkage issue thus we disable it.
+if(NOT CMAKE_SYSTEM MATCHES "FreeBSD")
+  append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE TSAN_CFLAGS)
+endif()
 append_rtti_flag(OFF TSAN_CFLAGS)
 
 if(COMPILER_RT_TSAN_DEBUG_OUTPUT)

Modified: compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc?rev=335166&r1=335165&r2=335166&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc (original)
+++ compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc Wed Jun 20 13:17:44 2018
@@ -1,6 +1,7 @@
 // RUN: %clangxx_tsan -O0 %s -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NORMAL
 // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-IGNORE
+// XFAIL: freebsd
 
 #include <errno.h>
 #include <sys/mman.h>

Modified: compiler-rt/trunk/test/tsan/strerror_r.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/strerror_r.cc?rev=335166&r1=335165&r2=335166&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/strerror_r.cc (original)
+++ compiler-rt/trunk/test/tsan/strerror_r.cc Wed Jun 20 13:17:44 2018
@@ -1,6 +1,8 @@
 // RUN: %clangxx_tsan -O1 -DTEST_ERROR=ERANGE %s -o %t && %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-SYS %s
 // RUN: %clangxx_tsan -O1 -DTEST_ERROR=-1 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-USER %s
 // UNSUPPORTED: darwin
+// This test provokes a data race under FreeBSD
+// XFAIL: freebsd
 
 #include "test.h"
 




More information about the llvm-commits mailing list