Subject: Re: 2.0beta build failure on sparc
To: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
From: Bruce ONeel <edoneel@sdf.lonestar.org>
List: current-users
Date: 06/16/2004 12:49:23
I'll second the -O2 in the COPTS line as the likely problem.  I see
that when building for m68k.

cheers

bruce

"Michael L. Hitch" <mhitch@lightning.msu.montana.edu> wrote:
> Date: Tue, 15 Jun 2004 21:06:34 -0600 (MDT)
> From: "Michael L. Hitch" <mhitch@lightning.msu.montana.edu>
> Subject: Re: 2.0beta build failure on sparc
> To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
> Cc: current-users@NetBSD.org
>=20
> On Sun, 13 Jun 2004, Hauke Fath wrote:
>=20
> > 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-pro=
totypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-t=
raditional -Wno-uninitialized  -Werror   -DINET6 -DHAVE_FUNCTION_MACR=
O=3D1 -DHAVE_LIBCRYPTO=3D1 -DHAVE_LIBL=3D1 -DHAVE_LIBY=3D1 -DENABLE_I=
PV6=3D1 -DADVAPI=3D1 -DHAVE_GETADDRINFO=3D1 -DHAVE_GETNAMEINFO=3D1 -D=
STDC_HEADERS=3D1 -DHAVE_SYS_WAIT_H=3D1 -DHAVE_LIMITS_H=3D1 -DHAVE_SYS=
_TIME_H=3D1 -DHAVE_UNISTD_H=3D1 -DHAVE_STDARG_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_ST=
RERROR=3D1 -DHAVE_STRTOL=3D1 -DHAVE_STRTOUL=3D1 -DHAVE_STRDUP=3D1 -DH=
AVE_GETIFADDRS=3D1 -DHAVE_ARC4RANDOM=3D1 -DHAVE_PFKEYV2 -DYIPS_DEBUG =
-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/di=
st/kame/racoon/missing -DHAVE_GSSAPI -I/scratch/ne

> > --- crypto_openssl.o ---
> > /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c: In fu=
nction `eay_str2asn1dn':
> > /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c:185: w=
arning: dereferencing type-punned pointer will break strict-aliasing =
rules
> > /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c: In fu=
nction `eay_cmp_asn1dn':
> > /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c:214: w=
arning: dereferencing type-punned pointer will break strict-aliasing =
rules
> > /u1/netbsd-20/src/crypto/dist/kame/racoon/crypto_openssl.c:217: w=
arning: dereferencing type-punned pointer will break strict-aliasing =
rules
> ...
> > 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?
>=20
>   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 -O=
2, and
> crypto_openssl.c compiles fine with default options.  With -O2, the=
re are
> more stringent checks, which result in the above errors.
>=20
>   The following patch will allow it to compile:
>=20
> 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:1=
8 -0000      1.12
> +++ crypto/dist/kame/racoon/crypto_openssl.c    16 Jun 2004 02:55:2=
1 -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;
>=20
> @@ -211,10 +211,10 @@
>         int i =3D -1;
>=20
>         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;
>=20
>         i =3D X509_NAME_cmp(a, b);
>=20
>=20
> --
> Michael L. Hitch=09=09=09mhitch@montana.edu
> Computer Consultant
> Information Technology Center
> Montana State University=09Bozeman, MT=09USA