Skip to contentSkip to conversation

fix build breakage by ieee1275 ofconsole

PATCH In review Joey Korkames 2 participants 2 messages Feb 24, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix build breakage by ieee1275 ofconsole

A recent trunk commit (r2213) prevents me from building grub2 (Debian Lenny amd64): here's my fix. I have no idea what the end result is (and have no PPC equipment to test with), so maybe someone who understands this code can clarify things.

The error that was being generated:

# make
...
gcc -Ikern/generic -I/build/grub2-1.98~20100223/kern/generic -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.3.2/include -I/build/grub2-1.98~20100223/include -I. -I./include -Wall -W  -Os -DGRUB_MACHINE_IEEE1275=1 -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -DUSE_ASCII_FAILBACK=1 -ffreestanding -mrtd -mregparm=3 -I/build/grub2-1.98~20100223/debian/grub-extras/zfs/include -MD -c -o kernel_img-kern_generic_millisleep.o /build/grub2-1.98~20100223/kern/generic/millisleep.c
gcc -Ikern/ieee1275 -I/build/grub2-1.98~20100223/kern/ieee1275 -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.3.2/include -I/build/grub2-1.98~20100223/include -I. -I./include -Wall -W  -Os -DGRUB_MACHINE_IEEE1275=1 -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -DUSE_ASCII_FAILBACK=1 -ffreestanding -mrtd -mregparm=3 -I/build/grub2-1.98~20100223/debian/grub-extras/zfs/include -MD -c -o kernel_img-kern_ieee1275_ieee1275.o /build/grub2-1.98~20100223/kern/ieee1275/ieee1275.c
gcc -Iterm/ieee1275 -I/build/grub2-1.98~20100223/term/ieee1275 -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.3.2/include -I/build/grub2-1.98~20100223/include -I. -I./include -Wall -W  -Os -DGRUB_MACHINE_IEEE1275=1 -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -DUSE_ASCII_FAILBACK=1 -ffreestanding -mrtd -mregparm=3 -I/build/grub2-1.98~20100223/debian/grub-extras/zfs/include -MD -c -o kernel_img-term_ieee1275_ofconsole.o /build/grub2-1.98~20100223/term/ieee1275/ofconsole.c
cc1: warnings being treated as errors
/build/grub2-1.98~20100223/term/ieee1275/ofconsole.c: In function 'grub_ofconsole_readkey':
/build/grub2-1.98~20100223/term/ieee1275/ofconsole.c:260: error: declaration of 'start' shadows a previous local
/build/grub2-1.98~20100223/term/ieee1275/ofconsole.c:214: error: shadowed declaration is here
make[1]: *** [kernel_img-term_ieee1275_ofconsole.o] Error 1
make[1]: Leaving directory `/build/grub2-1.98~20100223/build/grub-ieee1275'
make: *** [build/grub-ieee1275] Error 2

-joey

=== modified file 'term/ieee1275/ofconsole.c'

ieee1275/ofconsole.c +0 -1
@@ -257,7 +257,6 @@
 	      break;
 	    case '3':
 	      {
-		grub_uint64_t start;		
 		grub_ieee1275_read (stdin_ihandle, &c, 1, &actual);
 		/* On 9600 we have to wait up to 12 milliseconds.  */
 		start = grub_get_time_ms ();
#1 lore raw
Quoted 4 lines · Joey Korkames

A recent trunk commit (r2213) prevents me from building grub2 (Debian Lenny amd64): here's my fix. I have no idea what the end result is (and have no PPC equipment to test with), so maybe someone who understands this code can clarify things.

Thanks for your patch. This is clearly a correct change regardless of the exact behaviour of the code, so I went ahead and applied it to trunk.

(I wrote a ChangeLog entry for you, though for future changes it's good if you can supply one.)

Signature · 1 line
Colin Watson                                       [[email protected]]