public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org
@ 2004-08-10  0:01 Shawn Jin
  2004-08-10  0:14 ` [U-Boot-Users] Re: [uClinux-dev] " David McCullough
  2004-08-10  6:43 ` [U-Boot-Users] " Wolfgang Denk
  0 siblings, 2 replies; 5+ messages in thread
From: Shawn Jin @ 2004-08-10  0:01 UTC (permalink / raw)
  To: u-boot

Hi,

I checked out u-boot code from CVS today and tried to compile it for
ARM IntegratorCP board. The cross toolchain I used is arm-elf-tools
downloaded from uClinux.org. Unfortunately I got the following
compilation error.

arm-elf-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8
-mshort-load-bytes -msoft-float
 -D__KERNEL__ -DTEXT_BASE=0x01000000 -I/u/code/denx/u-boot/include
-fno-builtin -ffreestandin
g -nostdinc -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include
-pipe  -DCONFIG_ARM -D__ARM__ -
mapcs-32 -march=armv4 -Wall -Wstrict-prototypes -c -o cfi_flash.o cfi_flash.c
In file included from cfi_flash.c:48:
/u/code/denx/u-boot/include/asm/processor.h:52: parse error before `1'
/u/code/denx/u-boot/include/asm/processor.h:52: warning: no semicolon
at end of struct or union
/u/code/denx/u-boot/include/asm/processor.h:54: parse error before `}'
/u/code/denx/u-boot/include/asm/processor.h:58: field `insn' has incomplete type

The code is extracted from the header file processor.h.

51> union debug_insn {
52>      u32     arm;
53>      u16     thumb;
54> };
55>
56> struct debug_entry {
57>        u32                     address;
58>        union debug_insn        insn;
59> };

However I really don't think there is any syntax error. It might be a
toolchain problem?

-- 
Best regards,

Shawn Jin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Re: [uClinux-dev] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org
  2004-08-10  0:01 [U-Boot-Users] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org Shawn Jin
@ 2004-08-10  0:14 ` David McCullough
  2004-08-10  1:41   ` [U-Boot-Users] " Shawn Jin
  2004-08-10  6:43 ` [U-Boot-Users] " Wolfgang Denk
  1 sibling, 1 reply; 5+ messages in thread
From: David McCullough @ 2004-08-10  0:14 UTC (permalink / raw)
  To: u-boot

Jivin Shawn Jin lays it down ...
> Hi,
> 
> I checked out u-boot code from CVS today and tried to compile it for
> ARM IntegratorCP board. The cross toolchain I used is arm-elf-tools
> downloaded from uClinux.org. Unfortunately I got the following
> compilation error.
> 
> arm-elf-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8
> -mshort-load-bytes -msoft-float
>  -D__KERNEL__ -DTEXT_BASE=0x01000000 -I/u/code/denx/u-boot/include
> -fno-builtin -ffreestandin
> g -nostdinc -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include
> -pipe  -DCONFIG_ARM -D__ARM__ -
> mapcs-32 -march=armv4 -Wall -Wstrict-prototypes -c -o cfi_flash.o cfi_flash.c
> In file included from cfi_flash.c:48:
> /u/code/denx/u-boot/include/asm/processor.h:52: parse error before `1'
> /u/code/denx/u-boot/include/asm/processor.h:52: warning: no semicolon
> at end of struct or union
> /u/code/denx/u-boot/include/asm/processor.h:54: parse error before `}'
> /u/code/denx/u-boot/include/asm/processor.h:58: field `insn' has incomplete type
> 
> The code is extracted from the header file processor.h.
> 
> 51> union debug_insn {
> 52>      u32     arm;
> 53>      u16     thumb;
> 54> };
> 55>
> 56> struct debug_entry {
> 57>        u32                     address;
> 58>        union debug_insn        insn;
> 59> };
> 
> However I really don't think there is any syntax error. It might be a
> toolchain problem?

I think,  at least for that version of the toolchain,  it implicitly
defines "arm",  and I suspect it defines it to be "1",  thus the errors
you are seeing.  You may be able to add a -Uarm to eth build line,

Cheers,
Davidm

-- 
David McCullough, davidm at snapgear.com  Ph:+61 7 34352815 http://www.SnapGear.com
Custom Embedded Solutions + Security   Fx:+61 7 38913630 http://www.uCdot.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Re: Re: [uClinux-dev] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org
  2004-08-10  0:14 ` [U-Boot-Users] Re: [uClinux-dev] " David McCullough
@ 2004-08-10  1:41   ` Shawn Jin
  2004-08-10  3:22     ` David McCullough
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn Jin @ 2004-08-10  1:41 UTC (permalink / raw)
  To: u-boot

Dear David,

> > The code is extracted from the header file processor.h.
> >
> > 51> union debug_insn {
> > 52>      u32     arm;
> > 53>      u16     thumb;
> > 54> };
> > 55>
> > 56> struct debug_entry {
> > 57>        u32                     address;
> > 58>        union debug_insn        insn;
> > 59> };
> >
> > However I really don't think there is any syntax error. It might be a
> > toolchain problem?
> 
> I think,  at least for that version of the toolchain,  it implicitly
> defines "arm",  and I suspect it defines it to be "1",  thus the errors
> you are seeing.  You may be able to add a -Uarm to eth build line,

It did solve the problem. Thank you!

Would you please explain a little bit more why the toolchain
implicitly defines "arm"? Should or should not for a toolchain to
define this? Or we can simply re-name "arm" in struct debug_insn to
another name?

-- 
Best regards,
-Shawn Jin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Re: Re: [uClinux-dev] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org
  2004-08-10  1:41   ` [U-Boot-Users] " Shawn Jin
@ 2004-08-10  3:22     ` David McCullough
  0 siblings, 0 replies; 5+ messages in thread
From: David McCullough @ 2004-08-10  3:22 UTC (permalink / raw)
  To: u-boot

Jivin Shawn Jin lays it down ...
> Dear David,
> 
> > > The code is extracted from the header file processor.h.
> > >
> > > 51> union debug_insn {
> > > 52>      u32     arm;
> > > 53>      u16     thumb;
> > > 54> };
> > > 55>
> > > 56> struct debug_entry {
> > > 57>        u32                     address;
> > > 58>        union debug_insn        insn;
> > > 59> };
> > >
> > > However I really don't think there is any syntax error. It might be a
> > > toolchain problem?
> > 
> > I think,  at least for that version of the toolchain,  it implicitly
> > defines "arm",  and I suspect it defines it to be "1",  thus the errors
> > you are seeing.  You may be able to add a -Uarm to eth build line,
> 
> It did solve the problem. Thank you!
> 
> Would you please explain a little bit more why the toolchain
> implicitly defines "arm"? Should or should not for a toolchain to
> define this? Or we can simply re-name "arm" in struct debug_insn to
> another name?

Most compilers predefine a number of things to help coders port/identify
what the code is being built for.  For example,  on a coldfire target
__mcf5200 may be defined.  Have a look at:

	http://www.ucdot.org/article.pl?sid=02/10/02/035241

I don't think the newer gcc's define "arm" and I cannot recall why the
current 2.95.3 compiler does,  but if you can easily change the name of
that field in the structure it would be the safest option IMO,

Cheers,
Davidm

-- 
David McCullough, davidm at snapgear.com  Ph:+61 7 34352815 http://www.SnapGear.com
Custom Embedded Solutions + Security   Fx:+61 7 38913630 http://www.uCdot.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org
  2004-08-10  0:01 [U-Boot-Users] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org Shawn Jin
  2004-08-10  0:14 ` [U-Boot-Users] Re: [uClinux-dev] " David McCullough
@ 2004-08-10  6:43 ` Wolfgang Denk
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2004-08-10  6:43 UTC (permalink / raw)
  To: u-boot

In message <c3d0340b0408091701f3c1e29@mail.gmail.com> you wrote:
> 
> I checked out u-boot code from CVS today and tried to compile it for
> ARM IntegratorCP board. The cross toolchain I used is arm-elf-tools
> downloaded from uClinux.org. Unfortunately I got the following
> compilation error.
...
> In file included from cfi_flash.c:48:
> /u/code/denx/u-boot/include/asm/processor.h:52: parse error before `1'

Note that there is no '1' in line 52 in this file!

> /u/code/denx/u-boot/include/asm/processor.h:52: warning: no semicolon
> at end of struct or union
> /u/code/denx/u-boot/include/asm/processor.h:54: parse error before `}'
> /u/code/denx/u-boot/include/asm/processor.h:58: field `insn' has incomplete type
> 
> The code is extracted from the header file processor.h.
> 
> 51> union debug_insn {
> 52>      u32     arm;
> 53>      u16     thumb;
> 54> };
> 55>
> 56> struct debug_entry {
> 57>        u32                     address;
> 58>        union debug_insn        insn;
> 59> };
> 
> However I really don't think there is any syntax error. It might be a
> toolchain problem?

The code compiles fine using our ELDK. It  is  probably  a  toolchain
problem,  but also check that the source tree is not corrupted and/or
stored in DOS file format.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Life would be so much easier if we could  just  look  at  the  source
code.                                                   -- Dave Olson

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-10  6:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-10  0:01 [U-Boot-Users] uboot compilation error when using the toolchain arm-elf-tools from uClinux.org Shawn Jin
2004-08-10  0:14 ` [U-Boot-Users] Re: [uClinux-dev] " David McCullough
2004-08-10  1:41   ` [U-Boot-Users] " Shawn Jin
2004-08-10  3:22     ` David McCullough
2004-08-10  6:43 ` [U-Boot-Users] " Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox