commit:     8ccf52ced370cc049902423602a6d9aac882c2da
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 27 01:49:19 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 27 01:49:48 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ccf52ce

sys-apps/gawk: disable assertions for PMA

Backport performance fix requested by upstream.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gawk-5.4.0-no-assertions-for-pma.patch   | 25 ++++++++++++++++++++++
 .../{gawk-5.4.0.ebuild => gawk-5.4.0-r1.ebuild}    |  4 ++++
 2 files changed, 29 insertions(+)

diff --git a/sys-apps/gawk/files/gawk-5.4.0-no-assertions-for-pma.patch 
b/sys-apps/gawk/files/gawk-5.4.0-no-assertions-for-pma.patch
new file mode 100644
index 000000000000..d729d58a5c7c
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-5.4.0-no-assertions-for-pma.patch
@@ -0,0 +1,25 @@
+https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=32e6f04bf47ea95773ea0d6d876c5fad8bb90834
+
+From 32e6f04bf47ea95773ea0d6d876c5fad8bb90834 Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <[email protected]>
+Date: Mon, 23 Feb 2026 10:59:41 +0200
+Subject: Disable assertions in support/pma.c.
+
+---
+ support/pma.c     | 1 +
+ 2 files changed, 7 insertions(+)
+
+--- a/support/pma.c
++++ b/support/pma.c
+@@ -27,6 +27,7 @@
+ */
+ 
+ #define _DEFAULT_SOURCE  // for MAP_ANONYMOUS
++#define NDEBUG 1      // disable assertions, it kills performance
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-- 
+cgit v1.2.3
+
+

diff --git a/sys-apps/gawk/gawk-5.4.0.ebuild 
b/sys-apps/gawk/gawk-5.4.0-r1.ebuild
similarity index 97%
rename from sys-apps/gawk/gawk-5.4.0.ebuild
rename to sys-apps/gawk/gawk-5.4.0-r1.ebuild
index d1aa57e09c2a..a5ffd8d74c12 100644
--- a/sys-apps/gawk/gawk-5.4.0.ebuild
+++ b/sys-apps/gawk/gawk-5.4.0-r1.ebuild
@@ -58,6 +58,10 @@ if [[ ${GAWK_IS_BETA} != yes ]] ; then
        BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-gawk )"
 fi
 
+PATCHES=(
+       "${FILESDIR}"/${P}-no-assertions-for-pma.patch
+)
+
 src_prepare() {
        default
 

Reply via email to