[compiler-rt] [tsan] Fix buildgo.sh on FreeBSD/NetBSD (PR #213047)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 08:29:38 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
index c7ca0eb08..e2624939e 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
@@ -27,53 +27,53 @@
 #include "tsan_platform.h"
 #include "tsan_rtl.h"
 
-#if SANITIZER_NETBSD
-#  // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
-#  define _RTLD_SOURCE
-#  include <sys/types.h>
-#  include <machine/mcontext.h>
-#  undef _RTLD_SOURCE
-#  include <sys/param.h>
-#  if __NetBSD_Version__ >= 1099001200
-#    include <machine/lwp_private.h>
+#  if SANITIZER_NETBSD
+#    // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
+#    define _RTLD_SOURCE
+#    include <machine/mcontext.h>
+#    include <sys/types.h>
+#    undef _RTLD_SOURCE
+#    include <sys/param.h>
+#    if __NetBSD_Version__ >= 1099001200
+#      include <machine/lwp_private.h>
+#    endif
 #  endif
-#endif
 
-#include <fcntl.h>
-#include <pthread.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/mman.h>
-#if SANITIZER_LINUX
-#include <sys/personality.h>
-#include <setjmp.h>
-#endif
-#include <sys/syscall.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sched.h>
-#include <dlfcn.h>
-#if SANITIZER_LINUX
-#define __need_res_state
-#include <resolv.h>
-#endif
+#  include <fcntl.h>
+#  include <pthread.h>
+#  include <signal.h>
+#  include <stdio.h>
+#  include <stdlib.h>
+#  include <string.h>
+#  include <stdarg.h>
+#  include <sys/mman.h>
+#  if SANITIZER_LINUX
+#    include <sys/personality.h>
+#    include <setjmp.h>
+#  endif
+#  include <sys/syscall.h>
+#  include <sys/socket.h>
+#  include <sys/time.h>
+#  include <sys/types.h>
+#  include <sys/resource.h>
+#  include <sys/stat.h>
+#  include <unistd.h>
+#  include <sched.h>
+#  include <dlfcn.h>
+#  if SANITIZER_LINUX
+#    define __need_res_state
+#    include <resolv.h>
+#  endif
 
-#ifdef sa_handler
-# undef sa_handler
-#endif
+#  ifdef sa_handler
+#    undef sa_handler
+#  endif
 
-#ifdef sa_sigaction
-# undef sa_sigaction
-#endif
+#  ifdef sa_sigaction
+#    undef sa_sigaction
+#  endif
 
-#if SANITIZER_FREEBSD
+#  if SANITIZER_FREEBSD
 extern "C" void *__libc_stack_end;
 void *__libc_stack_end = 0;
 #endif

``````````

</details>


https://github.com/llvm/llvm-project/pull/213047


More information about the llvm-commits mailing list