Date: Thursday, June 15, 2017 @ 14:16:09
  Author: eworm
Revision: 298865

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  jemalloc/repos/testing-i686/0001-only-abort-on-dlsym-when-necessary.patch
    (from rev 298864, 
jemalloc/trunk/0001-only-abort-on-dlsym-when-necessary.patch)
  jemalloc/repos/testing-i686/PKGBUILD
    (from rev 298864, jemalloc/trunk/PKGBUILD)
  jemalloc/repos/testing-x86_64/0001-only-abort-on-dlsym-when-necessary.patch
    (from rev 298864, 
jemalloc/trunk/0001-only-abort-on-dlsym-when-necessary.patch)
  jemalloc/repos/testing-x86_64/PKGBUILD
    (from rev 298864, jemalloc/trunk/PKGBUILD)
Deleted:
  jemalloc/repos/testing-i686/PKGBUILD
  jemalloc/repos/testing-x86_64/PKGBUILD

--------------------------------------------------------------+
 /PKGBUILD                                                    |   74 +++++++++
 testing-i686/0001-only-abort-on-dlsym-when-necessary.patch   |   75 ++++++++++
 testing-i686/PKGBUILD                                        |   30 ----
 testing-x86_64/0001-only-abort-on-dlsym-when-necessary.patch |   75 ++++++++++
 testing-x86_64/PKGBUILD                                      |   30 ----
 5 files changed, 224 insertions(+), 60 deletions(-)

Copied: 
jemalloc/repos/testing-i686/0001-only-abort-on-dlsym-when-necessary.patch (from 
rev 298864, jemalloc/trunk/0001-only-abort-on-dlsym-when-necessary.patch)
===================================================================
--- testing-i686/0001-only-abort-on-dlsym-when-necessary.patch                  
        (rev 0)
+++ testing-i686/0001-only-abort-on-dlsym-when-necessary.patch  2017-06-15 
14:16:09 UTC (rev 298865)
@@ -0,0 +1,75 @@
+From a4d6fe73cf07b3be3af6b7811cfc5950320bb37f Mon Sep 17 00:00:00 2001
+From: Qi Wang <[email protected]>
+Date: Wed, 14 Jun 2017 12:12:23 -0700
+Subject: [PATCH] Only abort on dlsym when necessary.
+
+If neither background_thread nor lazy_lock is in use, do not abort on dlsym
+errors.
+---
+ include/jemalloc/internal/background_thread_externs.h |  1 +
+ src/background_thread.c                               | 14 +++++++++++---
+ src/ctl.c                                             |  7 +++++++
+ 3 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/include/jemalloc/internal/background_thread_externs.h 
b/include/jemalloc/internal/background_thread_externs.h
+index 7c883697..8b4b8471 100644
+--- a/include/jemalloc/internal/background_thread_externs.h
++++ b/include/jemalloc/internal/background_thread_externs.h
+@@ -6,6 +6,7 @@ extern malloc_mutex_t background_thread_lock;
+ extern atomic_b_t background_thread_enabled_state;
+ extern size_t n_background_threads;
+ extern background_thread_info_t *background_thread_info;
++extern bool can_enable_background_thread;
+ 
+ bool background_thread_create(tsd_t *tsd, unsigned arena_ind);
+ bool background_threads_enable(tsd_t *tsd);
+diff --git a/src/background_thread.c b/src/background_thread.c
+index a7403b85..1ff59447 100644
+--- a/src/background_thread.c
++++ b/src/background_thread.c
+@@ -20,6 +20,9 @@ size_t n_background_threads;
+ /* Thread info per-index. */
+ background_thread_info_t *background_thread_info;
+ 
++/* False if no necessary runtime support. */
++bool can_enable_background_thread;
++
+ 
/******************************************************************************/
+ 
+ #ifdef JEMALLOC_PTHREAD_CREATE_WRAPPER
+@@ -785,9 +788,14 @@ background_thread_boot0(void) {
+ #ifdef JEMALLOC_PTHREAD_CREATE_WRAPPER
+       pthread_create_fptr = dlsym(RTLD_NEXT, "pthread_create");
+       if (pthread_create_fptr == NULL) {
+-              malloc_write("<jemalloc>: Error in dlsym(RTLD_NEXT, "
+-                  "\"pthread_create\")\n");
+-              abort();
++              can_enable_background_thread = false;
++              if (config_lazy_lock || opt_background_thread) {
++                      malloc_write("<jemalloc>: Error in dlsym(RTLD_NEXT, "
++                          "\"pthread_create\")\n");
++                      abort();
++              }
++      } else {
++              can_enable_background_thread = true;
+       }
+ #endif
+       return false;
+diff --git a/src/ctl.c b/src/ctl.c
+index b3ae4aab..f1310cdf 100644
+--- a/src/ctl.c
++++ b/src/ctl.c
+@@ -1522,6 +1522,13 @@ background_thread_ctl(tsd_t *tsd, const size_t *mib, 
size_t miblen,
+ 
+               background_thread_enabled_set(tsd_tsdn(tsd), newval);
+               if (newval) {
++                      if (!can_enable_background_thread) {
++                              malloc_printf("<jemalloc>: Error in dlsym("
++                                  "RTLD_NEXT, \"pthread_create\"). Cannot "
++                                  "enable background_thread\n");
++                              ret = EFAULT;
++                              goto label_return;
++                      }
+                       if (background_threads_enable(tsd)) {
+                               ret = EFAULT;
+                               goto label_return;

Deleted: testing-i686/PKGBUILD
===================================================================
--- testing-i686/PKGBUILD       2017-06-15 14:16:04 UTC (rev 298864)
+++ testing-i686/PKGBUILD       2017-06-15 14:16:09 UTC (rev 298865)
@@ -1,30 +0,0 @@
-# $Id$
-# Maintainer:  Bartłomiej Piotrowski <[email protected]>
-# Contributor: Massimiliano Torromeo <[email protected]>
-# Contributor: Kovivchak Evgen <[email protected]>
-
-pkgname=jemalloc
-pkgver=5.0.0
-pkgrel=1
-pkgdesc='General-purpose scalable concurrent malloc implementation'
-arch=('i686' 'x86_64')
-license=('BSD')
-url='http://www.canonware.com/jemalloc/'
-depends=('glibc')
-provides=('libjemalloc.so')
-optdepends=('perl: for jeprof')
-source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2";)
-sha256sums=('9e4a9efba7dc4a7696f247c90c3fe89696de5f910f7deacf7e22ec521b1fa810')
-
-build() {
-  cd $pkgname-$pkgver
-  ./configure --prefix=/usr
-  make
-}
-
-package() {
-  cd $pkgname-$pkgver
-  make DESTDIR="$pkgdir" install
-  find "$pkgdir" -name \*.a -type f -exec chmod 644 '{}' \;
-  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
-}

Copied: jemalloc/repos/testing-i686/PKGBUILD (from rev 298864, 
jemalloc/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD                               (rev 0)
+++ testing-i686/PKGBUILD       2017-06-15 14:16:09 UTC (rev 298865)
@@ -0,0 +1,37 @@
+# $Id$
+# Maintainer:  Bartłomiej Piotrowski <[email protected]>
+# Contributor: Massimiliano Torromeo <[email protected]>
+# Contributor: Kovivchak Evgen <[email protected]>
+
+pkgname=jemalloc
+pkgver=5.0.0
+pkgrel=2
+pkgdesc='General-purpose scalable concurrent malloc implementation'
+arch=('i686' 'x86_64')
+license=('BSD')
+url='http://www.canonware.com/jemalloc/'
+depends=('glibc')
+provides=('libjemalloc.so')
+optdepends=('perl: for jeprof')
+source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2";
+        '0001-only-abort-on-dlsym-when-necessary.patch')
+sha256sums=('9e4a9efba7dc4a7696f247c90c3fe89696de5f910f7deacf7e22ec521b1fa810'
+            'ef8b3afd9f7e8ee871bf6b228b0f9288881f6cc0243478bab727ba02eb2776e0')
+
+prepare() {
+  cd $pkgname-$pkgver
+  patch -Np1 < "$srcdir"/0001-only-abort-on-dlsym-when-necessary.patch
+}
+
+build() {
+  cd $pkgname-$pkgver
+  ./configure --prefix=/usr
+  make
+}
+
+package() {
+  cd $pkgname-$pkgver
+  make DESTDIR="$pkgdir" install
+  find "$pkgdir" -name \*.a -type f -exec chmod 644 '{}' \;
+  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
+}

Copied: 
jemalloc/repos/testing-x86_64/0001-only-abort-on-dlsym-when-necessary.patch 
(from rev 298864, jemalloc/trunk/0001-only-abort-on-dlsym-when-necessary.patch)
===================================================================
--- testing-x86_64/0001-only-abort-on-dlsym-when-necessary.patch                
                (rev 0)
+++ testing-x86_64/0001-only-abort-on-dlsym-when-necessary.patch        
2017-06-15 14:16:09 UTC (rev 298865)
@@ -0,0 +1,75 @@
+From a4d6fe73cf07b3be3af6b7811cfc5950320bb37f Mon Sep 17 00:00:00 2001
+From: Qi Wang <[email protected]>
+Date: Wed, 14 Jun 2017 12:12:23 -0700
+Subject: [PATCH] Only abort on dlsym when necessary.
+
+If neither background_thread nor lazy_lock is in use, do not abort on dlsym
+errors.
+---
+ include/jemalloc/internal/background_thread_externs.h |  1 +
+ src/background_thread.c                               | 14 +++++++++++---
+ src/ctl.c                                             |  7 +++++++
+ 3 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/include/jemalloc/internal/background_thread_externs.h 
b/include/jemalloc/internal/background_thread_externs.h
+index 7c883697..8b4b8471 100644
+--- a/include/jemalloc/internal/background_thread_externs.h
++++ b/include/jemalloc/internal/background_thread_externs.h
+@@ -6,6 +6,7 @@ extern malloc_mutex_t background_thread_lock;
+ extern atomic_b_t background_thread_enabled_state;
+ extern size_t n_background_threads;
+ extern background_thread_info_t *background_thread_info;
++extern bool can_enable_background_thread;
+ 
+ bool background_thread_create(tsd_t *tsd, unsigned arena_ind);
+ bool background_threads_enable(tsd_t *tsd);
+diff --git a/src/background_thread.c b/src/background_thread.c
+index a7403b85..1ff59447 100644
+--- a/src/background_thread.c
++++ b/src/background_thread.c
+@@ -20,6 +20,9 @@ size_t n_background_threads;
+ /* Thread info per-index. */
+ background_thread_info_t *background_thread_info;
+ 
++/* False if no necessary runtime support. */
++bool can_enable_background_thread;
++
+ 
/******************************************************************************/
+ 
+ #ifdef JEMALLOC_PTHREAD_CREATE_WRAPPER
+@@ -785,9 +788,14 @@ background_thread_boot0(void) {
+ #ifdef JEMALLOC_PTHREAD_CREATE_WRAPPER
+       pthread_create_fptr = dlsym(RTLD_NEXT, "pthread_create");
+       if (pthread_create_fptr == NULL) {
+-              malloc_write("<jemalloc>: Error in dlsym(RTLD_NEXT, "
+-                  "\"pthread_create\")\n");
+-              abort();
++              can_enable_background_thread = false;
++              if (config_lazy_lock || opt_background_thread) {
++                      malloc_write("<jemalloc>: Error in dlsym(RTLD_NEXT, "
++                          "\"pthread_create\")\n");
++                      abort();
++              }
++      } else {
++              can_enable_background_thread = true;
+       }
+ #endif
+       return false;
+diff --git a/src/ctl.c b/src/ctl.c
+index b3ae4aab..f1310cdf 100644
+--- a/src/ctl.c
++++ b/src/ctl.c
+@@ -1522,6 +1522,13 @@ background_thread_ctl(tsd_t *tsd, const size_t *mib, 
size_t miblen,
+ 
+               background_thread_enabled_set(tsd_tsdn(tsd), newval);
+               if (newval) {
++                      if (!can_enable_background_thread) {
++                              malloc_printf("<jemalloc>: Error in dlsym("
++                                  "RTLD_NEXT, \"pthread_create\"). Cannot "
++                                  "enable background_thread\n");
++                              ret = EFAULT;
++                              goto label_return;
++                      }
+                       if (background_threads_enable(tsd)) {
+                               ret = EFAULT;
+                               goto label_return;

Deleted: testing-x86_64/PKGBUILD
===================================================================
--- testing-x86_64/PKGBUILD     2017-06-15 14:16:04 UTC (rev 298864)
+++ testing-x86_64/PKGBUILD     2017-06-15 14:16:09 UTC (rev 298865)
@@ -1,30 +0,0 @@
-# $Id$
-# Maintainer:  Bartłomiej Piotrowski <[email protected]>
-# Contributor: Massimiliano Torromeo <[email protected]>
-# Contributor: Kovivchak Evgen <[email protected]>
-
-pkgname=jemalloc
-pkgver=5.0.0
-pkgrel=1
-pkgdesc='General-purpose scalable concurrent malloc implementation'
-arch=('i686' 'x86_64')
-license=('BSD')
-url='http://www.canonware.com/jemalloc/'
-depends=('glibc')
-provides=('libjemalloc.so')
-optdepends=('perl: for jeprof')
-source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2";)
-sha256sums=('9e4a9efba7dc4a7696f247c90c3fe89696de5f910f7deacf7e22ec521b1fa810')
-
-build() {
-  cd $pkgname-$pkgver
-  ./configure --prefix=/usr
-  make
-}
-
-package() {
-  cd $pkgname-$pkgver
-  make DESTDIR="$pkgdir" install
-  find "$pkgdir" -name \*.a -type f -exec chmod 644 '{}' \;
-  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
-}

Copied: jemalloc/repos/testing-x86_64/PKGBUILD (from rev 298864, 
jemalloc/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD                             (rev 0)
+++ testing-x86_64/PKGBUILD     2017-06-15 14:16:09 UTC (rev 298865)
@@ -0,0 +1,37 @@
+# $Id$
+# Maintainer:  Bartłomiej Piotrowski <[email protected]>
+# Contributor: Massimiliano Torromeo <[email protected]>
+# Contributor: Kovivchak Evgen <[email protected]>
+
+pkgname=jemalloc
+pkgver=5.0.0
+pkgrel=2
+pkgdesc='General-purpose scalable concurrent malloc implementation'
+arch=('i686' 'x86_64')
+license=('BSD')
+url='http://www.canonware.com/jemalloc/'
+depends=('glibc')
+provides=('libjemalloc.so')
+optdepends=('perl: for jeprof')
+source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2";
+        '0001-only-abort-on-dlsym-when-necessary.patch')
+sha256sums=('9e4a9efba7dc4a7696f247c90c3fe89696de5f910f7deacf7e22ec521b1fa810'
+            'ef8b3afd9f7e8ee871bf6b228b0f9288881f6cc0243478bab727ba02eb2776e0')
+
+prepare() {
+  cd $pkgname-$pkgver
+  patch -Np1 < "$srcdir"/0001-only-abort-on-dlsym-when-necessary.patch
+}
+
+build() {
+  cd $pkgname-$pkgver
+  ./configure --prefix=/usr
+  make
+}
+
+package() {
+  cd $pkgname-$pkgver
+  make DESTDIR="$pkgdir" install
+  find "$pkgdir" -name \*.a -type f -exec chmod 644 '{}' \;
+  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
+}

Reply via email to