Files
gentoo/dev-libs/jemalloc/files/jemalloc-5.4.0-dont-override-cflags.patch
Zurab Kvachadze 06ce30373f dev-libs/jemalloc: add 5.4.0
Rejoice (or grieve) as jemalloc has risen from the ashes!

Its development revived sometime around Q1/Q2 of 2026 and, apparently,
it was so fruitful that two releases have been delivered since then:
5.3.1 and 5.4.0. The latter does not carry the fix for bug 967868, so I
decided to skip it and go right ahead to 5.4.0.

ABI considerations below. Three patches were dropped, one was retained, one updated:

  - PR 2338 was merged upstream and is present in 5.4.0 and the
    corresponding backport was dropped.
  - PR 2312 patch (HPA support) was dropped because it would not apply
    on 5.4.0 and we no longer support IA64 (and the issue in original
    bug report was prsent on IA64). See upstream issue 2305.
  - The fix in 'dont-call-libstcxx-internals' was merged upstream and is
    present in 5.4.0 so the patch is dropped.

  - AArch64 page size fix has not been upstreamed, so it stays.

  - Gentoo fixups is renamed 'dont-override-cflags', the patch is
    amended with further removal of unconditional adding of -g flags.
    Also, instead of patching the build system to not install HTML doc
    to unversioned /usr/share/doc/${PN} (should be ${PF}/html), we just
    remove the offender in src_install().

 Multilib wrapped header is removed (since its use is discouraged) and
 per-ABI headers now live in corresponding libdirs. jemalloc uses
 autoconf so we just pass --includedir.

 IUSE="+stats" is default enabled now because it has been default
 enabled upstream since 2012.

ABI considerations
==================

Quick glance at abidiff (5.3.0-r3 vs 5.4.0) on amd64, on both
ABI_X86="64 32", shows the addition of three new functions and (get
ready!) changing of types of arguments of function pointers used for
tests:

```
Functions changes summary: 0 Removed, 0 Changed, 3 Added functions
Variables changes summary: 0 Removed, 2 Changed, 2 Added variables

3 Added functions:

  [A] 'function void free_aligned_sized(void*, size_t, size_t)'
      {free_aligned_sized}
  [A] 'function void free_sized(void*, size_t)'    {free_sized}
  [A] 'function void* pvalloc(size_t)'    {pvalloc}

2 variables with incompatible sub-type changes:

  [C] 'void (* je_test_hooks_arena_new_hook)(...)' was changed to
  'void (* je_test_hooks_arena_new_hook)(void)' at test_hooks.c:9:1:
    type of variable changed:
      in pointed to type 'function type void (...)':
        parameter 1 of type '...' was removed

  [C] 'void (* je_test_hooks_libc_hook)(...)' was changed to
  'void (* je_test_hooks_libc_hook)(void)' at test_hooks.c:12:1:
    type of variable changed:
      in pointed to type 'function type void (...)':
        parameter 1 of type '...' was removed
```

The reason why these test function pointers are even exported is:

    The hooks are a little bit screwy -- they're not genuinely exported
    in the sense that we want them available to end-users, but we do
    want them visible from outside the generated library, so that we can
    use them in test code.
                        -- src/test-hooks.c

So, nothing serious.

See-also: https://github.com/jemalloc/jemalloc/issues/2305
Bug: https://bugs.gentoo.org/967868
Bug: https://bugs.gentoo.org/969223
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/2060
Merges: https://codeberg.org/gentoo/gentoo/pulls/2060
Signed-off-by: Sam James <sam@gentoo.org>
2026-10-13 05:33:40 +01:00

60 lines
1.9 KiB
Diff

This is jemalloc-5.3.0-gentoo-fixups.patch, rebased on top of 5.4.0 tag.
From: Jory Pratt <anarchy@gentoo.org>
Date: Tue, 23 Apr 2019 10:04:19 -0500
Subject: [PATCH] Don't override user cflags, disable html_doc from being
installed
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
diff --git a/configure.ac b/configure.ac
index b049c892..b74956ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,7 +270,6 @@ if test "x$GCC" = "xyes" ; then
AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT], [ ], [ ])
fi
fi
- JE_CFLAGS_ADD([-Werror=unknown-warning-option])
JE_CFLAGS_ADD([-Wall])
JE_CFLAGS_ADD([-Wextra])
JE_CFLAGS_ADD([-Wshorten-64-to-32])
@@ -286,8 +285,6 @@ if test "x$GCC" = "xyes" ; then
dnl This one too.
JE_CFLAGS_ADD([-Wno-missing-field-initializers])
JE_CFLAGS_ADD([-Wno-missing-attributes])
- JE_CFLAGS_ADD([-pipe])
- JE_CFLAGS_ADD([-g3])
elif test "x$je_cv_msvc" = "xyes" ; then
CC="$CC -nologo"
JE_CFLAGS_ADD([-Zi])
@@ -347,7 +344,6 @@ if test "x$enable_cxx" = "x1" ; then
dnl shared with the C++ sources via the internal headers.
JE_CXXFLAGS_ADD([-Wno-missing-braces])
JE_CXXFLAGS_ADD([-Wno-missing-field-initializers])
- JE_CXXFLAGS_ADD([-g3])
SAVED_LIBS="${LIBS}"
case "${with_cxx_stdlib}" in
@@ -1454,21 +1450,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],