From owner-svn-ports-head@freebsd.org Mon Nov 21 04:21:21 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B280C47DFD; Mon, 21 Nov 2016 04:21:21 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35F251CDD; Mon, 21 Nov 2016 04:21:21 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAL4LKc9046989; Mon, 21 Nov 2016 04:21:20 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAL4LKSq046988; Mon, 21 Nov 2016 04:21:20 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201611210421.uAL4LKSq046988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Mon, 21 Nov 2016 04:21:20 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r426688 - head/dns/powerdns-recursor/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 04:21:21 -0000 Author: jbeich Date: Mon Nov 21 04:21:20 2016 New Revision: 426688 URL: https://svnweb.freebsd.org/changeset/ports/426688 Log: dns/powerdns-recursor: unbreak build with boost 1.62 In file included from mtasker_context.cc:27: ./mtasker_fcontext.cc:33:7: error: no member named 'make_fcontext' in namespace 'boost::context'; did you mean 'boost::context::detail::make_fcontext'? using boost::context::make_fcontext; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from mtasker_context.cc:27: ./mtasker_fcontext.cc:64:7: error: no member named 'fcontext_t' in namespace 'boost::context'; did you mean 'boost::context::detail::fcontext_t'? using boost::context::fcontext_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~ [...] PR: 214470 Submitted by: antoine Obtained from: upstream Approved by: portmgr blanket Added: head/dns/powerdns-recursor/files/patch-mtasker__fcontext.cc (contents, props changed) Added: head/dns/powerdns-recursor/files/patch-mtasker__fcontext.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/dns/powerdns-recursor/files/patch-mtasker__fcontext.cc Mon Nov 21 04:21:20 2016 (r426688) @@ -0,0 +1,154 @@ +rec: Add support for boost::context >= 1.61 + +https://github.com/PowerDNS/pdns/commits/64413f6afd9b/pdns/mtasker_fcontext.cc + +--- mtasker_fcontext.cc.orig 2016-09-06 12:50:29 UTC ++++ mtasker_fcontext.cc +@@ -23,14 +23,15 @@ + #include + #include + #include +-#if BOOST_VERSION > 106100 +-#include +-#else +-#include +-#endif + #include +- ++#if BOOST_VERSION < 106100 ++#include + using boost::context::make_fcontext; ++#else ++#include ++using boost::context::detail::make_fcontext; ++#endif /* BOOST_VERSION < 106100 */ ++ + + #if BOOST_VERSION < 105600 + /* Note: This typedef means functions taking fcontext_t*, like jump_fcontext(), +@@ -61,8 +62,15 @@ jump_fcontext (fcontext_t* const ofc, fc + } + } + #else ++ ++#if BOOST_VERSION < 106100 + using boost::context::fcontext_t; + using boost::context::jump_fcontext; ++#else ++using boost::context::detail::fcontext_t; ++using boost::context::detail::jump_fcontext; ++using boost::context::detail::transfer_t; ++#endif /* BOOST_VERSION < 106100 */ + + static_assert (std::is_pointer::value, + "Boost Context has changed the fcontext_t type again :-("); +@@ -72,7 +80,9 @@ static_assert (std::is_pointer* work = nullptr; + }; +@@ -80,7 +90,11 @@ struct args_t { + extern "C" { + static + void ++#if BOOST_VERSION < 106100 + threadWrapper (intptr_t const xargs) { ++#else ++threadWrapper (transfer_t const t) { ++#endif + /* Access the args passed from pdns_makecontext, and copy them directly from + * the calling stack on to ours (we're now using the MThreads stack). + * This saves heap allocating an args object, at the cost of an extra +@@ -90,11 +104,28 @@ threadWrapper (intptr_t const xargs) { + * the behaviour of the System V implementation, which can inherently only + * be passed ints and pointers. + */ ++#if BOOST_VERSION < 106100 + auto args = reinterpret_cast(xargs); ++#else ++ auto args = reinterpret_cast(t.data); ++#endif + auto ctx = args->self; + auto work = args->work; ++ /* we switch back to pdns_makecontext() */ ++#if BOOST_VERSION < 106100 + jump_fcontext (reinterpret_cast(&ctx->uc_mcontext), + static_cast(args->prev_ctx), 0); ++#else ++ transfer_t res = jump_fcontext (t.fctx, 0); ++ /* we got switched back from pdns_swapcontext() */ ++ if (res.data) { ++ /* if res.data is not a nullptr, it holds a pointer to the context ++ we just switched from, and we need to fill it to be able to ++ switch back to it later. */ ++ fcontext_t* ptr = static_cast(res.data); ++ *ptr = res.fctx; ++ } ++#endif + args = nullptr; + + try { +@@ -106,9 +137,14 @@ threadWrapper (intptr_t const xargs) { + + /* Emulate the System V uc_link feature. */ + auto const next_ctx = ctx->uc_link->uc_mcontext; ++#if BOOST_VERSION < 106100 + jump_fcontext (reinterpret_cast(&ctx->uc_mcontext), + static_cast(next_ctx), + static_cast(ctx->exception)); ++#else ++ jump_fcontext (static_cast(next_ctx), 0); ++#endif ++ + #ifdef NDEBUG + __builtin_unreachable(); + #endif +@@ -129,10 +165,27 @@ pdns_ucontext_t::~pdns_ucontext_t + void + pdns_swapcontext + (pdns_ucontext_t& __restrict octx, pdns_ucontext_t const& __restrict ctx) { ++ /* we either switch back to threadwrapper() if it's the first time, ++ or we switch back to pdns_swapcontext(), ++ in both case we will be returning from a call to jump_fcontext(). */ ++#if BOOST_VERSION < 106100 + if (jump_fcontext (reinterpret_cast(&octx.uc_mcontext), + static_cast(ctx.uc_mcontext), 0)) { + std::rethrow_exception (ctx.exception); + } ++#else ++ transfer_t res = jump_fcontext (static_cast(ctx.uc_mcontext), &octx.uc_mcontext); ++ if (res.data) { ++ /* if res.data is not a nullptr, it holds a pointer to the context ++ we just switched from, and we need to fill it to be able to ++ switch back to it later. */ ++ fcontext_t* ptr = static_cast(res.data); ++ *ptr = res.fctx; ++ } ++ if (ctx.exception) { ++ std::rethrow_exception (ctx.exception); ++ } ++#endif + } + + void +@@ -146,7 +199,15 @@ pdns_makecontext + args_t args; + args.self = &ctx; + args.work = &start; ++ /* jumping to threadwrapper */ ++#if BOOST_VERSION < 106100 + jump_fcontext (reinterpret_cast(&args.prev_ctx), + static_cast(ctx.uc_mcontext), + reinterpret_cast(&args)); ++#else ++ transfer_t res = jump_fcontext (static_cast(ctx.uc_mcontext), ++ &args); ++ /* back from threadwrapper, updating the context */ ++ ctx.uc_mcontext = res.fctx; ++#endif + }