diff -Nru clamav-0.99.2+dfsg/debian/changelog clamav-0.99.2+dfsg/debian/changelog --- clamav-0.99.2+dfsg/debian/changelog 2016-08-18 14:06:38.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/changelog 2016-10-06 12:49:42.000000000 +0000 @@ -1,3 +1,13 @@ +clamav (0.99.2+dfsg-2ubuntu2) yakkety; urgency=medium + + * Revert to use in-package tomfastmath library instead of libtfm-dev + which is in Universe. This requires to bring back the following patches : + d/p/tfm-drop-__DATE__.patch + d/p/tfm-duct-tape-misscompile-on-armhf.patch + d/p/tfm-fix-compile-errors.patch + + -- Louis Bouchard Thu, 06 Oct 2016 14:49:37 +0200 + clamav (0.99.2+dfsg-2ubuntu1) yakkety; urgency=medium Merge from Debian. Remaining changes : diff -Nru clamav-0.99.2+dfsg/debian/control clamav-0.99.2+dfsg/debian/control --- clamav-0.99.2+dfsg/debian/control 2016-08-18 14:06:38.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/control 2016-10-04 07:25:58.000000000 +0000 @@ -27,9 +27,9 @@ libpcre3-dev, libssl-dev, libsystemd-dev [linux-any], - libtfm-dev, + libtommath-dev, libxml2-dev, - llvm-3.6-dev, + llvm-dev [i386 amd64 kfreebsd-amd64 kfreebsd-i386], perl, pkg-config, po-debconf, diff -Nru clamav-0.99.2+dfsg/debian/patches/series clamav-0.99.2+dfsg/debian/patches/series --- clamav-0.99.2+dfsg/debian/patches/series 2016-08-18 14:06:38.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/patches/series 2016-10-04 07:25:58.000000000 +0000 @@ -1,6 +1,9 @@ Change-paths-in-sample-conf-file-to-match-Debian.patch add-support-for-system-tomsfastmath.patch +tfm-drop-__DATE__.patch Allow-M-suffix-for-PCREMaxFileSize.patch +tfm-fix-compile-errors.patch +tfm-duct-tape-misscompile-on-armhf.patch clamav_add_private_fts_implementation.patch fix-ssize_t-size_t-off_t-printf-modifier.patch libclamav-use-libmspack.patch diff -Nru clamav-0.99.2+dfsg/debian/patches/tfm-drop-__DATE__.patch clamav-0.99.2+dfsg/debian/patches/tfm-drop-__DATE__.patch --- clamav-0.99.2+dfsg/debian/patches/tfm-drop-__DATE__.patch 1970-01-01 00:00:00.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/patches/tfm-drop-__DATE__.patch 2016-10-04 07:25:58.000000000 +0000 @@ -0,0 +1,37 @@ +From 68c2ab471120e01d135aba32193bd63e44992832 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Wed, 22 Apr 2015 21:47:57 +0200 +Subject: tfm: drop __DATE__ + +to make it reproducible + +Patch-Name: tfm-drop-__DATE__.patch +Signed-off-by: Sebastian Andrzej Siewior +--- + libclamav/tomsfastmath/misc/fp_ident.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Updated: 2016-09-19 + +Index: clamav-0.99.2+dfsg/libclamav/tomsfastmath/misc/fp_ident.c +=================================================================== +--- clamav-0.99.2+dfsg.orig/libclamav/tomsfastmath/misc/fp_ident.c 2016-09-19 10:30:08.492999541 -0400 ++++ clamav-0.99.2+dfsg/libclamav/tomsfastmath/misc/fp_ident.c 2016-09-19 10:30:54.105569407 -0400 +@@ -15,7 +15,7 @@ + + memset(buf, 0, sizeof(buf)); + snprintf(buf, sizeof(buf)-1, +-"TomsFastMath (%s)\n" ++"TomsFastMath\n" + "\n" + "Sizeofs\n" + "\tfp_digit = %llu\n" +@@ -70,7 +70,7 @@ + #ifdef TFM_HUGE + " TFM_HUGE " + #endif +- "\n", __DATE__, (long long unsigned)sizeof(fp_digit), (long long unsigned)sizeof(fp_word), FP_MAX_SIZE); ++ "\n", (long long unsigned)sizeof(fp_digit), (long long unsigned)sizeof(fp_word), FP_MAX_SIZE); + + if (sizeof(fp_digit) == sizeof(fp_word)) { + strncat(buf, "WARNING: sizeof(fp_digit) == sizeof(fp_word), this build is likely to not work properly.\n", diff -Nru clamav-0.99.2+dfsg/debian/patches/tfm-duct-tape-misscompile-on-armhf.patch clamav-0.99.2+dfsg/debian/patches/tfm-duct-tape-misscompile-on-armhf.patch --- clamav-0.99.2+dfsg/debian/patches/tfm-duct-tape-misscompile-on-armhf.patch 1970-01-01 00:00:00.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/patches/tfm-duct-tape-misscompile-on-armhf.patch 2016-10-04 07:25:58.000000000 +0000 @@ -0,0 +1,43 @@ +From 95e840f418007fe0d577a73590e47b9dabefbe50 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Thu, 13 Aug 2015 23:40:50 +0200 +Subject: tfm: duct tape misscompile on armhf + +since gcc-5 it seems fp_mul_comba does not produce the correct code +anymore atleast on armhf. + +fp_mul_comba32( +4GCHC4UTF6B5TE86JLJ2UUTQFDPCFNUI8F89S4T2G95GSDORB9PHKGJFG14BV8GONRTE3FV26GNV4NK14EMSMIFUKTN9RCT1ANKNDGH8HC3HJA23NK3NOE6IJOLF9VI4FQF3B49J1SS9FL3BF4D04BHA0L8FFQENPLIKO78F0FC38E46DDBQLDJGBM2T4FI7SS9P0OVE1QJ9Q , + +5E35JGJA52RUHS6FN60OJNCVTNI5CHSVM6ASV3PN8APTBI8G3LHBF77RK9DQ5ED412BG0PFFNK4P2TDNBQSQNATL6HMVSBGIDBEMI4VV8OH7O3OESAD1NM1AD3MJPDJO9QRR2L4MHRBD96PR2OPG5HNAKR9A9QSG8CGO33F27INOVMRCST3MAQI5FMS6IN23KIPD1L2QPTJQJ ); + +returns + +IBF17FL9HQU0D7IL2S9H9LDT5K9H8BGSS89UIJ5SE7 92FSLE2 8P6D1UG6NTLJSVQTBLOOSH8FN02JTHVS2HRD758Q94COJF43LFEFPLIQREDMBHQ35UK1PAGIM7J4HGGDUSJMMRG7I1PMBVFU4AJQ0L3IFJBEA197Q88CB6AFU9G5HCNOTGMOH82JNTL6SOLI64NTJ1S1A6LNETRT8L43397SS0PR2TPTS3RBAAE8BU0O2C5JEDMFLGUTBRRUE + +While the correct answer would be + +IBF17FL9HQU0D7IL2S9H9LDT5K9H8BGSS89UIJ5SE7 A8N0JMB 8P6D1UG6NTLJSVQTBLOOSH8FN02JTHVS2HRD758Q94COJF43LFEFPLIQREDMBHQ35UK1PAGIM7J4HGGDUSJMMRG7I1PMBVFU4AJQ0L3IFJBEA197Q88CB6AFU9G5HCNOTGMOH82JNTL6SOLI64NTJ1S1A6LNETRT8L43397SS0PR2TPTS3RBAAE8BU0O2C5JEDMFLGUTBRRUE + +The -O2 -> -O1 gets it right. This duct tape patch remains here until +someone has time to investigate further. + +Patch-Name: tfm-duct-tape-misscompile-on-armhf.patch +Signed-off-by: Sebastian Andrzej Siewior +--- + libclamav/tomsfastmath/mul/fp_mul_comba.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libclamav/tomsfastmath/mul/fp_mul_comba.c b/libclamav/tomsfastmath/mul/fp_mul_comba.c +index d0b6c3b..1474d6a 100644 +--- a/libclamav/tomsfastmath/mul/fp_mul_comba.c ++++ b/libclamav/tomsfastmath/mul/fp_mul_comba.c +@@ -12,6 +12,8 @@ + + */ + ++#pragma GCC optimize ("O1") ++ + #include "bignum_fast.h" + + #if defined(TFM_PRESCOTT) && defined(TFM_SSE2) diff -Nru clamav-0.99.2+dfsg/debian/patches/tfm-fix-compile-errors.patch clamav-0.99.2+dfsg/debian/patches/tfm-fix-compile-errors.patch --- clamav-0.99.2+dfsg/debian/patches/tfm-fix-compile-errors.patch 1970-01-01 00:00:00.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/patches/tfm-fix-compile-errors.patch 2016-10-04 07:25:58.000000000 +0000 @@ -0,0 +1,71 @@ +From 2109cbc60ad4b257df1f2fb5523022ae8cf8e930 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Thu, 13 Aug 2015 23:37:54 +0200 +Subject: tfm: fix compile errors + +Upstream commit: +|From 77be93c2013675a28993e427e4753ca40b43f08f Mon Sep 17 00:00:00 2001 +|From: Steffen Jaeckel +|Date: Sun, 15 Feb 2015 14:50:20 +0100 +|Subject: fix compile errors + +I hope it fixes the armhf FTBFs with gcc-5 + +Patch-Name: tfm-fix-compile-errors.patch +Signed-off-by: Sebastian Andrzej Siewior +--- + libclamav/tomsfastmath/mul/fp_mul_comba.c | 4 +++- + libclamav/tomsfastmath/sqr/fp_sqr_comba.c | 2 +- + libclamav/tomsfastmath/sqr/fp_sqr_comba_generic.c | 7 +++++-- + 3 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/libclamav/tomsfastmath/mul/fp_mul_comba.c b/libclamav/tomsfastmath/mul/fp_mul_comba.c +index ab7eff1..d0b6c3b 100644 +--- a/libclamav/tomsfastmath/mul/fp_mul_comba.c ++++ b/libclamav/tomsfastmath/mul/fp_mul_comba.c +@@ -346,7 +346,9 @@ void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C) + /* execute loop */ + COMBA_FORWARD; + for (iz = 0; iz < iy; ++iz) { +- MULADD(*tmpx++, *tmpy--); ++ fp_digit _tmpx = *tmpx++; ++ fp_digit _tmpy = *tmpy--; ++ MULADD(_tmpx, _tmpy); + } + + /* store term */ +diff --git a/libclamav/tomsfastmath/sqr/fp_sqr_comba.c b/libclamav/tomsfastmath/sqr/fp_sqr_comba.c +index cd37321..521c1b9 100644 +--- a/libclamav/tomsfastmath/sqr/fp_sqr_comba.c ++++ b/libclamav/tomsfastmath/sqr/fp_sqr_comba.c +@@ -109,7 +109,7 @@ asm( \ + "addq %%rax,%0 \n\t" \ + "adcq %%rdx,%1 \n\t" \ + "adcq $0,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","cc"); ++ :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "x"(i) :"%rax","%rdx","cc"); + + #define SQRADD2(i, j) \ + asm( \ +diff --git a/libclamav/tomsfastmath/sqr/fp_sqr_comba_generic.c b/libclamav/tomsfastmath/sqr/fp_sqr_comba_generic.c +index 844f0d4..30e3543 100644 +--- a/libclamav/tomsfastmath/sqr/fp_sqr_comba_generic.c ++++ b/libclamav/tomsfastmath/sqr/fp_sqr_comba_generic.c +@@ -68,12 +68,15 @@ void fp_sqr_comba(fp_int *A, fp_int *B) + + /* execute loop */ + for (iz = 0; iz < iy; iz++) { +- SQRADD2(*tmpx++, *tmpy--); ++ fp_digit _tmpx = *tmpx++; ++ fp_digit _tmpy = *tmpy--; ++ SQRADD2(_tmpx, _tmpy); + } + + /* even columns have the square term in them */ + if ((ix&1) == 0) { +- SQRADD(A->dp[ix>>1], A->dp[ix>>1]); ++ fp_digit _a_dp = A->dp[ix>>1]; ++ SQRADD(_a_dp, A->dp[ix>>1]); + } + + /* store it */ diff -Nru clamav-0.99.2+dfsg/debian/rules clamav-0.99.2+dfsg/debian/rules --- clamav-0.99.2+dfsg/debian/rules 2016-08-18 14:06:38.000000000 +0000 +++ clamav-0.99.2+dfsg/debian/rules 2016-10-04 07:25:58.000000000 +0000 @@ -31,7 +31,6 @@ export enable_llvm=no else SYSTEM_LLVM = -with-system-llvm=/usr/bin/llvm-config --with-llvm-linking=dynamic - SYSTEM_LLVM = -with-system-llvm=/usr/lib/llvm-3.6/bin/llvm-config --with-llvm-linking=dynamic endif # Set the configure options: