[compiler-rt] [compiler-rt][sanitizer] fix i386 build for Haiku (PR #171075)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 7 20:27:15 PST 2025


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 h,cpp -- compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h --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/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index 37245c35c..2964f0d0c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -1987,7 +1987,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
 #    elif SANITIZER_NETBSD
   uptr err = ucontext->uc_mcontext.__gregs[_REG_ERR];
 #    elif SANITIZER_HAIKU
-  uptr err = 0; // ucontext->uc_mcontext.r13;
+  uptr err = 0;  // ucontext->uc_mcontext.r13;
 #    elif SANITIZER_SOLARIS && defined(__i386__)
   const int Err = 13;
   uptr err = ucontext->uc_mcontext.gregs[Err];
@@ -2618,7 +2618,7 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
   *bp = ucontext->uc_mcontext.mc_ebp;
   *sp = ucontext->uc_mcontext.mc_esp;
 #    elif SANITIZER_HAIKU
-  ucontext_t *ucontext = (ucontext_t*)context;
+  ucontext_t* ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.eip;
   *bp = ucontext->uc_mcontext.ebp;
   *sp = ucontext->uc_mcontext.esp;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 82f0da14f..1c65dd98c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -629,11 +629,11 @@ typedef unsigned long __sanitizer_sigset_t;
 #  elif SANITIZER_APPLE
 typedef unsigned __sanitizer_sigset_t;
 #  elif SANITIZER_HAIKU
-#   if defined(__x86_64__)
+#    if defined(__x86_64__)
 typedef unsigned long __sanitizer_sigset_t;
-#   else
+#    else
 typedef unsigned long long __sanitizer_sigset_t;
-#   endif
+#    endif
 #  elif SANITIZER_LINUX
 struct __sanitizer_sigset_t {
   // The size is determined by looking at sizeof of real sigset_t on linux.

``````````

</details>


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


More information about the llvm-commits mailing list