Skip to content

Commit

Permalink
[compiler-rt] Fix Mmap on FreeBSD AArch64
Browse files Browse the repository at this point in the history
On FreeBSD AArch64 safestack needs to use __syscall to handle 64 bit arguments

Reviewed by: MaskRay, vitalybuka

Differential Revision: https://reviews.llvm.org/D125901
  • Loading branch information
zxombie authored and emaste committed Jun 8, 2022
1 parent ad3fadd commit ccae01c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/safestack/safestack_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ccae01c

Please sign in to comment.