]> TLD Linux GIT Repositories - packages/clamav.git/blob - clamav-add-support-for-system-tomsfastmath.patch
- updated to 0.104.2, partial PLD merge
[packages/clamav.git] / clamav-add-support-for-system-tomsfastmath.patch
1 From 06669d85088f588ceb781f93367bb5428874ed27 Mon Sep 17 00:00:00 2001
2 From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 Date: Wed, 11 Mar 2015 20:03:15 +0100
4 Subject: add support for system tomsfastmath
5
6 Patch-Name: add-support-for-system-tomsfastmath.patch
7 ---
8  configure.ac                           |  2 ++
9  libclamav/Makefile.am                  | 10 ++++++++--
10  libclamav/bignum.h                     |  6 +++++-
11  libclamav/xdp.c                        |  2 +-
12  m4/reorganization/libs/tomsfastmath.m4 | 12 ++++++++++++
13  5 files changed, 28 insertions(+), 4 deletions(-)
14  create mode 100644 m4/reorganization/libs/tomsfastmath.m4
15
16 diff -urNp -x '*.orig' clamav-0.103.0.org/libclamav/bignum.h clamav-0.103.0/libclamav/bignum.h
17 --- clamav-0.103.0.org/libclamav/bignum.h       2020-09-13 02:27:09.000000000 +0200
18 +++ clamav-0.103.0/libclamav/bignum.h   2021-04-06 16:40:12.578841141 +0200
19 @@ -1,9 +1,13 @@
20  #ifndef BIGNUM_H_
21  #define BIGNUM_H_
22  
23 +#if HAVE_SYSTEM_TOMSFASTMATH
24 +#include <tfm.h>
25 +#else
26  #define TFM_CHECK
27 -
28  #include "bignum_fast.h"
29 +#endif
30 +
31  typedef fp_int mp_int;
32  #define mp_cmp fp_cmp
33  #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
34 diff -urNp -x '*.orig' clamav-0.103.0.org/libclamav/xdp.c clamav-0.103.0/libclamav/xdp.c
35 --- clamav-0.103.0.org/libclamav/xdp.c  2020-09-13 02:27:10.000000000 +0200
36 +++ clamav-0.103.0/libclamav/xdp.c      2021-04-06 16:40:12.578841141 +0200
37 @@ -52,7 +52,7 @@
38  #include "scanners.h"
39  #include "conv.h"
40  #include "xdp.h"
41 -#include "bignum_fast.h"
42 +#include "bignum.h"
43  #include "filetypes.h"
44  
45  static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
46
47 --- clamav-0.104.0/libclamav/CMakeLists.txt~    2021-08-27 22:41:31.000000000 +0000
48 +++ clamav-0.104.0/libclamav/CMakeLists.txt     2021-10-08 14:11:34.629965363 +0000
49 @@ -157,99 +157,6 @@ target_link_libraries( yara
50          PCRE2::pcre2
51          JSONC::jsonc )
52  
53 -add_library( tomsfastmath OBJECT )
54 -target_sources( tomsfastmath
55 -    PRIVATE
56 -        tomsfastmath/addsub/fp_add.c
57 -        tomsfastmath/addsub/fp_add_d.c
58 -        tomsfastmath/addsub/fp_addmod.c
59 -        tomsfastmath/addsub/fp_cmp.c
60 -        tomsfastmath/addsub/fp_cmp_d.c
61 -        tomsfastmath/addsub/fp_cmp_mag.c
62 -        tomsfastmath/addsub/fp_sub.c
63 -        tomsfastmath/addsub/fp_sub_d.c
64 -        tomsfastmath/addsub/fp_submod.c
65 -        tomsfastmath/addsub/s_fp_add.c
66 -        tomsfastmath/addsub/s_fp_sub.c
67 -        tomsfastmath/bin/fp_radix_size.c
68 -        tomsfastmath/bin/fp_read_radix.c
69 -        tomsfastmath/bin/fp_read_signed_bin.c
70 -        tomsfastmath/bin/fp_read_unsigned_bin.c
71 -        tomsfastmath/bin/fp_reverse.c
72 -        tomsfastmath/bin/fp_s_rmap.c
73 -        tomsfastmath/bin/fp_signed_bin_size.c
74 -        tomsfastmath/bin/fp_to_signed_bin.c
75 -        tomsfastmath/bin/fp_to_unsigned_bin.c
76 -        tomsfastmath/bin/fp_toradix.c
77 -        tomsfastmath/bin/fp_toradix_n.c
78 -        tomsfastmath/bin/fp_unsigned_bin_size.c
79 -        tomsfastmath/bit/fp_cnt_lsb.c
80 -        tomsfastmath/bit/fp_count_bits.c
81 -        tomsfastmath/bit/fp_div_2.c
82 -        tomsfastmath/bit/fp_div_2d.c
83 -        tomsfastmath/bit/fp_lshd.c
84 -        tomsfastmath/bit/fp_mod_2d.c
85 -        tomsfastmath/bit/fp_rshd.c
86 -        tomsfastmath/divide/fp_div.c
87 -        tomsfastmath/divide/fp_div_d.c
88 -        tomsfastmath/divide/fp_mod.c
89 -        tomsfastmath/divide/fp_mod_d.c
90 -        tomsfastmath/exptmod/fp_2expt.c
91 -        tomsfastmath/exptmod/fp_exptmod.c
92 -        tomsfastmath/misc/fp_ident.c
93 -        tomsfastmath/misc/fp_set.c
94 -        tomsfastmath/mont/fp_montgomery_calc_normalization.c
95 -        tomsfastmath/mont/fp_montgomery_reduce.c
96 -        tomsfastmath/mont/fp_montgomery_setup.c
97 -        tomsfastmath/mul/fp_mul.c
98 -        tomsfastmath/mul/fp_mul_comba.c
99 -        tomsfastmath/mul/fp_mul_2.c
100 -        tomsfastmath/mul/fp_mul_2d.c
101 -        tomsfastmath/mul/fp_mul_comba_12.c
102 -        tomsfastmath/mul/fp_mul_comba_17.c
103 -        tomsfastmath/mul/fp_mul_comba_20.c
104 -        tomsfastmath/mul/fp_mul_comba_24.c
105 -        tomsfastmath/mul/fp_mul_comba_28.c
106 -        tomsfastmath/mul/fp_mul_comba_3.c
107 -        tomsfastmath/mul/fp_mul_comba_32.c
108 -        tomsfastmath/mul/fp_mul_comba_4.c
109 -        tomsfastmath/mul/fp_mul_comba_48.c
110 -        tomsfastmath/mul/fp_mul_comba_6.c
111 -        tomsfastmath/mul/fp_mul_comba_64.c
112 -        tomsfastmath/mul/fp_mul_comba_7.c
113 -        tomsfastmath/mul/fp_mul_comba_8.c
114 -        tomsfastmath/mul/fp_mul_comba_9.c
115 -        tomsfastmath/mul/fp_mul_comba_small_set.c
116 -        tomsfastmath/mul/fp_mul_d.c
117 -        tomsfastmath/mul/fp_mulmod.c
118 -        tomsfastmath/numtheory/fp_invmod.c
119 -        tomsfastmath/sqr/fp_sqr.c
120 -        tomsfastmath/sqr/fp_sqr_comba_12.c
121 -        tomsfastmath/sqr/fp_sqr_comba_17.c
122 -        tomsfastmath/sqr/fp_sqr_comba_20.c
123 -        tomsfastmath/sqr/fp_sqr_comba_24.c
124 -        tomsfastmath/sqr/fp_sqr_comba_28.c
125 -        tomsfastmath/sqr/fp_sqr_comba_3.c
126 -        tomsfastmath/sqr/fp_sqr_comba_32.c
127 -        tomsfastmath/sqr/fp_sqr_comba_4.c
128 -        tomsfastmath/sqr/fp_sqr_comba_48.c
129 -        tomsfastmath/sqr/fp_sqr_comba_6.c
130 -        tomsfastmath/sqr/fp_sqr_comba_64.c
131 -        tomsfastmath/sqr/fp_sqr_comba_7.c
132 -        tomsfastmath/sqr/fp_sqr_comba_8.c
133 -        tomsfastmath/sqr/fp_sqr_comba_9.c
134 -        tomsfastmath/sqr/fp_sqr_comba_generic.c
135 -        tomsfastmath/sqr/fp_sqr_comba_small_set.c
136 -        tomsfastmath/sqr/fp_sqrmod.c
137 -    PUBLIC
138 -        bignum.h
139 -        bignum_fast.h )
140 -target_include_directories( tomsfastmath
141 -    PRIVATE ${CMAKE_BINARY_DIR}
142 -    PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR} )
143 -set_target_properties( tomsfastmath PROPERTIES
144 -    COMPILE_FLAGS "${WARNCFLAGS}" )
145 -
146  # Bytecode Runtime
147  add_library( bytecode_runtime OBJECT )
148  if(LLVM_FOUND)
149 @@ -424,7 +424,7 @@ if(ENABLE_SHARED_LIB)
150              regex
151              lzma_sdk
152              yara
153 -            tomsfastmath
154 +            tfm
155              bytecode_runtime
156              ${LIBMSPACK}
157              ClamAV::libunrar_iface_iface
158 @@ -525,7 +525,7 @@ if(ENABLE_STATIC_LIB)
159              regex
160              lzma_sdk
161              yara
162 -            tomsfastmath
163 +            tfm
164              bytecode_runtime
165              ${LIBMSPACK}
166              OpenSSL::SSL
167 --- clamav-0.104.0/unit_tests/CMakeLists.txt~   2021-08-27 22:41:31.000000000 +0000
168 +++ clamav-0.104.0/unit_tests/CMakeLists.txt    2021-10-08 14:20:36.239965193 +0000
169 @@ -52,7 +52,7 @@ if(ENABLE_APP)
170              regex
171              lzma_sdk
172              yara
173 -            tomsfastmath
174 +            tfm
175              bytecode_runtime
176              JSONC::jsonc
177              ${LIBMSPACK}
178 @@ -92,7 +92,7 @@ if(ENABLE_APP)
179              regex
180              lzma_sdk
181              yara
182 -            tomsfastmath
183 +            tfm
184              bytecode_runtime
185              JSONC::jsonc
186              ${LIBMSPACK}
187 @@ -144,7 +144,7 @@ target_link_libraries(check_clamav
188          regex
189          lzma_sdk
190          yara
191 -        tomsfastmath
192 +        tfm
193          bytecode_runtime
194          JSONC::jsonc
195          ${LIBMSPACK}