From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DF0E7138330 for ; Fri, 14 Oct 2016 12:48:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3CE46E0BC8; Fri, 14 Oct 2016 12:48:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 106BFE0BC8 for ; Fri, 14 Oct 2016 12:48:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C575634112A for ; Fri, 14 Oct 2016 12:48:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 57B202EF for ; Fri, 14 Oct 2016 12:48:00 +0000 (UTC) From: "Sven Wegener" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Wegener" Message-ID: <1476449266.62dbdfb90a5079d7e0ca0cf540bb5cfee960011a.swegener@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns-recursor/files/, net-dns/pdns-recursor/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-dns/pdns-recursor/files/pdns-recursor-4.0.3-boost-1.61-fcontext.patch net-dns/pdns-recursor/pdns-recursor-4.0.3.ebuild X-VCS-Directories: net-dns/pdns-recursor/ net-dns/pdns-recursor/files/ X-VCS-Committer: swegener X-VCS-Committer-Name: Sven Wegener X-VCS-Revision: 62dbdfb90a5079d7e0ca0cf540bb5cfee960011a X-VCS-Branch: master Date: Fri, 14 Oct 2016 12:48:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ea1a8209-81de-4e82-9ae9-8077ed634129 X-Archives-Hash: 513d8c595b55d5b0eb35468816a3d124 commit: 62dbdfb90a5079d7e0ca0cf540bb5cfee960011a Author: Sven Wegener gentoo org> AuthorDate: Fri Oct 14 12:36:39 2016 +0000 Commit: Sven Wegener gentoo org> CommitDate: Fri Oct 14 12:47:46 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62dbdfb9 net-dns/pdns-recursor: Fix building with >=boost-1.61, bug #595988 Package-Manager: portage-2.3.0 .../pdns-recursor-4.0.3-boost-1.61-fcontext.patch | 152 +++++++++++++++++++++ net-dns/pdns-recursor/pdns-recursor-4.0.3.ebuild | 6 +- 2 files changed, 157 insertions(+), 1 deletion(-) diff --git a/net-dns/pdns-recursor/files/pdns-recursor-4.0.3-boost-1.61-fcontext.patch b/net-dns/pdns-recursor/files/pdns-recursor-4.0.3-boost-1.61-fcontext.patch new file mode 100644 index 00000000..c6cd9a3 --- /dev/null +++ b/net-dns/pdns-recursor/files/pdns-recursor-4.0.3-boost-1.61-fcontext.patch @@ -0,0 +1,152 @@ +diff --git a/mtasker_fcontext.cc b/mtasker_fcontext.cc +index bc37e76..8d96fa1 100644 +--- a/mtasker_fcontext.cc ++++ b/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, fcontext_t const nfc, + } + } + #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::value, + * jump. args_t simply provides a way to pass more by reference. + */ + struct args_t { ++#if BOOST_VERSION < 106100 + fcontext_t prev_ctx = nullptr; ++#endif + pdns_ucontext_t* self = nullptr; + boost::function* 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 + } diff --git a/net-dns/pdns-recursor/pdns-recursor-4.0.3.ebuild b/net-dns/pdns-recursor/pdns-recursor-4.0.3.ebuild index a4dddaa..321a847 100644 --- a/net-dns/pdns-recursor/pdns-recursor-4.0.3.ebuild +++ b/net-dns/pdns-recursor/pdns-recursor-4.0.3.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI="5" +EAPI="6" inherit toolchain-funcs flag-o-matic eutils versionator @@ -30,6 +30,10 @@ DEPEND="${DEPEND} S="${WORKDIR}"/${P/_/-} +PATCHES=( + "${FILESDIR}"/${P}-boost-1.61-fcontext.patch +) + pkg_setup() { filter-flags -ftree-vectorize }