[PATCH] D33874: Implement AllocateRWX and ReleaseRWX for NetBSD
Joerg Sonnenberger via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 8 13:45:23 PDT 2017
On Thu, Jun 08, 2017 at 08:29:52PM +0000, Kamil Rytarowski via Phabricator via llvm-commits wrote:
> krytarowski added a comment.
>
> On demand I tested the following patch:
>
> $NetBSD$
>
> --- lib/Support/Unix/Memory.inc.orig 2016-12-16 22:52:53.000000000 +0000
> +++ lib/Support/Unix/Memory.inc
> @@ -195,9 +195,10 @@ Memory::AllocateRWX(size_t NumBytes, con
> #if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
> void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_EXEC,
> flags, fd, 0);
> -#else
> - void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
> - flags, fd, 0);
> +#elif defined(__NetBSD__) && defined(PROT_MPROTECT)
> + void *pa =
> + ::mmap(start, PageSize * NumPages,
> + PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC), flags, fd, 0);
> #endif
> if (pa == MAP_FAILED) {
> if (NearBlock) //Try again without a near hint
I meant literally only this chunk.
Joerg
More information about the llvm-commits
mailing list