summaryrefslogtreecommitdiff
path: root/dev-libs/jemalloc/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-libs/jemalloc/files
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-libs/jemalloc/files')
-rw-r--r--dev-libs/jemalloc/files/jemalloc-2.2.1-no-pprof.patch24
-rw-r--r--dev-libs/jemalloc/files/jemalloc-2.2.5_fix_html_install.patch12
-rw-r--r--dev-libs/jemalloc/files/jemalloc-3.0.0-no-pprof.patch27
-rw-r--r--dev-libs/jemalloc/files/jemalloc-3.0.0-strip-optimization.patch29
-rw-r--r--dev-libs/jemalloc/files/jemalloc-3.0.0_fix_html_install.patch14
-rw-r--r--dev-libs/jemalloc/files/jemalloc-3.5.1-no-pprof.patch25
-rw-r--r--dev-libs/jemalloc/files/jemalloc-3.5.1-strip-optimization.patch27
-rw-r--r--dev-libs/jemalloc/files/jemalloc-3.5.1_fix_html_install.patch12
-rw-r--r--dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch70
-rw-r--r--dev-libs/jemalloc/files/jemalloc-4.2-issue_399.patch26
-rw-r--r--dev-libs/jemalloc/files/jemalloc-4.2-issue_443.patch58
-rw-r--r--dev-libs/jemalloc/files/jemalloc-4.5.0-fix_html_install.patch25
-rw-r--r--dev-libs/jemalloc/files/jemalloc-4.5.0-strip-optimization.patch35
-rw-r--r--dev-libs/jemalloc/files/jemalloc-5.0.1-strip-optimization.patch26
-rw-r--r--dev-libs/jemalloc/files/jemalloc-strip-optimization.patch25
15 files changed, 435 insertions, 0 deletions
diff --git a/dev-libs/jemalloc/files/jemalloc-2.2.1-no-pprof.patch b/dev-libs/jemalloc/files/jemalloc-2.2.1-no-pprof.patch
new file mode 100644
index 000000000000..e10aab4d4f38
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-2.2.1-no-pprof.patch
@@ -0,0 +1,24 @@
+--- a/Makefile.in 2011-04-11 10:42:32.084403330 -0500
++++ b/Makefile.in 2011-04-11 10:43:23.490760665 -0500
+@@ -42,7 +42,6 @@
+ endif
+
+ # Lists of files.
+-BINS := @srcroot@bin/pprof
+ CHDRS := @objroot@include/jemalloc/jemalloc@install_suffix@.h \
+ @objroot@include/jemalloc/jemalloc_defs@install_suffix@.h
+ CSRCS := @srcroot@src/jemalloc.c @srcroot@src/arena.c @srcroot@src/atomic.c \
+@@ -141,13 +140,6 @@
+ $(CC) -o $@ $< -L@objroot@lib -ljemalloc@install_suffix@
+ endif
+
+-install_bin:
+- install -d $(BINDIR)
+- @for b in $(BINS); do \
+- echo "install -m 755 $$b $(BINDIR)"; \
+- install -m 755 $$b $(BINDIR); \
+-done
+-
+ install_include:
+ install -d $(INCLUDEDIR)/jemalloc
+ @for h in $(CHDRS); do \
diff --git a/dev-libs/jemalloc/files/jemalloc-2.2.5_fix_html_install.patch b/dev-libs/jemalloc/files/jemalloc-2.2.5_fix_html_install.patch
new file mode 100644
index 000000000000..aff4add8b3fe
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-2.2.5_fix_html_install.patch
@@ -0,0 +1,12 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -176,7 +176,7 @@
+ install -m 644 $$d $(MANDIR)/man3; \
+ done
+
+-install_doc: install_html install_man
++install_doc: install_man
+
+ install: install_bin install_include install_lib install_doc
+
+
diff --git a/dev-libs/jemalloc/files/jemalloc-3.0.0-no-pprof.patch b/dev-libs/jemalloc/files/jemalloc-3.0.0-no-pprof.patch
new file mode 100644
index 000000000000..c2fa815ec529
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-3.0.0-no-pprof.patch
@@ -0,0 +1,27 @@
+diff --git a/Makefile.in b/Makefile.in
+index 6675b59..ce0782f 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -69,7 +69,6 @@ endif
+ LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix)
+
+ # Lists of files.
+-BINS := $(srcroot)bin/pprof $(objroot)bin/jemalloc.sh
+ CHDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h \
+ $(objroot)include/jemalloc/jemalloc_defs$(install_suffix).h
+ CSRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c $(srcroot)src/atomic.c \
+@@ -196,13 +195,6 @@ build_lib_shared: $(DSOS)
+ build_lib_static: $(STATIC_LIBS)
+ build: build_lib_shared build_lib_static
+
+-install_bin:
+- install -d $(BINDIR)
+- @for b in $(BINS); do \
+- echo "install -m 755 $$b $(BINDIR)"; \
+- install -m 755 $$b $(BINDIR); \
+-done
+-
+ install_include:
+ install -d $(INCLUDEDIR)/jemalloc
+ @for h in $(CHDRS); do \
+
diff --git a/dev-libs/jemalloc/files/jemalloc-3.0.0-strip-optimization.patch b/dev-libs/jemalloc/files/jemalloc-3.0.0-strip-optimization.patch
new file mode 100644
index 000000000000..98c09af6277f
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-3.0.0-strip-optimization.patch
@@ -0,0 +1,29 @@
+diff --git a/configure.ac b/configure.ac
+index a72019e..e366e1c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -556,23 +556,6 @@ if test "x$enable_debug" = "x1" ; then
+ fi
+ AC_SUBST([enable_debug])
+
+-dnl Only optimize if not debugging.
+-if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
+- dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
+- optimize="no"
+- echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes"
+- if test "x${optimize}" = "xyes" ; then
+- if test "x$GCC" = "xyes" ; then
+- JE_CFLAGS_APPEND([-O3])
+- JE_CFLAGS_APPEND([-funroll-loops])
+- elif test "x$je_cv_msvc" = "xyes" ; then
+- JE_CFLAGS_APPEND([-O2])
+- else
+- JE_CFLAGS_APPEND([-O])
+- fi
+- fi
+-fi
+-
+ dnl Enable statistics calculation by default.
+ AC_ARG_ENABLE([stats],
+ [AS_HELP_STRING([--disable-stats],
+
diff --git a/dev-libs/jemalloc/files/jemalloc-3.0.0_fix_html_install.patch b/dev-libs/jemalloc/files/jemalloc-3.0.0_fix_html_install.patch
new file mode 100644
index 000000000000..0f3026d44c2b
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-3.0.0_fix_html_install.patch
@@ -0,0 +1,14 @@
+diff --git a/Makefile.in b/Makefile.in
+index 6675b59..3032c6d 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -240,7 +240,7 @@ install_doc_man:
+ install -m 644 $$d $(MANDIR)/man3; \
+ done
+
+-install_doc: install_doc_html install_doc_man
++install_doc: install_doc_man
+
+ install: install_bin install_include install_lib install_doc
+
+
diff --git a/dev-libs/jemalloc/files/jemalloc-3.5.1-no-pprof.patch b/dev-libs/jemalloc/files/jemalloc-3.5.1-no-pprof.patch
new file mode 100644
index 000000000000..30cbd501ec5d
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-3.5.1-no-pprof.patch
@@ -0,0 +1,25 @@
+diff -urN a/Makefile.in b/Makefile.in
+--- a/Makefile.in 2014-02-25 18:49:15.000000000 -0600
++++ b/Makefile.in 2014-03-07 18:24:10.978141932 -0600
+@@ -73,7 +73,6 @@
+ LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix)
+
+ # Lists of files.
+-BINS := $(srcroot)bin/pprof $(objroot)bin/jemalloc.sh
+ C_HDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h
+ C_SRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c \
+ $(srcroot)src/atomic.c $(srcroot)src/base.c $(srcroot)src/bitmap.c \
+@@ -273,13 +272,6 @@
+ build_lib_static: $(STATIC_LIBS)
+ build_lib: build_lib_shared build_lib_static
+
+-install_bin:
+- install -d $(BINDIR)
+- @for b in $(BINS); do \
+- echo "install -m 755 $$b $(BINDIR)"; \
+- install -m 755 $$b $(BINDIR); \
+-done
+-
+ install_include:
+ install -d $(INCLUDEDIR)/jemalloc
+ @for h in $(C_HDRS); do \
diff --git a/dev-libs/jemalloc/files/jemalloc-3.5.1-strip-optimization.patch b/dev-libs/jemalloc/files/jemalloc-3.5.1-strip-optimization.patch
new file mode 100644
index 000000000000..cc8736b84123
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-3.5.1-strip-optimization.patch
@@ -0,0 +1,27 @@
+diff -urN a/configure.ac b/configure.ac
+--- a/configure.ac 2014-02-25 18:49:15.000000000 -0600
++++ b/configure.ac 2014-03-07 18:19:53.718147847 -0600
+@@ -639,23 +639,6 @@
+ AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
+ fi
+
+-dnl Only optimize if not debugging.
+-if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
+- dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
+- optimize="no"
+- echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || optimize="yes"
+- if test "x${optimize}" = "xyes" ; then
+- if test "x$GCC" = "xyes" ; then
+- JE_CFLAGS_APPEND([-O3])
+- JE_CFLAGS_APPEND([-funroll-loops])
+- elif test "x$je_cv_msvc" = "xyes" ; then
+- JE_CFLAGS_APPEND([-O2])
+- else
+- JE_CFLAGS_APPEND([-O])
+- fi
+- fi
+-fi
+-
+ dnl Enable statistics calculation by default.
+ AC_ARG_ENABLE([stats],
+ [AS_HELP_STRING([--disable-stats],
diff --git a/dev-libs/jemalloc/files/jemalloc-3.5.1_fix_html_install.patch b/dev-libs/jemalloc/files/jemalloc-3.5.1_fix_html_install.patch
new file mode 100644
index 000000000000..1ce5ad2ede95
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-3.5.1_fix_html_install.patch
@@ -0,0 +1,12 @@
+diff -urN a/Makefile.in b/Makefile.in
+--- a/Makefile.in 2014-02-25 18:49:15.000000000 -0600
++++ b/Makefile.in 2014-03-07 18:26:23.074138895 -0600
+@@ -317,7 +317,7 @@
+ install -m 644 $$d $(MANDIR)/man3; \
+ done
+
+-install_doc: install_doc_html install_doc_man
++install_doc: install_doc_man
+
+ install: install_bin install_include install_lib install_doc
+
diff --git a/dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch b/dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch
new file mode 100644
index 000000000000..f36c188616e8
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-4.1-fix_stack_corruption.patch
@@ -0,0 +1,70 @@
+From 33184bf69813087bf1885b0993685f9d03320c69 Mon Sep 17 00:00:00 2001
+From: Dmitri Smirnov <dmitrism@microsoft.com>
+Date: Mon, 29 Feb 2016 14:30:19 -0800
+Subject: [PATCH] Fix stack corruption and uninitialized var warning
+
+Stack corruption happens in x64 bit
+
+This resolves #347.
+---
+ src/arena.c | 2 +-
+ test/unit/hash.c | 13 +++++++------
+ 2 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/src/arena.c b/src/arena.c
+index 99e20fd..965c0fe 100644
+--- a/src/arena.c
++++ b/src/arena.c
+@@ -2423,7 +2423,7 @@ arena_malloc_large(tsd_t *tsd, arena_t *arena, szind_t binind, bool zero)
+ uintptr_t random_offset;
+ arena_run_t *run;
+ arena_chunk_map_misc_t *miscelm;
+- UNUSED bool idump;
++ UNUSED bool idump JEMALLOC_CC_SILENCE_INIT(false);
+
+ /* Large allocation. */
+ usize = index2size(binind);
+diff --git a/test/unit/hash.c b/test/unit/hash.c
+index f50ba81..010c9d7 100644
+--- a/test/unit/hash.c
++++ b/test/unit/hash.c
+@@ -64,14 +64,15 @@ static void
+ hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
+ {
+ const int hashbytes = hash_variant_bits(variant) / 8;
+- VARIABLE_ARRAY(uint8_t, hashes, hashbytes * 256);
++ const int hashes_size = hashbytes * 256;
++ VARIABLE_ARRAY(uint8_t, hashes, hashes_size);
+ VARIABLE_ARRAY(uint8_t, final, hashbytes);
+ unsigned i;
+ uint32_t computed, expected;
+
+ memset(key, 0, KEY_SIZE);
+- memset(hashes, 0, sizeof(hashes));
+- memset(final, 0, sizeof(final));
++ memset(hashes, 0, hashes_size);
++ memset(final, 0, hashbytes);
+
+ /*
+ * Hash keys of the form {0}, {0,1}, {0,1,2}, ..., {0,1,...,255} as the
+@@ -102,17 +103,17 @@ hash_variant_verify_key(hash_variant_t variant, uint8_t *key)
+ /* Hash the result array. */
+ switch (variant) {
+ case hash_variant_x86_32: {
+- uint32_t out = hash_x86_32(hashes, hashbytes*256, 0);
++ uint32_t out = hash_x86_32(hashes, hashes_size, 0);
+ memcpy(final, &out, sizeof(out));
+ break;
+ } case hash_variant_x86_128: {
+ uint64_t out[2];
+- hash_x86_128(hashes, hashbytes*256, 0, out);
++ hash_x86_128(hashes, hashes_size, 0, out);
+ memcpy(final, out, sizeof(out));
+ break;
+ } case hash_variant_x64_128: {
+ uint64_t out[2];
+- hash_x64_128(hashes, hashbytes*256, 0, out);
++ hash_x64_128(hashes, hashes_size, 0, out);
+ memcpy(final, out, sizeof(out));
+ break;
+ } default: not_reached();
diff --git a/dev-libs/jemalloc/files/jemalloc-4.2-issue_399.patch b/dev-libs/jemalloc/files/jemalloc-4.2-issue_399.patch
new file mode 100644
index 000000000000..da9f2d8ad771
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-4.2-issue_399.patch
@@ -0,0 +1,26 @@
+From 3c8c3e9e9b59b6e34a222816a05f0a01a68919b3 Mon Sep 17 00:00:00 2001
+From: Jason Evans <jasone@canonware.com>
+Date: Mon, 26 Sep 2016 15:55:40 -0700
+Subject: [PATCH] Close file descriptor after reading
+ "/proc/sys/vm/overcommit_memory".
+
+This bug was introduced by c2f970c32b527660a33fa513a76d913c812dcf7c
+(Modify pages_map() to support mapping uncommitted virtual memory.).
+
+This resolves #399.
+---
+ src/pages.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pages.c b/src/pages.c
+index 2a9b7e3..05b0d69 100644
+--- a/src/pages.c
++++ b/src/pages.c
+@@ -219,6 +219,7 @@ os_overcommits_proc(void)
+ return (false); /* Error. */
+
+ nread = read(fd, &buf, sizeof(buf));
++ close(fd);
+ if (nread < 1)
+ return (false); /* Error. */
+ /*
diff --git a/dev-libs/jemalloc/files/jemalloc-4.2-issue_443.patch b/dev-libs/jemalloc/files/jemalloc-4.2-issue_443.patch
new file mode 100644
index 000000000000..d2b065a3b6e0
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-4.2-issue_443.patch
@@ -0,0 +1,58 @@
+From c443b67561891ae68d688daf5f8ce37820cdba2b Mon Sep 17 00:00:00 2001
+From: Jason Evans <jasone@canonware.com>
+Date: Sat, 29 Oct 2016 22:41:04 -0700
+Subject: [PATCH] Use syscall(2) rather than {open,read,close}(2) during boot.
+
+Some applications wrap various system calls, and if they call the
+allocator in their wrappers, unexpected reentry can result. This is not
+a general solution (many other syscalls are spread throughout the code),
+but this resolves a bootstrapping issue that is apparently common.
+
+This resolves #443.
+---
+ src/pages.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/src/pages.c b/src/pages.c
+index 05b0d69..84e2216 100644
+--- a/src/pages.c
++++ b/src/pages.c
+@@ -207,6 +207,11 @@ os_overcommits_sysctl(void)
+ #endif
+
+ #ifdef JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY
++/*
++ * Use syscall(2) rather than {open,read,close}(2) when possible to avoid
++ * reentry during bootstrapping if another library has interposed system call
++ * wrappers.
++ */
+ static bool
+ os_overcommits_proc(void)
+ {
+@@ -214,12 +219,26 @@ os_overcommits_proc(void)
+ char buf[1];
+ ssize_t nread;
+
++#ifdef SYS_open
++ fd = (int)syscall(SYS_open, "/proc/sys/vm/overcommit_memory", O_RDONLY);
++#else
+ fd = open("/proc/sys/vm/overcommit_memory", O_RDONLY);
++#endif
+ if (fd == -1)
+ return (false); /* Error. */
+
++#ifdef SYS_read
++ nread = (ssize_t)syscall(SYS_read, fd, &buf, sizeof(buf));
++#else
+ nread = read(fd, &buf, sizeof(buf));
++#endif
++
++#ifdef SYS_close
++ syscall(SYS_close, fd);
++#else
+ close(fd);
++#endif
++
+ if (nread < 1)
+ return (false); /* Error. */
+ /*
diff --git a/dev-libs/jemalloc/files/jemalloc-4.5.0-fix_html_install.patch b/dev-libs/jemalloc/files/jemalloc-4.5.0-fix_html_install.patch
new file mode 100644
index 000000000000..159702e6230c
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-4.5.0-fix_html_install.patch
@@ -0,0 +1,25 @@
+From c04d0b954adef2d3f1a30d91dc687f6a03b108eb Mon Sep 17 00:00:00 2001
+From:
+Date: Mon, 29 May 2017 00:58:32 -0500
+Subject: [PATCH 2/2] Do not install html doc
+
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index e49a871..733932a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -381,7 +381,7 @@ install_doc_man:
+ $(INSTALL) -m 644 $$d $(MANDIR)/man3; \
+ done
+
+-install_doc: install_doc_html install_doc_man
++install_doc: install_doc_man
+
+ install: install_bin install_include install_lib install_doc
+
+--
+2.13.0
+
diff --git a/dev-libs/jemalloc/files/jemalloc-4.5.0-strip-optimization.patch b/dev-libs/jemalloc/files/jemalloc-4.5.0-strip-optimization.patch
new file mode 100644
index 000000000000..8b346be86c06
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-4.5.0-strip-optimization.patch
@@ -0,0 +1,35 @@
+From c568271163445e380679788388f1cb1edbdeaf88 Mon Sep 17 00:00:00 2001
+From:
+Date: Mon, 29 May 2017 00:57:15 -0500
+Subject: [PATCH 1/2] Strip all optimization, let portage handle.
+
+---
+ configure.ac | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 20a8a64..d8af618 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -851,18 +851,6 @@ if test "x$enable_ivsalloc" = "x1" ; then
+ AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
+ fi
+
+-dnl Only optimize if not debugging.
+-if test "x$enable_debug" = "x0" ; then
+- if test "x$GCC" = "xyes" ; then
+- JE_CFLAGS_ADD([-O3])
+- JE_CFLAGS_ADD([-funroll-loops])
+- elif test "x$je_cv_msvc" = "xyes" ; then
+- JE_CFLAGS_ADD([-O2])
+- else
+- JE_CFLAGS_ADD([-O])
+- fi
+-fi
+-
+ dnl Enable statistics calculation by default.
+ AC_ARG_ENABLE([stats],
+ [AS_HELP_STRING([--disable-stats],
+--
+2.13.0
+
diff --git a/dev-libs/jemalloc/files/jemalloc-5.0.1-strip-optimization.patch b/dev-libs/jemalloc/files/jemalloc-5.0.1-strip-optimization.patch
new file mode 100644
index 000000000000..523badf5775b
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-5.0.1-strip-optimization.patch
@@ -0,0 +1,26 @@
+diff --git a/configure.ac b/configure.ac
+index 1551ded8..2f470672 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -976,21 +976,6 @@ if test "x$enable_debug" = "x1" ; then
+ fi
+ AC_SUBST([enable_debug])
+
+-dnl Only optimize if not debugging.
+-if test "x$enable_debug" = "x0" ; then
+- if test "x$GCC" = "xyes" ; then
+- JE_CFLAGS_ADD([-O3])
+- JE_CXXFLAGS_ADD([-O3])
+- JE_CFLAGS_ADD([-funroll-loops])
+- elif test "x$je_cv_msvc" = "xyes" ; then
+- JE_CFLAGS_ADD([-O2])
+- JE_CXXFLAGS_ADD([-O2])
+- else
+- JE_CFLAGS_ADD([-O])
+- JE_CXXFLAGS_ADD([-O])
+- fi
+-fi
+-
+ dnl Enable statistics calculation by default.
+ AC_ARG_ENABLE([stats],
+ [AS_HELP_STRING([--disable-stats],
diff --git a/dev-libs/jemalloc/files/jemalloc-strip-optimization.patch b/dev-libs/jemalloc/files/jemalloc-strip-optimization.patch
new file mode 100644
index 000000000000..60b7d6c22ff1
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-strip-optimization.patch
@@ -0,0 +1,25 @@
+--- a/configure.ac 2010-02-22 12:07:05.000000000 +0100
++++ b/configure.ac 2010-02-22 12:08:29.000000000 +0100
+@@ -296,21 +296,6 @@
+ fi
+ AC_SUBST([enable_debug])
+
+-dnl Only optimize if not debugging.
+-if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
+- dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
+- optimize="no"
+- echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes"
+- if test "x${optimize}" = "xyes" ; then
+- if test "x$GCC" = "xyes" ; then
+- JE_CFLAGS_APPEND([-O3])
+- JE_CFLAGS_APPEND([-funroll-loops])
+- else
+- JE_CFLAGS_APPEND([-O])
+- fi
+- fi
+-fi
+-
+ dnl Do not enable statistics calculation by default.
+ AC_ARG_ENABLE([stats],
+ [AS_HELP_STRING([--enable-stats], [Enable statistics calculation/reporting])],
+