--- lib/tsan/CMakeLists.txt.orig 2017-01-12 12:37:35.000000000 +1100 +++ lib/tsan/CMakeLists.txt 2020-05-14 09:10:58.627445000 +1000 @@ -207,7 +207,8 @@ # in the base system due to incompatibilities between FreeBSD's and Clang's # versions. As a workaround do not use --sysroot=. on FreeBSD until this is # addressed. -if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" + AND NOT CMAKE_SYSTEM_NAME MATCHES "BSDSUniX") file(GLOB _tsan_generic_sources rtl/tsan*) file(GLOB _tsan_platform_sources rtl/tsan*posix* rtl/tsan*mac* rtl/tsan*linux*) --- lib/tsan/go/buildgo.sh.orig 2016-10-29 07:14:18.000000000 +1100 +++ lib/tsan/go/buildgo.sh 2020-05-26 14:49:12.300575000 +1000 @@ -51,6 +51,21 @@ ../../sanitizer_common/sanitizer_linux_libcdep.cc ../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc " +elif [ "`uname -a | grep BSDSUniX`" != "" ]; then + SUFFIX="bsdsunix_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_bsdsunix.cc + ../../sanitizer_common/sanitizer_linux.cc + ../../sanitizer_common/sanitizer_linux_libcdep.cc + ../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc + " elif [ "`uname -a | grep FreeBSD`" != "" ]; then SUFFIX="freebsd_amd64" OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"