Subject: Re: 2.0beta build failure on sparc
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
From: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
List: current-users
Date: 06/15/2004 21:06:34
On Sun, 13 Jun 2004, Hauke Fath wrote:

> my 2.0beta builds on a sparcstation 10 fail consistently at
>
> #   compile  racoon/cfparse.o
> /scratch/netbsd-builds/2_0/sparc/tools/bin/sparc--netbsdelf-gcc -g -mcpu=
=3Dsupersparc -mcpu=3Dsupersparc -O2 -pipe  -Wall -Wstrict-prototypes -Wmis=
sing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-uni=
nitialized  -Werror   -DINET6 -DHAVE_FUNCTION_MACRO=3D1 -DHAVE_LIBCRYPTO=3D=
1 -DHAVE_LIBL=3D1 -DHAVE_LIBY=3D1 -DENABLE_IPV6=3D1 -DADVAPI=3D1 -DHAVE_GET=
ADDRINFO=3D1 -DHAVE_GETNAMEINFO=3D1 -DSTDC_HEADERS=3D1 -DHAVE_SYS_WAIT_H=3D=
1 -DHAVE_LIMITS_H=3D1 -DHAVE_SYS_TIME_H=3D1 -DHAVE_UNISTD_H=3D1 -DHAVE_STDA=
RG_H=3D1 -DHAVE_VARARGS_H=3D1 -DTIME_WITH_SYS_TIME=3D1 -DRETSIGTYPE=3Dvoid =
-DHAVE_VPRINTF=3D1 -DHAVE_GETTIMEOFDAY=3D1 -DHAVE_SELECT=3D1 -DHAVE_SOCKET=
=3D1 -DHAVE_STRERROR=3D1 -DHAVE_STRTOL=3D1 -DHAVE_STRTOUL=3D1 -DHAVE_STRDUP=
=3D1 -DHAVE_GETIFADDRS=3D1 -DHAVE_ARC4RANDOM=3D1 -DHAVE_PFKEYV2 -DYIPS_DEBU=
G -DIPSEC  -I. -I/u1/netbsd-20/src/crypto/dist/kame/racoon -DSYSCONFDIR=3D\=
"/etc/racoon\" -DHAVE_OPENSSL_OPENSSLV_H=3D1 -DYY_NO_UNPUT -I/u1/netbsd-20/=
src/crypto/dist/kame/libipsec -I/u1/netbsd-20/src/crypto/dist/kame/racoon/m=
issing -DHAVE_GSSAPI -I/scratch/netbsd-builds/2_0/sparc/destdir/usr/include=
/krb5 -DHAVE_SIGNING_C=3D1 -DHAVE_OPENSSL_PEM_H=3D1 -DHAVE_OPENSSL_X509_H=
=3D1  -DHAVE_OPENSSL_EVP_H=3D1  -nostdinc -isystem /scratch/netbsd-builds/2=
_0/sparc/destdir/usr/include  -c    cfparse.c
> --- crypto_openssl.o ---
> /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c: In function `=
eay_str2asn1dn':
> /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c:185: warning: =
dereferencing type-punned pointer will break strict-aliasing rules
> /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c: In function `=
eay_cmp_asn1dn':
> /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c:214: warning: =
dereferencing type-punned pointer will break strict-aliasing rules
> /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c:217: warning: =
dereferencing type-punned pointer will break strict-aliasing rules
=2E..
> didn't help any. The relevant part of /etc/mk.conf is
>
> CFLAGS +=3D=09=09-mcpu=3Dsupersparc
> CXXFLAGS +=3D=09=09-mcpu=3Dsupersparc
> COPTS =3D =09=09-mcpu=3Dsupersparc -O2 -pipe
>
> Any ideas?

  I think it's a result of the COPTS line in /etc/mk.conf.  I think the
files in racoon (and perhaps others) don't normally compile with -O2, and
crypto_openssl.c compiles fine with default options.  With -O2, there are
more stringent checks, which result in the above errors.

  The following patch will allow it to compile:

Index: crypto/dist/kame/racoon/crypto_openssl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/crypto/dist/kame/racoon/crypto_openssl.c,v
retrieving revision 1.12
diff -u -r1.12 crypto_openssl.c
--- crypto/dist/kame/racoon/crypto_openssl.c    21 Oct 2003 03:05:18 -0000 =
     1.12
+++ crypto/dist/kame/racoon/crypto_openssl.c    16 Jun 2004 02:55:21 -0000
@@ -182,7 +182,7 @@
        if (!ret)
                goto err;
        p =3D ret->v;
-       i =3D i2d_X509_NAME(name, (unsigned char **)&p);
+       i =3D i2d_X509_NAME(name, (unsigned char **)(void *)&p);
        if (!i)
                goto err;

@@ -211,10 +211,10 @@
        int i =3D -1;

        p =3D n1->v;
-       if (!d2i_X509_NAME(&a, (unsigned char **)&p, n1->l))
+       if (!d2i_X509_NAME(&a, (unsigned char **)(void *)&p, n1->l))
                goto end;
        p =3D n2->v;
-       if (!d2i_X509_NAME(&b, (unsigned char **)&p, n2->l))
+       if (!d2i_X509_NAME(&b, (unsigned char **)(void *)&p, n2->l))
                goto end;

        i =3D X509_NAME_cmp(a, b);


--
Michael L. Hitch=09=09=09mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University=09Bozeman, MT=09USA