Subject: build failure of -current for pc532
To: list NetBSD port-pc532 <port-pc532@netbsd.org>
From: Eyal Lebedinsky <eyal@eyal.emu.id.au>
List: port-pc532
Date: 03/01/2004 00:07:46
This is a multi-part message in MIME format.
--------------050307060705030302000209
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Same failure crossing from Linux (gcc 2.95.4) and native (NetBSD-1.5.3 egcs-1.1.2)
when building 'tools':

cc -DHAVE_CONFIG_H -I. -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas -I. -D_GNU_SOURCE -I. -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas -I../bfd -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/../include -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/.. -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/../bfd -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/../intl -I../intl -DLOCALEDIR="\"/data2/NetBSD/NetBSD-current/src/tooldir.Linux-2.4.25-h1-unknown/share/locale\""   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -O -c /data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c: In function `md_begin':
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1644: parse error before `const'
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1646: `endop' undeclared (first use in this function)
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1646: (Each undeclared identifier is reported only once
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1646: for each function it appears in.)

*** Failed target:  tc-ns32k.o


The following declaration of 'endop' is one line too late, inside the function body.

void
md_begin ()
{
   /* Build a hashtable of the instructions.  */
   const struct ns32k_opcode *ptr;
   const char *stat;
   inst_hash_handle = hash_new ();
   const struct ns32k_opcode *endop;                                <<<<< 1644


Anyone in a position to check in the fix?

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

--------------050307060705030302000209
Content-Type: message/rfc822;
 name="Re: sonic microSCSI"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Re: sonic microSCSI"

Message-ID: <4041A60B.1000905@eyal.emu.id.au>
Date: Sun, 29 Feb 2004 19:42:51 +1100
From: Eyal Lebedinsky <eyal@eyal.emu.id.au>
Organization: Eyal at Home
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113
MIME-Version: 1.0
To: Simon Burge <simonb@wasabisystems.com>
Subject: Re: sonic microSCSI
References: <20040227094337.9BEB22344B@thoreau.thistledown.com.au> <4040B2E5.90905@eyal.emu.id.au> <20040229054820.GA1865@thoreau.thistledown.com.au>
In-Reply-To: <20040229054820.GA1865@thoreau.thistledown.com.au>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Simon Burge wrote:
> Hi Eyal,
 >
> Things have changed quite a bit since 1.5.  The tools needed
> to build netbsd are now built by the build process itself.
> 
> You'd need to do something like
> 
> 	./build.sh -m pc532 tools
> 	./build.sh -m pc532 kernel=E4
> 
> The good thing is that those two commands will work on any arch and many
> other operating systems.  The bad news is that you'll be waiting days
> and days if you want to do that on your '532. :-(

My Linux build failed:

cc -DHAVE_CONFIG_H -I. -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas -I. -D_GNU_SOURCE -I. -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas -I../bfd -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/../include -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/.. -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/../bfd -I/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/../intl -I../intl -DLOCALEDIR="\"/data2/NetBSD/NetBSD-current/src/tooldir.Linux-2.4.25-h1-unknown/share/locale\""   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -O -c /data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c: In function `md_begin':
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1644: parse error before `const'
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1646: `endop' undeclared (first use in this function)
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1646: (Each undeclared identifier is reported only once
/data2/NetBSD/NetBSD-current/src/tools/binutils/../../gnu/dist/binutils/gas/config/tc-ns32k.c:1646: for each function it appears in.)

*** Failed target:  tc-ns32k.o

void
md_begin ()
{
   /* Build a hashtable of the instructions.  */
   const struct ns32k_opcode *ptr;
   const char *stat;
   inst_hash_handle = hash_new ();
   const struct ns32k_opcode *endop;								<<<<< 1644

   endop = ns32k_opcodes + sizeof (ns32k_opcodes) / sizeof (ns32k_opcodes[0]);			<<<<< 1646


I think my gcc (2.95.4 on Debian stable) does not read
	inst_hash_handle = hash_new ();
as
	int inst_hash_handle = hash_new ();
the traditional way, and neither does it allow decls after the function start
unless told so.

To play it safe I moved the decl of 'endop' one line earlier. It is going now
(does the build restart or continue when I repeat the build command?).

Does the NetBSD programming style allow gcc extensions (like the above decl out of place)?

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>


--------------050307060705030302000209--