[compiler-rt] [compiler-rt] safestack fix (old ?) solaris build. (PR #97178)

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 29 12:37:29 PDT 2024


https://github.com/devnexen updated https://github.com/llvm/llvm-project/pull/97178

>From 6030cc9bd55132133447d2b880ddf333a7e97227 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen at gmail.com>
Date: Sat, 29 Jun 2024 20:24:33 +0000
Subject: [PATCH] [compiler-rt] safestack fix (old ?) solaris build.

---
 compiler-rt/lib/safestack/safestack_platform.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler-rt/lib/safestack/safestack_platform.h b/compiler-rt/lib/safestack/safestack_platform.h
index 822611315d010..d4b2e2ef7391c 100644
--- a/compiler-rt/lib/safestack/safestack_platform.h
+++ b/compiler-rt/lib/safestack/safestack_platform.h
@@ -91,7 +91,11 @@ inline int TgKill(pid_t pid, ThreadId tid, int sig) {
   (void)pid;
   return _REAL(_lwp_kill, tid, sig);
 #elif SANITIZER_SOLARIS
+#  ifdef SYS_lwp_kill
   return syscall(SYS_lwp_kill, tid, sig);
+#  else
+  return -1;
+#  endif
 #elif SANITIZER_FREEBSD
   return syscall(SYS_thr_kill2, pid, tid, sig);
 #else
@@ -105,6 +109,9 @@ inline void *Mmap(void *addr, size_t length, int prot, int flags, int fd,
   return __mmap(addr, length, prot, flags, fd, 0, offset);
 #elif SANITIZER_FREEBSD && (defined(__aarch64__) || defined(__x86_64__))
   return (void *)__syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
+#elif SANITIZER_SOLARIS
+  return (void *)(uintptr_t)syscall(SYS_mmap, addr, length, prot, flags, fd,
+                                    offset);
 #else
   return (void *)syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
 #endif



More information about the llvm-commits mailing list