Last-Modified: Mon, 13 Jan 2025 10:55:37 GMT
Expires: Mon, 13 Jan 2025 11:10:37 GMT

<!DOCTYPE html>
<html lang='en'>
<head>
<title>guix - Wojtek's customized Guix</title>
<meta name='generator' content='cgit v1.2.3'/>
<meta name='robots' content='noindex, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/cgit.css'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/better-cgit-markdown-heading-color.css'/>
<link rel='shortcut icon' href='/cgit-static/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://git.koszko.org/guix/atom/?h=koszko' type='application/atom+xml'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='https://git.koszko.org/cgit-static/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/guix/'>guix</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='d461dd81cd688ddd63892204a19b3456810352e8'/><select name='h' onchange='this.form.submit();'>
<option value='koszko' selected='selected'>koszko</option>
<option value='koszko-scripts'>koszko-scripts</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Wojtek's customized Guix</td><td class='sub right'<</td></tr></table>
<table class='tabs'><tr><td>
<a class='active' href='/guix/about/'>about</a><a href='/guix/'>summary</a><a href='/guix/refs/?id=d461dd81cd688ddd63892204a19b3456810352e8'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=d461dd81cd688ddd63892204a19b3456810352e8'>tree</a><a href='/guix/commit/?id=d461dd81cd688ddd63892204a19b3456810352e8'>commit</a><a href='/guix/diff/?id=d461dd81cd688ddd63892204a19b3456810352e8'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='d461dd81cd688ddd63892204a19b3456810352e8'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='content'><div id='summary'<pre>
From: Tobias Geerinckx-Rice &lt;me@tobias.gr&gt;
Date: Sat, 03 Oct 2020 22:10:20 +0200
Subject: gnu: clamav: Add support for system tomsfastmath.

Adjusted from the original for clamav 0.103.0:

From 756ff89526b5ffaa7a4f49b1bbecf2ecbd6f85f9 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun &lt;Andreas.Cadhalpun@googlemail.com&gt;
Date: Wed, 11 Mar 2015 20:03:15 +0100
Subject: add support for system tomsfastmath

Patch-Name: add-support-for-system-tomsfastmath.patch
---
 configure.ac                           |    2 ++
 libclamav/Makefile.am                  |   10 ++++++++--
 libclamav/bignum.h                     |    6 +++++-
 libclamav/xdp.c                        |    2 +-
 m4/reorganization/libs/tomsfastmath.m4 |   12 ++++++++++++
 5 files changed, 28 insertions(+), 4 deletions(-)
 create mode 100644 m4/reorganization/libs/tomsfastmath.m4

diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac	1970-01-01 01:00:01.000000000 +0100
+++ b/configure.ac	2020-10-03 22:04:00.535448352 +0200
@@ -94,6 +94,7 @@
 m4_include([m4/reorganization/libs/json.m4])
 m4_include([m4/reorganization/libs/pcre.m4])
 m4_include([m4/reorganization/libs/libmspack.m4])
+m4_include([m4/reorganization/libs/tomsfastmath.m4])
 
 if test &quot;x$use_internal_mspack&quot; = &quot;xno&quot;; then
     mspack_msg=&quot;External, $LIBMSPACK_CFLAGS $LIBMSPACK_LIBS&quot;
@@ -361,6 +362,7 @@
 fi
 CL_MSG_STATUS([yara        ],[$enable_yara],[$enable_yara])
 CL_MSG_STATUS([fts         ],[yes],[$lfs_fts_msg])
+CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg])
 
 
 # Yep, downgrading the compiler avoids the bug too:
diff -Naur a/libclamav/bignum.h b/libclamav/bignum.h
--- a/libclamav/bignum.h	1970-01-01 01:00:01.000000000 +0100
+++ b/libclamav/bignum.h	2020-10-03 22:04:00.535448352 +0200
@@ -1,9 +1,13 @@
 #ifndef BIGNUM_H_
 #define BIGNUM_H_
 
+#if HAVE_SYSTEM_TOMSFASTMATH
+#include &lt;tfm.h&gt;
+#else
 #define TFM_CHECK
-
 #include &quot;bignum_fast.h&quot;
+#endif
+
 typedef fp_int mp_int;
 #define mp_cmp fp_cmp
 #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
diff -Naur a/libclamav/Makefile.am b/libclamav/Makefile.am
--- a/libclamav/Makefile.am	1970-01-01 01:00:01.000000000 +0100
+++ b/libclamav/Makefile.am	2020-10-03 22:06:42.705447754 +0200
@@ -588,8 +588,10 @@
 	yara_clam.h
 endif
 
-libclamav_la_SOURCES += bignum.h\
-	bignum_fast.h\
+libclamav_la_SOURCES += bignum.h
+
+if !SYSTEM_TOMSFASTMATH
+libclamav_la_SOURCES += bignum_fast.h\
 	tomsfastmath/addsub/fp_add.c\
 	tomsfastmath/addsub/fp_add_d.c\
 	tomsfastmath/addsub/fp_addmod.c\
@@ -671,6 +673,10 @@
 	tomsfastmath/sqr/fp_sqr_comba_generic.c\
 	tomsfastmath/sqr/fp_sqr_comba_small_set.c\
 	tomsfastmath/sqr/fp_sqrmod.c
+else
+libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
+libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
+endif
 
 .PHONY2: version.h.tmp
 version.c: version.h
diff -Naur a/libclamav/xdp.c b/libclamav/xdp.c
--- a/libclamav/xdp.c	1970-01-01 01:00:01.000000000 +0100
+++ b/libclamav/xdp.c	2020-10-03 22:04:00.535448352 +0200
@@ -52,7 +52,7 @@
 #include &quot;scanners.h&quot;
 #include &quot;conv.h&quot;
 #include &quot;xdp.h&quot;
-#include &quot;bignum_fast.h&quot;
+#include &quot;bignum.h&quot;
 #include &quot;filetypes.h&quot;
 
 static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
diff -Naur a/m4/reorganization/libs/tomsfastmath.m4 b/m4/reorganization/libs/tomsfastmath.m4
--- a/m4/reorganization/libs/tomsfastmath.m4	1970-01-01 01:00:00.000000000 +0100
+++ b/m4/reorganization/libs/tomsfastmath.m4	2020-10-03 22:04:00.535448352 +0200
@@ -0,0 +1,12 @@
+dnl Check for system tomsfastmath
+PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
+
+AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test &quot;x$have_system_tomsfastmath&quot; = &quot;xyes&quot;])
+
+if test &quot;x$have_system_tomsfastmath&quot; = &quot;xyes&quot;; then
+    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide tomsfastmath library])
+    tomsfastmath_msg=&quot;External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS&quot;
+else
+    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don&apos;t link against system-wide tomsfastmath library])
+    tomsfastmath_msg=&quot;Internal&quot;
+fi
</pre>
</div></div> <!-- class=content -->
                         <div class=footer>generated by
                             <a href="https://git.zx2c4.com/cgit/about/">
                                 cgit
                             </a>
                         </div>
                        </div> <!-- id=cgit -->
</body>
</html>
