Subject: pkg/36549: sysutils/grub netboot code doesn't compile with gcc 4
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dieter.NetBSD@pandora.be>
List: pkgsrc-bugs
Date: 06/24/2007 18:45:01
>Number: 36549
>Category: pkg
>Synopsis: sysutils/grub netboot code doesn't compile with gcc 4
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 24 18:45:00 +0000 2007
>Originator: dieter roelants
>Release: NetBSD 4.99.20
>Organization:
>Environment:
System: NetBSD simult.amelgem.be 4.99.20 NetBSD 4.99.20 (SIMULT) #21: Sun Jun 10 12:34:40 CEST 2007 dieter@simult.amelgem.be:/build/obj.i386.current/sys/arch/i386/compile/SIMULT i386
Architecture: i386
Machine: i386
>Description:
GRUB has netboot code which is enabled in pkgsrc when
GRUB_NETWORK_CARDS is defined. However, this does not
compile with gcc 4.1.2 from -current or -4.
>How-To-Repeat:
cd pkgsrc/sysutils/grub && make GRUB_NETWORK_CARDS=sis900
>Fix:
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/grub/distinfo,v
retrieving revision 1.21
diff -u -r1.21 distinfo
--- distinfo 17 Dec 2006 19:21:43 -0000 1.21
+++ distinfo 24 Jun 2007 16:34:15 -0000
@@ -13,3 +13,6 @@
SHA1 (patch-ah) = ff62b64177a0e68400c32e013cb585526db94217
SHA1 (patch-ai) = 60088cf6786a364da37e19fbb5df4c6fd7641016
SHA1 (patch-aj) = bfbac23a7c250ed615dcfb4a988708c970b617d8
+SHA1 (patch-ak) = 8e67eb603e639ca47536cb191e7e29ec48b95642
+SHA1 (patch-al) = 58761e867ff182ad46c42b15575395ba8c38fbd6
+SHA1 (patch-am) = d848f67f7f21fa076751d14bd3235ae7351be1b7
Index: patches/patch-ak
===================================================================
RCS file: patches/patch-ak
diff -N patches/patch-ak
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ak 24 Jun 2007 16:34:15 -0000
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- /build/pkg_comp/default/pkg_comp/obj/pkgsrc/sysutils/grub/default/grub-0.97/netboot/etherboot.h 2003-07-09 13:45:37.000000000 +0200
++++ netboot/etherboot.h 2007-06-24 15:28:38.000000000 +0200
+@@ -531,9 +531,7 @@
+ extern int network_ready;
+ extern struct rom_info rom;
+ extern struct arptable_t arptable[MAX_ARP];
+-extern struct bootpd_t bootp_data;
+ #define BOOTP_DATA_ADDR (&bootp_data)
+-extern unsigned char *end_of_rfc1533;
+
+ /* config.c */
+ extern struct nic nic;
Index: patches/patch-al
===================================================================
RCS file: patches/patch-al
diff -N patches/patch-al
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-al 24 Jun 2007 16:34:15 -0000
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- /build/pkg_comp/default/pkg_comp/obj/pkgsrc/sysutils/grub/default/grub-0.97/netboot/sis900.c 2003-07-09 13:45:38.000000000 +0200
++++ netboot/sis900.c 2007-06-24 18:15:38.000000000 +0200
+@@ -901,7 +901,7 @@
+ const char *p) /* Packet */
+ {
+ u32 status, to, nstype;
+- u32 tx_status;
++ volatile u32 tx_status;
+
+ /* Stop the transmitter */
+ outl(TxDIS, ioaddr + cr);
+@@ -940,7 +940,7 @@
+
+ to = currticks() + TX_TIMEOUT;
+
+- while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
++ while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
+ /* wait */ ;
+
+ if (currticks() >= to) {
Index: patches/patch-am
===================================================================
RCS file: patches/patch-am
diff -N patches/patch-am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-am 24 Jun 2007 16:34:15 -0000
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- /build/pkg_comp/default/pkg_comp/obj/pkgsrc/sysutils/grub/default/grub-0.97/netboot/natsemi.c 2003-07-09 13:45:38.000000000 +0200
++++ netboot/natsemi.c 2007-06-24 18:25:21.000000000 +0200
+@@ -608,7 +608,7 @@
+ const char *p) /* Packet */
+ {
+ u32 status, to, nstype;
+- u32 tx_status;
++ volatile u32 tx_status;
+
+ /* Stop the transmitter */
+ outl(TxOff, ioaddr + ChipCmd);
+@@ -647,7 +647,7 @@
+
+ to = currticks() + TX_TIMEOUT;
+
+- while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
++ while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
+ /* wait */ ;
+
+ if (currticks() >= to) {