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

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 29 14:51:50 PDT 2024


Author: David CARLIER
Date: 2024-06-29T22:51:46+01:00
New Revision: 56b2fcf001b765ff0886c058e3945f5d9b39b81c

URL: https://github.com/llvm/llvm-project/commit/56b2fcf001b765ff0886c058e3945f5d9b39b81c
DIFF: https://github.com/llvm/llvm-project/commit/56b2fcf001b765ff0886c058e3945f5d9b39b81c.diff

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

Added: 
    

Modified: 
    compiler-rt/lib/safestack/safestack_platform.h

Removed: 
    


################################################################################
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