Boost coroutine's basic_standard_stack_allocator is missing MAP_STACK,
diff below adds it following the same method as the ones that otto@ has
already done. The relevant file is not used as part of -md's build so
I have only bumped REVISION-main.

This unbreaks icinga2's devel tree that will become icinga 2.11.0.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boost/Makefile,v
retrieving revision 1.87
diff -u -p -r1.87 Makefile
--- Makefile    12 Jul 2019 20:44:04 -0000      1.87
+++ Makefile    18 Jul 2019 16:31:06 -0000
@@ -9,11 +9,12 @@ VERSION=      1.66.0
 DISTNAME=      boost_${VERSION:S/./_/g}
 PKGNAME-main=  boost-${VERSION}
 PKGNAME-md=    boost-md-${VERSION}
-REVISION-main= 5
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=boost/}
 EXTRACT_SUFX=  .tar.bz2
 FIX_EXTRACT_PERMISSIONS =      Yes
+
+REVISION-main= 6
 REVISION-md=   1
 
 SO_VERSION=    9.0
Index: patches/patch-boost_coroutine_standard_stack_allocator_hpp
===================================================================
RCS file: patches/patch-boost_coroutine_standard_stack_allocator_hpp
diff -N patches/patch-boost_coroutine_standard_stack_allocator_hpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_coroutine_standard_stack_allocator_hpp  18 Jul 2019 
16:31:06 -0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+
+Index: boost/coroutine/standard_stack_allocator.hpp
+--- boost/coroutine/standard_stack_allocator.hpp.orig
++++ boost/coroutine/standard_stack_allocator.hpp
+@@ -26,6 +26,8 @@
+ #  include BOOST_ABI_PREFIX
+ #endif
+ 
++#include <sys/mman.h>
++
+ namespace boost {
+ namespace coroutines {
+ 
+@@ -39,8 +41,8 @@ struct basic_standard_stack_allocator
+         BOOST_ASSERT( traits_type::minimum_size() <= size);
+         BOOST_ASSERT( traits_type::is_unbounded() || ( 
traits_type::maximum_size() >= size) );
+ 
+-        void * limit = std::malloc( size);
+-        if ( ! limit) throw std::bad_alloc();
++        void * limit = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | 
MAP_ANON | MAP_STACK, -1, 0);
++        if ( limit == MAP_FAILED ) throw std::bad_alloc();
+ 
+         ctx.size = size;
+         ctx.sp = static_cast< char * >( limit) + ctx.size;
+@@ -60,7 +62,7 @@ struct basic_standard_stack_allocator
+ #endif
+ 
+         void * limit = static_cast< char * >( ctx.sp) - ctx.size;
+-        std::free( limit);
++        munmap(limit, ctx.size);
+     }
+ };
+ 

Reply via email to