[compiler-rt] [compiler-rt] Enable minimal ubsan for GPU targets (PR #188289)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 07:34:59 PDT 2026


================
@@ -3,12 +3,15 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
-#ifdef KERNEL_USE
+#if defined(KERNEL_USE)
 extern "C" void ubsan_message(const char *msg);
 static void message(const char *msg) { ubsan_message(msg); }
+#elif defined(SANITIZER_AMDGPU) || defined(SANITIZER_NVPTX)
+#include <stdio.h>
----------------
b-sumner wrote:

For immediate HIP testing you could use printf.  Getting the output on stderr is a little harder.  You can see how assert does it in include/hip/amd_detail/hip_assert.h.

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


More information about the llvm-commits mailing list