summaryrefslogtreecommitdiff
path: root/dev-libs/jemalloc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-20 06:36:29 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-20 06:36:29 +0000
commit4c60e3b3235bcc7f291760881f8b40660a518471 (patch)
treee0495f40b57545a8c3ef6cf23c7717e6621e7885 /dev-libs/jemalloc
parent84be07a71d5002585ac714a892bbfd57f3091b4e (diff)
gentoo auto-resync : 20:03:2023 - 06:36:29
Diffstat (limited to 'dev-libs/jemalloc')
-rw-r--r--dev-libs/jemalloc/Manifest3
-rw-r--r--dev-libs/jemalloc/files/jemalloc-5.3.0-backport-pr-2338.patch83
-rw-r--r--dev-libs/jemalloc/jemalloc-5.3.0-r1.ebuild3
3 files changed, 87 insertions, 2 deletions
diff --git a/dev-libs/jemalloc/Manifest b/dev-libs/jemalloc/Manifest
index 508bab70d3de..1d88753e1f16 100644
--- a/dev-libs/jemalloc/Manifest
+++ b/dev-libs/jemalloc/Manifest
@@ -1,5 +1,6 @@
AUX jemalloc-5.3.0-backport-pr-2312.patch 4648 BLAKE2B 5d84d64e38bdc86f3b1f07ce5c7aa8d03d1ae88a646585c331d4a921ae1bed2c2dd6f193114e0506e6806b879238148ef9eba3fd35c98dedd72cbfe307c26c41 SHA512 f890b8f696a7c299f257373d14aab2f918b665d858a5ed5656ed3e6db9e43fe3677a1b5b86610493f1eb222c5cdefeb791ee5de6c9db40681589b2260b62f83c
+AUX jemalloc-5.3.0-backport-pr-2338.patch 3716 BLAKE2B a147c7669cd5bfc0b8ba8b05f1c36704082672ae99773ddc103cabfb3e6778aa6675bdd8a76b646261b422568fba2a13970c2ac6ef9bbbaa7417da4de1b27196 SHA512 48cebc8d6b7ad2e8aeb0a18fd30763561ee2dfa8ea82db76108c19e4c7f22abb303427634fc5b3b4d7d34190a3d56e1eee6cdee96ea3517acb0041d7cb5ecf74
AUX jemalloc-5.3.0-gentoo-fixups.patch 1233 BLAKE2B 4654d1ecc2846281530b922e942dd68dcf4a4859ad087db4c5e163fd903c941b877fc2ad7e7a39b041e19ab74dc3af677132eb294394763f18f41dc9b126006f SHA512 4d1d4c22085cee554a5eaff0415c2401e528c1a496c4e06f9cc04fb8574ae19e9a271ea60cc368c3e0af65b26e72c86668a00fc38049281ac1bd79148551c142
DIST jemalloc-5.3.0.tar.bz2 736023 BLAKE2B 9ff51616c3fb086d7cc021c59b83e5f0304d886993f4b5194a6956ffaf742cc509d08a2cf81ead6966c39a44f35621b57550f4a5c726c4508fd2c86c7c056ab0 SHA512 22907bb052096e2caffb6e4e23548aecc5cc9283dce476896a2b1127eee64170e3562fa2e7db9571298814a7a2c7df6e8d1fbe152bd3f3b0c1abec22a2de34b1
-EBUILD jemalloc-5.3.0-r1.ebuild 1579 BLAKE2B 1956b1d296a8eaec4c311201835e9224d2d3cecf63fb9aa0de6ca2afca12ab625485db1ff0c9a1a299c15ddab94b6ad9b9522f537bb7096cfa85aa6d2fa0e4e3 SHA512 10aab6a63e6a925bc60742be63e132d6543a7f0bc2f59d304dfab46c197e455797a58c2ff91d44f7b06a401aa0b3ce74307cfb1a16c6f4ff1441ad30107127fe
+EBUILD jemalloc-5.3.0-r1.ebuild 1629 BLAKE2B 490b42fac36dfe930b6f7da9a8e68fd0bb34ed967bc745a7e5f8bfc50ca6553b0b6bbf8ac3600c0e51b33b0baeaeb98e3582d56d9ca60e06d9f63c45ad8cd9e6 SHA512 466b9aca95af12146ffd36cbffed1758e9fb78becb247f8ae06b42d387f67bb1de68cfbd4a3a8bdeda8513f20f80651c6757cd3cf7c9f2e7b6790407cc254e20
MISC metadata.xml 551 BLAKE2B 590d998b8a6a2fd396d73017270f833cb8144bf57ea871ade8f53dd5c65a71e76591a9ec32813ea291758f0dae118aa8d6d69321b6cec8272a608f02031ee9c8 SHA512 8b9ea77ba31e1ed4482b30f8c69bc9fc725142260fa146a2f35c60adcfecadbcc2207adae3c4e3f909e2b43c581866737ff6b03af8e99427154fb1918c81d516
diff --git a/dev-libs/jemalloc/files/jemalloc-5.3.0-backport-pr-2338.patch b/dev-libs/jemalloc/files/jemalloc-5.3.0-backport-pr-2338.patch
new file mode 100644
index 000000000000..6d4d4a11f741
--- /dev/null
+++ b/dev-libs/jemalloc/files/jemalloc-5.3.0-backport-pr-2338.patch
@@ -0,0 +1,83 @@
+Backport Musl fixes from PR #2338.
+
+Upstream PR: https://github.com/jemalloc/jemalloc/pull/2338
+Upstream commits: https://github.com/jemalloc/jemalloc/commit/45249cf5a9cfa13c2c62e68e272a391721523b4b, https://github.com/jemalloc/jemalloc/commit/aba1645f2d65a3b5c46958d7642b46ab3c142cf3
+
+From aba1645f2d65a3b5c46958d7642b46ab3c142cf3 Mon Sep 17 00:00:00 2001
+From: Marvin Schmidt <marv@exherbo.org>
+Date: Tue, 27 Sep 2022 07:03:14 +0200
+Subject: [PATCH] configure: Handle *-linux-musl* hosts properly
+
+This is the same as the `*-*-linux*` case with the two exceptions that
+we don't set glibc=1 and don't define JEMALLOC_USE_CXX_THROW
+---
+ configure.ac | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 2bbf7d54a..f38b72d64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -723,6 +723,19 @@ case "${host}" in
+ fi
+ zero_realloc_default_free="1"
+ ;;
++ *-*-linux-musl*)
++ dnl syscall(2) and secure_getenv(3) are exposed by _GNU_SOURCE.
++ JE_APPEND_VS(CPPFLAGS, -D_GNU_SOURCE)
++ abi="elf"
++ AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS], [ ], [ ])
++ AC_DEFINE([JEMALLOC_HAS_ALLOCA_H], [ ], [ ])
++ AC_DEFINE([JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY], [ ], [ ])
++ AC_DEFINE([JEMALLOC_THREADED_INIT], [ ], [ ])
++ if test "${LG_SIZEOF_PTR}" = "3"; then
++ default_retain="1"
++ fi
++ zero_realloc_default_free="1"
++ ;;
+ *-*-linux*)
+ dnl syscall(2) and secure_getenv(3) are exposed by _GNU_SOURCE.
+ JE_APPEND_VS(CPPFLAGS, -D_GNU_SOURCE)
+
+From 45249cf5a9cfa13c2c62e68e272a391721523b4b Mon Sep 17 00:00:00 2001
+From: Marvin Schmidt <marv@exherbo.org>
+Date: Tue, 27 Sep 2022 07:00:13 +0200
+Subject: [PATCH] Fix exception specification error for hosts using musl libc
+
+It turns out that the previous commit did not suffice since the
+JEMALLOC_SYS_NOTHROW definition also causes the same exception specification
+errors as JEMALLOC_USE_CXX_THROW did:
+```
+x86_64-pc-linux-musl-cc -std=gnu11 -Werror=unknown-warning-option -Wall -Wextra -Wshorten-64-to-32 -Wsign-compare -Wundef -Wno-format-zero-length -Wpointer-
+arith -Wno-missing-braces -Wno-missing-field-initializers -pipe -g3 -fvisibility=hidden -Wimplicit-fallthrough -O3 -funroll-loops -march=native -O2 -pipe -c -march=native -O2 -pipe -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/background_thread.o src/background_thread.c
+In file included from src/jemalloc_cpp.cpp:9:
+In file included from include/jemalloc/internal/jemalloc_preamble.h:27:
+include/jemalloc/internal/../jemalloc.h:254:32: error: exception specification in declaration does not match previous declaration
+ void JEMALLOC_SYS_NOTHROW *je_malloc(size_t size)
+ ^
+include/jemalloc/internal/../jemalloc.h:75:21: note: expanded from macro 'je_malloc'
+ ^
+/usr/x86_64-pc-linux-musl/include/stdlib.h:40:7: note: previous declaration is here
+void *malloc (size_t);
+ ^
+```
+
+On systems using the musl C library we have to omit the exception specification
+on malloc function family like it's done for MacOS, FreeBSD and OpenBSD.
+---
+ include/jemalloc/jemalloc_macros.h.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/jemalloc/jemalloc_macros.h.in b/include/jemalloc/jemalloc_macros.h.in
+index 2de3f27de..05d996be2 100644
+--- a/include/jemalloc/jemalloc_macros.h.in
++++ b/include/jemalloc/jemalloc_macros.h.in
+@@ -142,7 +142,7 @@
+ # define JEMALLOC_COLD
+ #endif
+
+-#if (defined(__APPLE__) || defined(__FreeBSD__)) && !defined(JEMALLOC_NO_RENAME)
++#if (defined(__APPLE__) || defined(__FreeBSD__) || (defined(__linux__) && !defined(__GLIBC__))) && !defined(JEMALLOC_NO_RENAME)
+ # define JEMALLOC_SYS_NOTHROW
+ #else
+ # define JEMALLOC_SYS_NOTHROW JEMALLOC_NOTHROW
diff --git a/dev-libs/jemalloc/jemalloc-5.3.0-r1.ebuild b/dev-libs/jemalloc/jemalloc-5.3.0-r1.ebuild
index 36af3bb44643..341374a74d7f 100644
--- a/dev-libs/jemalloc/jemalloc-5.3.0-r1.ebuild
+++ b/dev-libs/jemalloc/jemalloc-5.3.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
@@ -18,6 +18,7 @@ HTML_DOCS=( doc/jemalloc.html )
PATCHES=(
"${FILESDIR}/${PN}-5.3.0-gentoo-fixups.patch"
"${FILESDIR}/${PN}-5.3.0-backport-pr-2312.patch"
+ "${FILESDIR}/${PN}-5.3.0-backport-pr-2338.patch"
)
MULTILIB_WRAPPED_HEADERS=( /usr/include/jemalloc/jemalloc.h )