app-antivirus/clamav-0.96 fails to build on uclibc-0.9.30.1-r1 Reproducible: Always Error info: make[5]: Entering directory `/var/tmp/portage/app-antivirus/clamav-0.96/work/clamav-0.96/libclamav/c++' CXX libclamavcxx_la-bytecode2llvm.lo CXX libclamavcxx_la-ClamBCRTChecks.lo CXX CallGraph.lo CXX AliasAnalysis.lo CXX BasicAliasAnalysis.lo In file included from /usr/lib/gcc/i386-gentoo-linux-uclibc/4.3.4/include/g++-v4/cerrno:48, from bytecode2llvm.cpp:75: /usr/include/errno.h:73: error: multiple types in one declaration /usr/include/errno.h:73: error: declaration does not declare anything CXX CaptureTracking.lo ClamBCModule.h:8: warning: 'void ClamBCModule::stop(const char*, llvm::Function*, llvm::Instruction*)' defined but not used make[5]: *** [libclamavcxx_la-bytecode2llvm.lo] Error 1 make[5]: *** Waiting for unfinished jobs.... make[5]: Leaving directory `/var/tmp/portage/app-antivirus/clamav-0.96/work/clamav-0.96/libclamav/c++' make[4]: *** [all] Error 2 make[4]: Leaving directory `/var/tmp/portage/app-antivirus/clamav-0.96/work/clamav-0.96/libclamav/c++' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/app-antivirus/clamav-0.96/work/clamav-0.96/libclamav' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/tmp/portage/app-antivirus/clamav-0.96/work/clamav-0.96/libclamav' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/app-antivirus/clamav-0.96/work/clamav-0.96' make: *** [all] Error 2 * ERROR: app-antivirus/clamav-0.96 failed: * emake failed * * Call stack: * ebuild.sh, line 48: Called src_compile * environment, line 2909: Called _eapi2_src_compile * ebuild.sh, line 640: Called die * The specific snippet of code: * emake || die "emake failed" ------------------------------------ # emerge --info =app-antivirus/clamav-0.96 Portage 2.2_rc67 (uclibc/x86/hardened, gcc-4.3.4, uclibc-0.9.30.1-r1, 2.6.32-hardened-r2 i686) ================================================================= System Settings ================================================================= System uname: Linux-2.6.32-hardened-r2-i686-Intel-R-_Xeon-R-_CPU_5130_@_2.00GHz-with-gentoo-2.0.1 Timestamp of tree: Wed, 28 Apr 2010 10:00:01 +0000 app-shells/bash: 4.1_p5 dev-lang/python: 2.6.2-r1 dev-python/pycrypto: 2.1.0 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.6.1-r1 sys-apps/sandbox: 2.2 sys-devel/autoconf: 2.65 sys-devel/automake: 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1 sys-devel/gcc: 3.4.6-r2, 4.3.4 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.33 ACCEPT_KEYWORDS="x86 ~x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i386-gentoo-linux-uclibc" CFLAGS="-Os -pipe" CHOST="i386-gentoo-linux-uclibc" CONFIG_PROTECT="/etc /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-Os -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests autoconfig buildpkg distlocks fixpackages news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1" MAKEOPTS="-j5" PKGDIR="/var/tmp/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://gary/soekris-portage" USE="cli cracklib crypt cxx dri hardened logrotate modules mudflap ncurses openmp pcre pic readline reflection session spl ssl tcpd uclibc x86 xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="uclibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
*** Bug 317647 has been marked as a duplicate of this bug. ***
Okay what's happening here is that libclamav/c++/llvm/configure is checking for the declaration of error_t via the inclusion of <argz.h> which you can see around lines 9958: ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if HAVE_ARGZ_H # include <argz.h> #endif " if test "x$ac_cv_type_error_t" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF But there is no argz.h on uclibc so this fails even though error_t gets typedefed to int on line 70 of <errno.h> causing a multiple type def. I'm still not sure how to elegantly fix this. A wrong solution (though useful dignostically) is to just comment out line 70 of errno.h to see that the multiple type def is relieved.
There are two ways to go, we can either hack the build system to properly detect error_t or we can just tell it that error_t exists, which is guaranteed a uclibc system vi errno.h. Here's a simple patch to the ebuild that would fix it. I will still pursue the build system fix upstream. --- clamav-0.97.6.ebuild.orig 2012-11-13 11:22:19.286922709 +0000 +++ clamav-0.97.6.ebuild 2012-11-13 11:22:49.687673895 +0000 @@ -13,7 +13,7 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" -IUSE="bzip2 clamdtop iconv ipv6 milter selinux static-libs" +IUSE="bzip2 clamdtop iconv ipv6 milter selinux static-libs uclibc" CDEPEND="bzip2? ( app-arch/bzip2 ) clamdtop? ( sys-libs/ncurses ) @@ -42,6 +42,7 @@ src_prepare() { use ppc64 && append-flags -mminimal-toc + use uclibc && export ac_cv_type_error_t=yes } src_configure() {
Yeah this one is a thorny mess that ultimately derives from the fact that clamav bundles llvm (yes!) and the problem stems from there. See bug #446080. See that bug for details. I'll open an upstream bug report for clamav to make them aware, but they may be at the mercy of llvm. For gentoo, I think my fix in comment 3 is the best way to go for now. net-mail and antivirus are pretty quiet right now, so I'll commit this in a week or so if there are no objections.
This was reported upstream, but the bug was closed WORKSFORME. However the earlier bug doesn't get to the problem in llvm, so I opened another: https://bugzilla.clamav.net/show_bug.cgi?id=6329
+*clamav-0.97.6-r1 (06 Dec 2012) + + 06 Dec 2012; Eray Aslan <eras@gentoo.org> +clamav-0.97.6-r1.ebuild, + +files/clamd.initd-r1: + Fix run directory permissions - bug #44766. Fix building on uclibc - bug + #317635 +