[arch-commits] Commit in powerdns-recursor/trunk (2 files)

Levente Polyak anthraxx at archlinux.org
Fri Oct 21 14:45:53 UTC 2016


    Date: Friday, October 21, 2016 @ 14:45:52
  Author: anthraxx
Revision: 192872

upgpkg: powerdns-recursor 4.0.3-1

Added:
  powerdns-recursor/trunk/pdns-recursor-4.0.3-boost-context.patch
Modified:
  powerdns-recursor/trunk/PKGBUILD

-----------------------------------------+
 PKGBUILD                                |   17 ++-
 pdns-recursor-4.0.3-boost-context.patch |  151 ++++++++++++++++++++++++++++++
 2 files changed, 163 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-10-21 13:35:12 UTC (rev 192871)
+++ PKGBUILD	2016-10-21 14:45:52 UTC (rev 192872)
@@ -5,8 +5,8 @@
 # Contributor: Remi Gacogne <rgacogne[at]archlinux[dot]org>
 
 pkgname=powerdns-recursor
-pkgver=4.0.2
-pkgrel=2
+pkgver=4.0.3
+pkgrel=1
 pkgdesc='Resolving DNS server'
 url='https://www.powerdns.com/'
 arch=('i686' 'x86_64')
@@ -16,11 +16,18 @@
 provides=('pdns-recursor')
 conflicts=('pdns-recursor')
 backup=('etc/powerdns/recursor.conf')
-source=(http://downloads.powerdns.com/releases/pdns-recursor-${pkgver}.tar.bz2{,.asc})
-sha512sums=('74dea771deb0bcce6209c256f4c2c82a76d34a80a4a67497b58bf8889166a51864c2649527475aa6e6355af8bba86a68d599828274eaa7521006384223f2e937'
-            'SKIP')
+source=(http://downloads.powerdns.com/releases/pdns-recursor-${pkgver}.tar.bz2{,.asc}
+        pdns-recursor-4.0.3-boost-context.patch)
+sha512sums=('03c77cff58851f9802eba434fb674d9cbd19b849620996df84b8dccc97539607895e06c1beb662b1ce08146bbc2b51a72bde2d6d90ef88c929ab645d9b5a33c4'
+            'SKIP'
+            'e28dab595e216416c484bfbf4c597ccb0e327777e5867d05c9f2291d58bbc2835bd5dfdb47cfa7ecc46acc88dbc900bf6257c191703471354e504f4690cf62f1')
 validpgpkeys=('B76CD4671C0968BAA87DE61C5E50715BF2FFE1A7') # Pieter Lexis <pieter.lexis at powerdns.com>
 
+prepare() {
+  cd pdns-recursor-${pkgver}
+  patch -p1 < "${srcdir}/pdns-recursor-4.0.3-boost-context.patch"
+}
+
 build() {
   cd pdns-recursor-${pkgver}
   ./configure \

Added: pdns-recursor-4.0.3-boost-context.patch
===================================================================
--- pdns-recursor-4.0.3-boost-context.patch	                        (rev 0)
+++ pdns-recursor-4.0.3-boost-context.patch	2016-10-21 14:45:52 UTC (rev 192872)
@@ -0,0 +1,151 @@
+diff -ruw pdns-recursor-4.0.3.orig/mtasker_fcontext.cc pdns-recursor-4.0.3/mtasker_fcontext.cc
+--- pdns-recursor-4.0.3.orig/mtasker_fcontext.cc	2016-09-06 14:50:29.000000000 +0200
++++ pdns-recursor-4.0.3/mtasker_fcontext.cc	2016-10-21 14:22:44.838171541 +0200
+@@ -23,14 +23,15 @@
+ #include <exception>
+ #include <cassert>
+ #include <type_traits>
+-#if BOOST_VERSION > 106100
+-#include <boost/context/detail/fcontext.hpp>
+-#else
+-#include <boost/context/fcontext.hpp>
+-#endif
+ #include <boost/version.hpp>
+-
++#if BOOST_VERSION < 106100
++#include <boost/context/fcontext.hpp>
+ using boost::context::make_fcontext;
++#else
++#include <boost/context/detail/fcontext.hpp>
++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 @@
+     }
+ }
+ #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<fcontext_t>::value,
+                "Boost Context has changed the fcontext_t type again :-(");
+@@ -72,7 +80,9 @@
+  * 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<void(void)>* work = nullptr;
+ };
+@@ -80,7 +90,11 @@
+ 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 @@
+      * the behaviour of the System V implementation, which can inherently only
+      * be passed ints and pointers.
+      */
++#if BOOST_VERSION < 106100
+     auto args = reinterpret_cast<args_t*>(xargs);
++#else
++    auto args = reinterpret_cast<args_t*>(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<fcontext_t*>(&ctx->uc_mcontext),
+                    static_cast<fcontext_t>(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<fcontext_t*>(res.data);
++      *ptr = res.fctx;
++    }
++#endif
+     args = nullptr;
+ 
+     try {
+@@ -106,9 +137,14 @@
+ 
+     /* Emulate the System V uc_link feature. */
+     auto const next_ctx = ctx->uc_link->uc_mcontext;
++#if BOOST_VERSION < 106100
+     jump_fcontext (reinterpret_cast<fcontext_t*>(&ctx->uc_mcontext),
+                    static_cast<fcontext_t>(next_ctx),
+                    static_cast<bool>(ctx->exception));
++#else
++    jump_fcontext (static_cast<fcontext_t>(next_ctx), 0);
++#endif
++
+ #ifdef NDEBUG
+     __builtin_unreachable();
+ #endif
+@@ -129,10 +165,27 @@
+ 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<fcontext_t*>(&octx.uc_mcontext),
+                        static_cast<fcontext_t>(ctx.uc_mcontext), 0)) {
+         std::rethrow_exception (ctx.exception);
+     }
++#else
++  transfer_t res = jump_fcontext (static_cast<fcontext_t>(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<fcontext_t*>(res.data);
++    *ptr = res.fctx;
++  }
++  if (ctx.exception) {
++    std::rethrow_exception (ctx.exception);
++  }
++#endif
+ }
+ 
+ void
+@@ -146,7 +199,15 @@
+     args_t args;
+     args.self = &ctx;
+     args.work = &start;
++    /* jumping to threadwrapper */
++#if BOOST_VERSION < 106100
+     jump_fcontext (reinterpret_cast<fcontext_t*>(&args.prev_ctx),
+                    static_cast<fcontext_t>(ctx.uc_mcontext),
+                    reinterpret_cast<intptr_t>(&args));
++#else
++    transfer_t res = jump_fcontext (static_cast<fcontext_t>(ctx.uc_mcontext),
++                                    &args);
++    /* back from threadwrapper, updating the context */
++    ctx.uc_mcontext = res.fctx;
++#endif
+ }



More information about the arch-commits mailing list