# ClamAV update



## talsamon (Nov 19, 2014)

The update to clamav-0.98.5 failed with clang but compiles with gcc48 (on FreeBSD-9.3-p5 amd64, but compiles also with clang on FreeBSD-10.1).

```
../libclamav/others.h:317: error: expected specifier-qualifier-list before 'clcb_file_props'
../libclamav/others.h:388: error: expected specifier-qualifier-list before 'clcb_file_props'
../shared/cdiff.c: In function 'cdiff_apply':
../shared/cdiff.c:781: error: 'EVP_MD_CTX' undeclared (first use in this function)
../shared/cdiff.c:781: error: (Each undeclared identifier is reported only once
../shared/cdiff.c:781: error: for each function it appears in.)
../shared/cdiff.c:781: error: 'sha256ctx' undeclared (first use in this function)
Makefile:685: recipe for target 'cdiff.o' failed
gmake[2]: *** [cdiff.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/freshclam'
Makefile:717: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5'
Makefile:545: recipe for target 'all' failed
gmake: *** [all] Error 2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1
```

I suggest to turn off option LLVM by default. (without this option it works).

I posted it to the maintainer.


----------



## talsamon (Nov 19, 2014)

Now I am not sure. I can't repeat the error.


----------



## Polideuces (Nov 19, 2014)

Hi,

Here is the error:


```
cd /usr/ports/security/clamav && make reinstall
===> Building for clamav-0.98.5
gmake all-recursive
gmake[1]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5'
Making all in libltdl
gmake[2]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libltdl'
gmake all-am
gmake[3]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libltdl'
gmake[3]: Nothing to be done for 'all-am'.
gmake[3]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libltdl'
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libltdl'
Making all in libclamav
gmake[2]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav'
gmake all-recursive
gmake[3]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav'
Making all in c++
gmake[4]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav/c++'
gmake all-am
gmake[5]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav/c++'
gmake[5]: Nothing to be done for 'all-am'.
gmake[5]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav/c++'
gmake[4]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav/c++'
gmake[4]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav'
GEN version.h.tmp
GEN version.h
gmake[4]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav'
gmake[3]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav'
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/libclamav'
Making all in clamscan
gmake[2]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/clamscan'
gmake[2]: Nothing to be done for 'all'.
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/clamscan'
Making all in clamd
gmake[2]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/clamd'
gmake[2]: Nothing to be done for 'all'.
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/clamd'
Making all in clamdscan
gmake[2]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/clamdscan'
gmake[2]: Nothing to be done for 'all'.
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/clamdscan'
Making all in freshclam
gmake[2]: Entering directory '/usr/ports/security/clamav/work/clamav-0.98.5/freshclam'
CC cdiff.o
In file included from ../libclamav/others.h:52,
from ../libclamav/matcher.h:28,
from ../libclamav/others.h:22,
from ../shared/cdiff.c:41:
../libclamav/crtmgr.h:33: error: 'SHA1_HASH_SIZE' undeclared here (not in a function)
In file included from ../libclamav/matcher.h:28,
from ../libclamav/others.h:22,
from ../shared/cdiff.c:41:
../libclamav/others.h:317: error: expected specifier-qualifier-list before 'clcb_file_props'
../libclamav/others.h:388: error: expected specifier-qualifier-list before 'clcb_file_props'
../shared/cdiff.c: In function 'cdiff_apply':
../shared/cdiff.c:781: error: 'EVP_MD_CTX' undeclared (first use in this function)
../shared/cdiff.c:781: error: (Each undeclared identifier is reported only once
../shared/cdiff.c:781: error: for each function it appears in.)
../shared/cdiff.c:781: error: 'sha256ctx' undeclared (first use in this function)
Makefile:685: recipe for target 'cdiff.o' failed
gmake[2]: *** [cdiff.o] Error 1
gmake[2]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5/freshclam'
Makefile:717: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/usr/ports/security/clamav/work/clamav-0.98.5'
Makefile:545: recipe for target 'all' failed
gmake: *** [all] Error 2
*** [do-build] Error code 1

Stop in /usr/ports/security/clamav.
*** [reinstall] Error code 1

Stop in /usr/ports/security/clamav.
```


----------



## xtaz (Nov 19, 2014)

Doesn't work for me on clang on 10.1. If you've reported it to the maintainer then hopefully they can sort it though.


----------



## garga@ (Nov 19, 2014)

xtaz said:


> Doesn't work for me on clang on 10.1. If you've reported it to the maintainer then hopefully they can sort it though.



Are you seeing same error on 10.1 with clang?


----------



## garga@ (Nov 19, 2014)

talsamon said:


> to clamav-0.98.5 failed with clang but compiles with gcc48 (on FreeBSD-9.3-p5 amd64, but compiles also with clang on FreeBSD-10.1).
> 
> ```
> ../libclamav/others.h:317: error: expected specifier-qualifier-list before 'clcb_file_props'
> ...



I built it fine on my test jails (8.4, 9.3, 10.1 and 11-current) with default compiler for each version. I'll try to build it on 9 with clang to reproduce the problem.


----------



## garga@ (Nov 19, 2014)

I coundn't reproduce it with default options on 9.3-RELEASE-p5 with make.conf containing:

```
CC=clang
CXX=clang++
CPP=clang-cpp
```

Could you please share your config.log, make.conf and result of `make showconfig`?


----------



## talsamon (Nov 19, 2014)

make.conf

```
FORCE_PKG_REGISTER=YES
WITH_PKGNG=YES
WITH_NEW_XORG=YES
WITH_BDB_VER=5
OVERRIDE_LINUX_BASE_PORT=c6
OVERRIDE_LINUX_NONBASE_PORTS=c6
```

The only option which was changed from default, was `ICONV=ON` (it's default off), I see it right now.

In my case, only the first try with `portmaster` and the second in the port fails. After I compile it with gcc I can't repeat the error.


----------



## garga@ (Nov 19, 2014)

Oh, it's something that happened in the past. The problem only happens when you have an old clamav version installed and try to build a new one. I'll check if it's reproducible here.


----------



## xtaz (Nov 19, 2014)

garga@ said:


> Are you seeing same error on 10.1 with clang?



Yes. I have 10.1-STABLE and using clang 3.4.1 without any special options in make.conf and get the same error about sha256ctx.


----------



## derwood (Nov 19, 2014)

garga@ said:


> Oh, it's something that happened in the past. The problem only happens when you have an old clamav version installed and try to build a new one. I'll check if it's reproducible here.



Seeing this error on 9.3 with clang 3.4.1.  Trying to upgrade clamav-0.98.4_2.

Here is make.conf: 
	
	



```
OPTIONS_UNSET=X11
WITH_PKGNG=yes
NO_WARNING_PKG_INSTALL_EOL=yes
MAKE_JOBS_UNSAFE=yes
DEFAULT_VERSIONS+=apache=2.2
```


----------



## xtaz (Nov 19, 2014)

garga@ said:


> Oh, it's something that happened in the past. The problem only happens when you have an old clamav version installed and try to build a new one. I'll check if it's reproducible here.



You're right! I just uninstalled the old version before trying to build the new one and it works fine. I also remember having to do this before now.


----------



## garga@ (Nov 21, 2014)

The ClamaAV team is working on a fix for this, you can follow it at https://bugzilla.clamav.net/show_bug.cgi?id=11194


----------

