public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/crm114/, app-text/crm114/files/
@ 2024-05-06  4:39 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-05-06  4:39 UTC (permalink / raw
  To: gentoo-commits

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 <eschwartz93@gmail.com>
+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
+


^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-text/crm114/, app-text/crm114/files/
@ 2016-12-13 19:07 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2016-12-13 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     3c67e80b9017a0bd89d5eec08eb0b03b0202e45e
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 17:54:45 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Dec 13 19:07:04 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c67e80b

app-text/crm114: Fix building with GCC 5

Gentoo-bug: 571062
* EAPI=6
* Respect user CPPFLAGS
* Introduce USE=examples

Package-Manager: portage-2.3.3

 ...4-20100106.ebuild => crm114-20100106-r1.ebuild} | 71 +++++++++++-----------
 .../files/crm114-20100106-fix-makefile.patch       | 60 ++++++++++++++++++
 2 files changed, 95 insertions(+), 36 deletions(-)

diff --git a/app-text/crm114/crm114-20100106.ebuild b/app-text/crm114/crm114-20100106-r1.ebuild
similarity index 52%
rename from app-text/crm114/crm114-20100106.ebuild
rename to app-text/crm114/crm114-20100106-r1.ebuild
index f406281..4094f9d 100644
--- a/app-text/crm114/crm114-20100106.ebuild
+++ b/app-text/crm114/crm114-20100106-r1.ebuild
@@ -1,12 +1,12 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=2
+EAPI=6
 
-MY_P="${P}-BlameMichelson.src"
+inherit flag-o-matic toolchain-funcs
 
-inherit eutils toolchain-funcs
+MY_P="${P}-BlameMichelson.src"
 
 DESCRIPTION="A powerful text processing tool, mainly used for spam filtering"
 HOMEPAGE="http://crm114.sourceforge.net/"
@@ -14,8 +14,8 @@ SRC_URI="http://crm114.sourceforge.net/tarballs/${MY_P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="amd64 ppc x86 ~x86-fbsd"
-IUSE="mew mimencode nls normalizemime static test"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+IUSE="examples mew mimencode nls normalizemime static test"
 
 RDEPEND="
 	static? ( dev-libs/tre[static-libs] )
@@ -28,55 +28,54 @@ DEPEND="${RDEPEND}
 
 S="${WORKDIR}"/${MY_P}
 
+PATCHES=( "${FILESDIR}"/${P}-fix-makefile.patch )
+
 src_prepare() {
-	sed \
-		-e "s#-O3 -Wall##" \
-		-e "s#^CC=.*#CC=$(tc-getCC)#" \
-		-i Makefile || die
-	# Upstream recommends static linking
-	if ! use static ; then
-		sed -i "s#LDFLAGS += -static -static-libgcc#LDFLAGS += ${LDFLAGS}#" Makefile || die
-	else
-		sed \
-			-e "s#LDFLAGS += -static -static-libgcc#LDFLAGS += ${LDFLAGS} -static -static-libgcc#" \
-			-i Makefile || die
-	fi
+	default
 
-	if use mimencode ; then
+	if use mimencode; then
 		sed \
 			-e 's%#:mime_decoder: /mimencode -u/%:mime_decoder: /mimencode -u/%' \
 			-e 's%:mime_decoder: /mewdecode/%#:mime_decoder: /mewdecode/%' \
 			-i mailfilter.cf || die
-	elif use normalizemime ; then
+	elif use normalizemime; then
 		sed \
 			-e 's%#:mime_decoder: /normalizemime/%:mime_decoder: /normalizemime/%' \
 			-e 's%:mime_decoder: /mewdecode/%#:mime_decoder: /mewdecode/%' \
 			-i mailfilter.cf || die
 	fi
-
 }
 
-src_install() {
-	dobin crm114 cssutil cssdiff cssmerge || die
-	dobin cssutil cssdiff cssmerge || die
-	dobin osbf-util || die
+src_compile() {
+	# Restore GNU89 inline semantics to
+	# emit external symbols, bug 571062
+	append-cflags -std=gnu89
 
-	dodoc COLOPHON.txt CRM114_Mailfilter_HOWTO.txt FAQ.txt INTRO.txt || die
-	dodoc QUICKREF.txt CLASSIFY_DETAILS.txt inoc_passwd.txt || die
-	dodoc KNOWNBUGS.txt THINGS_TO_DO.txt README || die
-	docinto examples
-	dodoc *.example || die
+	use static && append-ldflags -static -static-libgcc
 
-	insinto /usr/share/${PN}
-	doins *.crm || die
-	doins *.cf || die
-	doins *.mfp || die
+	emake CC="$(tc-getCC)"
 }
 
 src_test() {
-	emake megatest || die
+	emake megatest
+}
+
+src_install() {
+	dobin crm114 cssdiff cssmerge cssutil osbf-util
+
+	insinto /usr/share/${PN}
+	doins *.crm *.cf *.mfp
+
+	dodoc COLOPHON.txt CRM114_Mailfilter_HOWTO.txt FAQ.txt INTRO.txt QUICKREF.txt \
+		CLASSIFY_DETAILS.txt inoc_passwd.txt KNOWNBUGS.txt THINGS_TO_DO.txt README
+
+	if use examples; then
+		docinto examples
+		dodoc *.example
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
 }
 
 pkg_postinst() {
-	elog "The spam-filter CRM files are installed in /usr/share/${PN}."
+	elog "The spam-filter CRM files are installed in ${EROOT%/}/usr/share/${PN}."
 }

diff --git a/app-text/crm114/files/crm114-20100106-fix-makefile.patch b/app-text/crm114/files/crm114-20100106-fix-makefile.patch
new file mode 100644
index 00000000..12ad405
--- /dev/null
+++ b/app-text/crm114/files/crm114-20100106-fix-makefile.patch
@@ -0,0 +1,60 @@
+* Remove hardcoded variable
+* Respect user variables
+
+--- a/Makefile
++++ b/Makefile
+@@ -19,10 +19,6 @@
+ VER_SUFFIX ?=
+ 
+ #
+-#      The following forces the compiler to be GCC.  If you have trouble
+-#      with your default compiler, and you want to force GCC, uncomment it.
+-CC=gcc
+-#
+ #     What version is this software (PLEASE don't change this just
+ #     to mess with my brain. - wsy)
+ #
+@@ -82,7 +78,7 @@
+ #
+ #     Build our basic CFLAGS chunk
+ #
+-CFLAGS += -DVERSION='"$(VERSION)"'
++MY_CPPFLAGS += -DVERSION='"$(VERSION)"'
+ #
+ #  Known Neighbord On, only for debugging
+ # CFLAGS += -DKNN_ON
+@@ -104,7 +100,7 @@
+ #  certain functions to be inline (I added that to force gcc to inline functions
+ #  under high optimization but not under low so that debugging is possible - 
+ #  that's why DO_INLINES is defined at O3 but not O0 - JB):
+-CFLAGS += -O3 -Wall -DDO_INLINES
++MY_CPPFLAGS += -DDO_INLINES
+ #     turn this one on for no optimization, but debugging
+ #CFLAGS += -g -O0 -Wall
+ #
+@@ -119,7 +115,6 @@
+ #    BSD users - do NOT use -static-libgcc!!!
+ #    Also note that this keeps valgrind from running correctly so comment
+ #    it out for debugging.
+-LDFLAGS += -static -static-libgcc
+ #    use this one if you want program profiling.
+ #LDFLAGS += -static -static-libgcc -pg
+ #LDFLAGS += -pg
+@@ -306,7 +301,7 @@
+         #                               of with your mods built in.
+ 
+ crm114: $(OFILES)
+-	$(CC) $(LDFLAGS) $(LIBS) $(OFILES) \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(OFILES) \
+ 	  -ltre -lm \
+ 	  -o crm114
+ 	#
+@@ -315,7 +310,7 @@
+ 
+ *.o: $(HFILES)
+ .c.o:
+-	$(CC)  $(CFLAGS) -c $*.c
++	$(CC) $(CFLAGS) $(MY_CPPFLAGS) $(CPPFLAGS) -c $*.c
+ 
+ cssutil: cssutil.o crm_css_maintenance.o crm_util_errorhandlers.o crm_str_funcs.o $(HFILES)
+ 	$(CC)  $(CFLAGS) $(LDFLAGS) cssutil.o \


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-06  4:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06  4:39 [gentoo-commits] repo/gentoo:master commit in: app-text/crm114/, app-text/crm114/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2016-12-13 19:07 David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox