Skip to content

Commit

Permalink
boehm_gc: fix mmap(PROT_NONE) failed (#4820)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgubi committed Mar 23, 2020
1 parent b6979f5 commit 4851829
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev-libs/boehm_gc/boehm_gc-8.0.4.recipe
Expand Up @@ -18,10 +18,11 @@ COPYRIGHT="1988, 1989 Hans-J. Boehm, Alan J. Demers
2011 Ludovic Courtes
2018 Petter A. Urkedal"
LICENSE="Boehm"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/ivmai/bdwgc/releases/download/v$portVersion/gc-$portVersion.tar.gz"
CHECKSUM_SHA256="436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d"
SOURCE_DIR="gc-$portVersion"
PATCHES="boehm_gc-$portVersion.patchset"

ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
Expand Down
22 changes: 22 additions & 0 deletions dev-libs/boehm_gc/patches/boehm_gc-8.0.4.patchset
@@ -0,0 +1,22 @@
From bbc09e8c410f0e2ff3e0b0c93884e87b5a75c15f Mon Sep 17 00:00:00 2001
From: Massimiliano Gubinelli <m.gubinelli@gmail.com>
Date: Mon, 23 Mar 2020 16:36:01 +0000
Subject: fix for "mmap(PROT_NONE) failed" in compiling GNU Guile 2.2.7


diff --git a/os_dep.c b/os_dep.c
index f0c3eae..03fb984 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -2560,7 +2560,7 @@ GC_INNER void GC_unmap(ptr_t start, size_t bytes)
/* We immediately remap it to prevent an intervening mmap from */
/* accidentally grabbing the same address space. */
{
-# ifdef CYGWIN32
+# if defined(CYGWIN32) || defined(__HAIKU__)
/* Calling mmap() with the new protection flags on an */
/* existing memory map with MAP_FIXED is broken on Cygwin. */
/* However, calling mprotect() on the given address range */
--
2.24.1

4 comments on commit 4851829

@korli
Copy link
Contributor

@korli korli commented on 4851829 Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diversys Could it be something to fix in Haiku itself?

@diversys
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, could be. Should we revert this fix?

@X547
Copy link
Contributor

@X547 X547 commented on 4851829 Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a problem similar to https://dev.haiku-os.org/ticket/15804.

@korli
Copy link
Contributor

@korli korli commented on 4851829 Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, could be. Should we revert this fix?

No, for beta1, this is fine. mmap(PROT_NONE) usually means overcommit, there are a few usecases (for instance openjdk) where this would be interesting.

Please sign in to comment.