[compiler-rt] ccae01c - [compiler-rt] Fix Mmap on FreeBSD AArch64
Ed Maste via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 8 14:23:09 PDT 2022
Author: Andrew Turner
Date: 2022-06-08T17:22:33-04:00
New Revision: ccae01cbce8aeaba03e782759807d5b5fc4991f1
URL: https://github.com/llvm/llvm-project/commit/ccae01cbce8aeaba03e782759807d5b5fc4991f1
DIFF: https://github.com/llvm/llvm-project/commit/ccae01cbce8aeaba03e782759807d5b5fc4991f1.diff
LOG: [compiler-rt] Fix Mmap on FreeBSD AArch64
On FreeBSD AArch64 safestack needs to use __syscall to handle 64 bit arguments
Reviewed by: MaskRay, vitalybuka
Differential Revision: https://reviews.llvm.org/D125901
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 81e4c2645ce2..2b1fc139baa9 100644
--- a/compiler-rt/lib/safestack/safestack_platform.h
+++ b/compiler-rt/lib/safestack/safestack_platform.h
@@ -94,7 +94,7 @@ inline void *Mmap(void *addr, size_t length, int prot, int flags, int fd,
off_t offset) {
#if SANITIZER_NETBSD
return __mmap(addr, length, prot, flags, fd, 0, offset);
-#elif defined(__x86_64__) && (SANITIZER_FREEBSD)
+#elif SANITIZER_FREEBSD && (defined(__aarch64__) || defined(__x86_64__))
return (void *)__syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
#else
return (void *)syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
More information about the llvm-commits
mailing list