commit:     fc6853db1f910a17d2293e6b9d23987bbc45d66e
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Tue Mar  5 03:54:37 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar  5 04:47:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc6853db

net-analyzer/echoping: fix underlinking to libm

Caused compilation failures if LTO was used.

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

 .../echoping/echoping-6.0.2_p434-r5.ebuild         |  1 +
 .../files/0001-correctly-link-to-libm.patch        | 32 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/net-analyzer/echoping/echoping-6.0.2_p434-r5.ebuild 
b/net-analyzer/echoping/echoping-6.0.2_p434-r5.ebuild
index 69a6db661c00..a1b34e731c1b 100644
--- a/net-analyzer/echoping/echoping-6.0.2_p434-r5.ebuild
+++ b/net-analyzer/echoping/echoping-6.0.2_p434-r5.ebuild
@@ -37,6 +37,7 @@ PATCHES=(
        
"${FILESDIR}"/${PN}-6.0.2_p434-gnutls_certificate_type_set_priority.patch
        "${FILESDIR}"/${PN}-6.0.2_p434-gnutls_session.patch
        "${FILESDIR}"/${PN}-6.0.2_p434-fno-common.patch
+       "${FILESDIR}"/0001-correctly-link-to-libm.patch
 )
 
 src_prepare() {

diff --git a/net-analyzer/echoping/files/0001-correctly-link-to-libm.patch 
b/net-analyzer/echoping/files/0001-correctly-link-to-libm.patch
new file mode 100644
index 000000000000..2bd38fea6c6e
--- /dev/null
+++ b/net-analyzer/echoping/files/0001-correctly-link-to-libm.patch
@@ -0,0 +1,32 @@
+From a951dcd0ea6cc64afbba2a438aead17706562486 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwart...@gmail.com>
+Date: Mon, 4 Mar 2024 22:43:43 -0500
+Subject: [PATCH] correctly link to libm
+
+The program depends on math.h symbols via util.c, but blindly assumes
+that it will be available without explicitly linking to it -- a POSIX
+violation.
+
+Also an LTO violation.
+
+Signed-off-by: Eli Schwartz <eschwart...@gmail.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a586281..3f96637 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -6,7 +6,7 @@ bin_PROGRAMS = echoping
+ man_MANS = echoping.1
+ echoping_SOURCES = echoping.c error.c readline.c writen.c util.c http.c icp.c 
HTParse.c echoping.h icp.h HTParse.h smtp.c
+ pkginclude_HEADERS = echoping.h compilation.h
+-echoping_LDADD = 
++echoping_LDADD = -lm
+ echoping_LDFLAGS = -export-dynamic
+ DOCS=DETAILS PLUGINS
+ SUBDIRS=plugins
+-- 
+2.43.0
+

Reply via email to