[csw-maintainers] Fwd: ClamAV 0.96 on Solaris9/10 - Intel

Peter Bonivart bonivart at opencsw.org
Wed Mar 31 16:20:13 CEST 2010


The below forwarded message was sent from a Clam Antivirus developer
that uses our build farm to test their Solaris builds. I contacted him
about difficulties building the latest 0.96rc2 on Solaris 9 i386 and
this is what he found.

Peter Felecan added this about differences between the gcc3 and gcc4 packages:

> The lesson from your diagnosis is that an includes fixing must be done at
> install time of the gcc4 package; if that's not the case, the fixing can
> be called on the system on which the package is installed.
>
> As I'm not the maintainer of the gcc4 packages, the only thing for which
> I can help is to say that for gcc3 the includes fixing is done at
> installation time.

Are you Mike willing to take a look at it or should someone else try to fix it?

/peter

---------- Forwarded message ----------
From: Török Edwin <edwin at clamav.net>
Date: 2010/3/31
Subject: ClamAV 0.96 on Solaris9/10 - Intel
To: Peter Bonivart <bonivart at opencsw.org>
Cc: Peter FELECAN <pfelecan at opencsw.org>, buildfarm at opencsw.org


Hi Peter,

First of all I found the problem with the broken gcc4 on Solaris9 on the
buildfarm: you have a gcc4 built on Solaris8, and it has fix-includes
from Solaris8 headers!

$ cat >x.c
#include <sys/types.h>
#include <signal.h>

If I include <sys/types.h> it is missing upad128_t needed by signal.h:
$ /opt/csw/gcc4/bin/g++ -E x.c | grep upad128
 upad128_t fx_xmm[8];
 upad128_t __fx_ign2[14];
  upad128_t xmm[8];

However the type is there:
$ /opt/csw/gcc4/bin/g++ -E /usr/include/sys/types.h|grep upad128
} upad128_t;

Then I found that on Solaris9 (current9x) you are using the Solaris8
headers:
/opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.3.3/include-fixed/sys/types.h

/opt/csw/gcc4/bin/gcc -v
Using built-in specs.
Target: i386-pc-solaris2.8

So when you built GCC4 on Solaris8, it has run fix-includes on
sys/types.h, and it is using that instead of system's sys/types.h.
That works fine on Solaris8 (I assume), however is wrong for Solaris9
(which has a different sys/types.h header).
Although the gcc4 from Solaris8 is probably binary compatible with
Solaris9, using a header from Solaris8 on Solaris9 is certainly not
compatible.

So you need to build GCC4 on Solaris9, so that it runs fix-includes on
the Solaris9 header.

Once you have a GCC4 built on Solaris9 you should be able to use that to
build ClamAV.

For reference here is the error you get with gcc4 on Solaris9
$ /opt/csw/gcc4/bin/g++ x.c
In file included from
/opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.3.3/include-fixed/sys/reg.h:22,
                from /usr/include/sys/regset.h:24,
                from /usr/include/sys/ucontext.h:21,
                from
/opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.3.3/include-fixed/sys/signal.h:252,
                from
/opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.3.3/include-fixed/signal.h:36,
                from x.c:2:
/usr/include/ia32/sys/reg.h:300: error: 'upad128_t' does not name a type
/usr/include/ia32/sys/reg.h:301: error: 'upad128_t' does not name a type
/usr/include/ia32/sys/reg.h:331: error: 'upad128_t' does not name a type

BTW everything is fine when building on Solaris10/Intel (and everything
is fine on Solaris8,9,10/Sparc):
I tested this:
http://git.clamav.net/gitweb?p=clamav-devel.git;a=snapshot;h=c5fb062ec3a22b2e35fca555cb59d4a5646fef2e;sf=tgz

Solaris10/Intel:

$ export PATH=/usr/bin:/usr/ccs/bin:/opt/csw/bin
$ export LD_LIBRARY_PATH=/opt/csw/gcc4/lib
$ ./configure CC=/opt/csw/gcc4/bin/gcc CXX=/opt/csw/gcc4/bin/g++
--disable-clamav --enable-llvm --enable-check
--with-libcheck-prefix=/home/edwin/checkx
$ gmake -j2
$ gmake check -j2

....
PASS: llvmcheck.sh

==================

All 6 tests passed

==================
....
PASS: check_freshclam.sh
PASS: check_sigtool.sh
SKIP: check_unit_vg.sh
PASS: check1_clamscan.sh
PASS: check_clamav
PASS: check2_clamd.sh
PASS: check3_clamd.sh
SKIP: check5_clamd_vg.sh
SKIP: check6_clamd_vg.sh
SKIP: check7_clamd_hg.sh
SKIP: check8_clamd_hg.sh
PASS: check4_clamd.sh

======================
All 7 tests passed
(5 tests were not run)
======================

Best regards,
--Edwin



-- 
/peter


More information about the maintainers mailing list