[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
This commit is contained in:
Andrew Turner 2022-05-18 17:18:49 +01:00 committed by Ed Maste
parent ad3faddaa6
commit ccae01cbce
1 changed files with 1 additions and 1 deletions

View File

@ -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);