commit:     2839302f8546d1a9c64f1c92684b8eadf23844b0
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon May  6 04:33:31 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  6 04:39:27 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2839302f

app-text/crm114: fix LTO error due to broken function signatures

It is ancient sourceforge software from 2009. Not submitted upstream.

Closes: https://bugs.gentoo.org/854897
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...0100106-r1.ebuild => crm114-20100106-r2.ebuild} |  9 ++++-
 ...function-signatures-for-5-argument-functi.patch | 43 ++++++++++++++++++++++
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/app-text/crm114/crm114-20100106-r1.ebuild 
b/app-text/crm114/crm114-20100106-r2.ebuild
similarity index 85%
rename from app-text/crm114/crm114-20100106-r1.ebuild
rename to app-text/crm114/crm114-20100106-r2.ebuild
index 97d0d5c39cc0..a5d4a7b851d4 100644
--- a/app-text/crm114/crm114-20100106-r1.ebuild
+++ b/app-text/crm114/crm114-20100106-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -25,7 +25,12 @@ DEPEND="${RDEPEND}
 
 S="${WORKDIR}"/${MY_P}
 
-PATCHES=( "${FILESDIR}"/${P}-fix-makefile.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-fix-makefile.patch
+       # https://bugs.gentoo.org/854897
+       # Upstream is dead since 2009 so no point submitting this to them.
+       
"${FILESDIR}"/0001-fix-broken-function-signatures-for-5-argument-functi.patch
+)
 
 src_prepare() {
        default

diff --git 
a/app-text/crm114/files/0001-fix-broken-function-signatures-for-5-argument-functi.patch
 
b/app-text/crm114/files/0001-fix-broken-function-signatures-for-5-argument-functi.patch
new file mode 100644
index 000000000000..ab2ebcaa368d
--- /dev/null
+++ 
b/app-text/crm114/files/0001-fix-broken-function-signatures-for-5-argument-functi.patch
@@ -0,0 +1,43 @@
+From c0cb641ec6c1ab960df91c23b726836add0ca3a5 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <[email protected]>
+Date: Mon, 6 May 2024 00:26:18 -0400
+Subject: [PATCH] fix broken function signatures for 5-argument functions
+
+These are always called before exit() so presumably no one noticed that
+these "log error and exit(-1)" functions were prone to "exiting with an
+error" (our new term for "hello how would you like to have some UB").
+
+However, the LTO optimizer noticed what was being done and died in
+painful agony. Bring it back to life and soothe its hurts.
+---
+ crm_util_errorhandlers.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/crm_util_errorhandlers.c b/crm_util_errorhandlers.c
+index 1f64f3c..cba9d89 100644
+--- a/crm_util_errorhandlers.c
++++ b/crm_util_errorhandlers.c
+@@ -23,17 +23,17 @@ long untrappableerror ( char *str1, char *str2)
+   fprintf (stderr, "ERROR: %s%s \n", str1, str2);
+   exit (-1);
+ }
+-long fatalerror5 ( char *str1, char *str2)
++long fatalerror5 ( char *str1, char *str2, char* myfile, char* myfunction, 
unsigned myline)
+ {
+   fprintf (stderr, "ERROR: %s%s \n", str1, str2);
+   exit (-1);
+ }
+-long nonfatalerror5 ( char *str1, char *str2)
++long nonfatalerror5 ( char *str1, char *str2, char* myfile, char* myfunction, 
unsigned myline)
+ {
+   fprintf (stderr, "ERROR: %s%s \n", str1, str2);
+   exit (-1);
+ }
+-long untrappableerror5 ( char *str1, char *str2)
++long untrappableerror5 ( char *str1, char *str2, char* myfile, char* 
myfunction, unsigned myline)
+ {
+   fprintf (stderr, "ERROR: %s%s \n", str1, str2);
+   exit (-1);
+-- 
+2.43.2
+

Reply via email to