Skip to contentSkip to conversation

problem compiling sc520

U-Boot-Users david stevenson 3 participants 9 messages Aug 4, 2003 – Aug 5, 2003

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 7 lines · In message <[email protected]> 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.

Quoted 5 lines

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

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Doubt is a pain too lonely to know that faith is his twin brother.
- Kahlil Gibran
#2 lore raw
Quoted 10 lines · Wolfgang Denk
Quoted 7 lines · In message <[email protected]> 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-) )

Quoted 1 line

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?

Quoted 7 lines
Quoted 6 lines

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?

Quoted 7 lines

-> 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?

Quoted 4 lines

Best regards,

Wolfgang Denk

#3 lore raw
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Try replacing the "done:" with "done: ;"

Yes that works fine. (strange the things I learn about C day by day 8-) )

Quoted 1 line

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...

Quoted 2 lines

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.]

Quoted 8 lines
Quoted 3 lines

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

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Being schizophrenic is better than living alone.
#4 lore raw
Quoted 12 lines · Wolfgang Denk
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 1 line

Try replacing the "done:" with "done: ;"

Yes that works fine. (strange the things I learn about C day by day 8-) )

Quoted 1 line

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

cmd_eeprom.c 4 Aug 2003 23:04:04 -0000 renamed from cmd_eeprom.c 1 Jul 2003 21:07:07 -0000 1.5 +5 -0
diff -u -r1.5 cmd_eeprom.c
@@ -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

sc520_cdp/flash.c 4 Aug 2003 23:23:27 -0000 renamed from sc520_cdp/flash.c 27 Jun 2003 21:32:24 -0000 1.4 +1 -1
diff -u -r1.4 flash.c
@@ -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

#5 lore raw
Quoted 6 lines · david stevenson
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Try replacing the "done:" with "done: ;"

Yes that works fine. (strange the things I learn about C day by day 8-) )

Quoted 1 line

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

cmd_bootm.c 4 Aug 2003 23:28:54 -0000 renamed from cmd_bootm.c 27 Jul 2003 00:21:15 -0000 1.21 +2 -2
diff -u -r1.21 cmd_bootm.c
@@ -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);
#6 lore raw
Quoted 3 lines · In message <[email protected]> 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

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
The nice thing about  standards  is that there are  so many to choose
from.                                           - Andrew S. Tanenbaum
#7 lore raw
In reply to david stevenson

Dear David,

Quoted 12 lines · in message <[email protected]> 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

cmd_eeprom.c 4 Aug 2003 23:04:04 -0000 line 43

Quoted 8 lines
cmd_eeprom.c 4 Aug 2003 23:04:04 -0000 renamed from cmd_eeprom.c 1 Jul 2003 21:07:07 -0000 1.5 +5 -0
@@ -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)".

Quoted 14 lines
cmd_eeprom.c 4 Aug 2003 23:04:04 -0000 renamed from cmd_eeprom.c 1 Jul 2003 21:07:07 -0000 1.5 +0 -0
 #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

sc520_cdp/flash.c 4 Aug 2003 23:23:27 -0000 line 328

Quoted 5 lines
sc520_cdp/flash.c 4 Aug 2003 23:23:27 -0000 renamed from sc520_cdp/flash.c 27 Jun 2003 21:32:24 -0000 1.4 +1 -1
@@ -325,7 +325,7 @@
        }
        printf ("\n");
 
-       done:
+       done:;

Thanks, added.

Will push to CVS soon.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
A bore is someone who persists in holding his own views after we have
enlightened him with ours.
#8 lore raw
In reply to david stevenson
Quoted 3 lines · david stevenson
Quoted 1 line

Try replacing the "done:" with "done: ;"

Yes that works fine. (strange the things I learn about C day by day 8-) )

That was a (somewhat recent) update made to the C standard.