[U-Boot-Users] problem compiling sc520

I am still having problems with this. I have applied the patches Brad sent on Sat to the CVS of yesterday, by hand.
But gcc 3.2 -Werror and " goto done; ...... done: } do not appear compatable, so I changed the easiest option and removed -Werror.
I now have lib_i386/libi386.a(video_bios.o): In function `probe_pci_video': /home/david/smart/cvs/u-boot/lib_i386/video_bios.c:88: undefined reference to `pci_find_class'
Can someone who gets past this let me know where the function is?
Thanks David

In message 200308041652.16627.david@avoncliff.com you wrote:
But gcc 3.2 -Werror and " goto done; ...... done: } do not appear compatable, so I changed the easiest option and removed -Werror.
Try replacing the "done:" with "done: ;"
If it works, please submit a patch.
lib_i386/libi386.a(video_bios.o): In function `probe_pci_video': /home/david/smart/cvs/u-boot/lib_i386/video_bios.c:88: undefined reference to `pci_find_class'
Can someone who gets past this let me know where the function is?
-> find * -type f | xargs egrep -l pci_find_class include/pci.h lib_i386/video_bios.c
Seems that except for the prototype in include/pci.h and the call in lib_i386/video_bios.c there is no file containing this function. Let me guess: nobody used this code before...
Best regards,
Wolfgang Denk

On Monday 04 August 2003 8:14 pm, Wolfgang Denk wrote:
In message 200308041652.16627.david@avoncliff.com you wrote:
But gcc 3.2 -Werror and " goto done; ...... done: } do not appear compatable, so I changed the easiest option and removed -Werror.
Try replacing the "done:" with "done: ;"
Yes that works fine. (strange the things I learn about C day by day 8-) )
If it works, please submit a patch.
Hmm, request understood. Practice not so easy. There are 40+ done: in many files both in sc520 and other area's, but there are many other instances of goto. Any experts with sed or pearl around?
lib_i386/libi386.a(video_bios.o): In function `probe_pci_video': /home/david/smart/cvs/u-boot/lib_i386/video_bios.c:88: undefined reference to `pci_find_class'
Can someone who gets past this let me know where the function is?
-> find * -type f | xargs egrep -l pci_find_class include/pci.h lib_i386/video_bios.c
Seems that except for the prototype in include/pci.h and the call in lib_i386/video_bios.c there is no file containing this function. Let me guess: nobody used this code before...
Well I was being more optimistic, I am only doing make sc520_cdp_config make all And I had thought others had got past compile errors. Does this imply the function is available in some external library?
Best regards,
Wolfgang Denk

In message 200308041917.13511.david@avoncliff.com you wrote:
Try replacing the "done:" with "done: ;"
Yes that works fine. (strange the things I learn about C day by day 8-) )
If it works, please submit a patch.
Hmm, request understood. Practice not so easy.
Well, maybe you mention the name of the file in question...
There are 40+ done: in many files both in sc520 and other area's, but there are many other instances of goto. Any experts with sed or pearl around?
Most of these should be ok. It is sufficient to find those where no statement follows the colon. And the compiler will point these out...
[Sorry, I don't have a working build environment for the i386, otherwise I would not have to ask such stupid questions.]
Seems that except for the prototype in include/pci.h and the call in lib_i386/video_bios.c there is no file containing this function. Let me guess: nobody used this code before...
Well I was being more optimistic, I am only doing make sc520_cdp_config make all And I had thought others had got past compile errors. Does this imply the function is available in some external library?
At least not in any U-Boot file.
Best regards,
Wolfgang Denk

On Monday 04 August 2003 10:18 pm, Wolfgang Denk wrote:
In message 200308041917.13511.david@avoncliff.com you wrote:
Try replacing the "done:" with "done: ;"
Yes that works fine. (strange the things I learn about C day by day 8-) )
If it works, please submit a patch.
Hmm, request understood. Practice not so easy.
Well, maybe you mention the name of the file in question...
I may have been making problems for myself.. but first when I put -Werror back in there was a problem in cmd_eeprom.c
Index: common/cmd_eeprom.c =================================================================== RCS file: /cvsroot//u-boot/u-boot/common/cmd_eeprom.c,v retrieving revision 1.5 diff -u -r1.5 cmd_eeprom.c --- common/cmd_eeprom.c 1 Jul 2003 21:07:07 -0000 1.5 +++ common/cmd_eeprom.c 4 Aug 2003 23:04:04 -0000 @@ -36,6 +36,11 @@ uchar *buffer, unsigned cnt); #endif
+#ifdef CONFIG_SPI +extern ssize_t spi_read(uchar *addr, int alen, uchar *buffer, int len); +extern ssize_t spi_write (uchar *, int, uchar *, int); +extern void spi_init_f (void); +#endif
#if defined(CFG_EEPROM_X40430) /* Maximum number of times to poll for acknowledge after write */
This may well not be the correct fix, but it allowed me to continue with done:; problem
Index: board/sc520_cdp/flash.c =================================================================== RCS file: /cvsroot//u-boot/u-boot/board/sc520_cdp/flash.c,v retrieving revision 1.4 diff -u -r1.4 flash.c --- board/sc520_cdp/flash.c 27 Jun 2003 21:32:24 -0000 1.4 +++ board/sc520_cdp/flash.c 4 Aug 2003 23:23:27 -0000 @@ -325,7 +325,7 @@ } printf ("\n");
- done: + done:; }
and now it compiles as far as unknown pci_find_class with -Werror enabled. (not sure why I thought there were lots of these errors, now I can only find one! ) David

On Monday 04 August 2003 9:35 pm, david stevenson wrote:
Try replacing the "done:" with "done: ;"
Yes that works fine. (strange the things I learn about C day by day 8-) )
If it works, please submit a patch.
Sorry here is another one I must have fixed and forgot 8-( Index: common/cmd_bootm.c =================================================================== RCS file: /cvsroot//u-boot/u-boot/common/cmd_bootm.c,v retrieving revision 1.21 diff -u -r1.21 cmd_bootm.c --- common/cmd_bootm.c 27 Jul 2003 00:21:15 -0000 1.21 +++ common/cmd_bootm.c 4 Aug 2003 23:28:54 -0000 @@ -1012,9 +1012,9 @@ printf ("Image at %08lX:\n", (ulong)hdr); print_image_hdr( hdr ); putc ('\n'); - next_sector: + next_sector:; } - next_bank: + next_bank:; }
return (0);

In message 200308042159.09596.david@avoncliff.com you wrote:
Sorry here is another one I must have fixed and forgot 8-( Index: common/cmd_bootm.c
Thanks, added.
Best regards,
Wolfgang Denk

Dear David,
in message 200308042135.48979.david@avoncliff.com you wrote:
I may have been making problems for myself.. but first when I put -Werror back in there was a problem in cmd_eeprom.c
Index: common/cmd_eeprom.c
RCS file: /cvsroot//u-boot/u-boot/common/cmd_eeprom.c,v retrieving revision 1.5 diff -u -r1.5 cmd_eeprom.c --- common/cmd_eeprom.c 1 Jul 2003 21:07:07 -0000 1.5 +++ common/cmd_eeprom.c 4 Aug 2003 23:04:04 -0000 @@ -36,6 +36,11 @@ uchar *buffer, unsigned cnt); #endif
+#ifdef CONFIG_SPI +extern ssize_t spi_read(uchar *addr, int alen, uchar *buffer, int len); +extern ssize_t spi_write (uchar *, int, uchar *, int); +extern void spi_init_f (void); +#endif
No, this is not a good idea. The right place to fix this is in "include/common.h" (by replacing "defined(CONFIG_PCU_E) || defined(CONFIG_CCM) || defined(CONFIG_ATC)" with "defined(CONFIG_SPI)".
#if defined(CFG_EEPROM_X40430) /* Maximum number of times to poll for acknowledge after write */
This may well not be the correct fix, but it allowed me to continue with done:; problem
Index: board/sc520_cdp/flash.c
RCS file: /cvsroot//u-boot/u-boot/board/sc520_cdp/flash.c,v retrieving revision 1.4 diff -u -r1.4 flash.c --- board/sc520_cdp/flash.c 27 Jun 2003 21:32:24 -0000 1.4 +++ board/sc520_cdp/flash.c 4 Aug 2003 23:23:27 -0000 @@ -325,7 +325,7 @@ } printf ("\n");
done:
done:;
Thanks, added.
Will push to CVS soon.
Best regards,
Wolfgang Denk
participants (3)
-
david stevenson
-
Marc Singer
-
Wolfgang Denk