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 <email@example.com>
Date: 03/20/2007 15:55:13
Content-Type: text/plain; charset=US-ASCII
At Tue, 20 Mar 2007 05:26:42 +0300,
Valeriy E. Ushakov wrote:
> On Mon, Mar 19, 2007 at 21:59:01 -0400, Greg A. Woods wrote:
> > That line is:
> > extern const struct relax_type md_relax_table;
> > 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
> 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
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 firstname.lastname@example.org and a
suggested fix is here:
I'll try that.
Greg A. Woods
H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <email@example.com>
Planix, Inc. <firstname.lastname@example.org> Secrets of the Weird <email@example.com>
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
-----END PGP SIGNATURE-----