Subject: Re: another go at cross-building netbsd-1-6 on a netbsd-4 host
To: NetBSD Toolchain and Build Technical Discussion List <tech-toolchain@NetBSD.org>
From: Greg A. Woods <woods@planix.com>
List: tech-toolchain
Date: 03/20/2007 15:55:13
--pgp-sign-Multipart_Tue_Mar_20_15:55:11_2007-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Tue, 20 Mar 2007 05:26:42 +0300,
Valeriy E. Ushakov wrote:
>=20
> On Mon, Mar 19, 2007 at 21:59:01 -0400, Greg A. Woods wrote:
> >=20
> > That line is:
> >=20
> > 	extern const struct relax_type md_relax_table[];
> >=20
> > So I'm guessing the definition for "struct relax_type" isn't in scope,
> > and indeed it's not in that file anywhere.  I find it in ../as.h and
> > ../tc.h, but I'm not a GCC hacker and I don't know what the right fix
> > should be, nor do I understand why the same error doesn't occur when I
> > build the 1.6 source on a 1.6 host
>=20
> netbsd-4 has gcc4 as the system compiler and gcc4 no longer accepts
> arrays of incompelte type.  gcc3 and earlier versions accepted them,
> treating the name as struct foo * and would only report an error if
> you try to do something that needs the complete definition.  gcc4
> treats mere declaration of such struct as an error.  This is
> apparently what C99 specifies.

Gak!  Even adding "-std=3Dc89" or "-ansi" and/or "-Wno-all" doesn't help
any.

And of course "-traditional" isn't a truly valid option any more.

Sigh.  That's incredibly, extremely, sadly, very funny.  GCC is
apparently not even backwards compatible with its own overall code base.

I always hated those forms of incomplete declarations myself, but I
never expected to find them causing trouble between GCC versions.

A post on a GCC list suggests this should only be a diagnostic warning
for C99 and it's not even a constraint in C90.  Other posts elsewhere
suggest work-arounds of going back to GCC3.  Double-sigh.

BTW, apparently this is "Bug gas/793" at bug-binutils@gnu.org and a
suggested fix is here:

    http://kegel.com/crosstool/crosstool-0.43/patches/binutils-2.15/binutil=
s-2.15-allow-gcc-4.0.patch

I'll try that.

--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

--pgp-sign-Multipart_Tue_Mar_20_15:55:11_2007-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: B2wPyZDJE5T9T8XHNg/Kbuavy9T541hF

iQA/AwUBRgA8IWZ9cbd4v/R/EQJ2eQCg1A1SU6szStRKqMvjYt0A1FfRDIYAniuh
Io/zAIA+IUnJFwGoV47F4DEZ
=cpLE
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Tue_Mar_20_15:55:11_2007-1--