--- libsanitizer/tsan/tsan_rtl_amd64.S.orig	2020-03-04 19:30:03.000000000 +1100
+++ libsanitizer/tsan/tsan_rtl_amd64.S	2020-09-22 16:26:39.620582000 +1000
@@ -186,7 +186,7 @@
   CFI_ADJUST_CFA_OFFSET(8)
   CFI_REL_OFFSET(%rdi, 0)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__BSDSUniX__)
   lea 8(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -228,7 +228,7 @@
   CFI_ADJUST_CFA_OFFSET(8)
   CFI_REL_OFFSET(%rdi, 0)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__BSDSUniX__)
   lea 8(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -277,7 +277,7 @@
   sub $8, %rsp
   CFI_ADJUST_CFA_OFFSET(8)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__BSDSUniX__)
   lea 24(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -334,7 +334,7 @@
   sub $8, %rsp
   CFI_ADJUST_CFA_OFFSET(8)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__BSDSUniX__)
   lea 24(%rsp), %rdi
   mov %rdi, %rsi
 #else
@@ -364,7 +364,7 @@
 ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp))
 #endif  // !defined(__APPLE__)
 
-#if defined(__FreeBSD__) || defined(__linux__)
+#if defined(__FreeBSD__) || defined(__linux__) || defined(__BSDSUniX__)
 /* We do not need executable stack.  */
 .section        .note.GNU-stack,"",@progbits
 #endif
