[U-Boot] gcc optimizing option cause printf() and others crash.why?

yaojin liu lanmanck at gmail.com
Sat Jul 31 10:06:05 CEST 2010


I have figured it out,haha!!

2010/7/30 Detlev Zundel <dzu at denx.de>

> Hi yaojin liu <lanmanck at gmail.com> writes:
>
> > I use arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.gz to
> > compile uboot1.3.4, and found that if I set OPTFLAGS to -O1,or O2, uboot
> > will crash, usually in printf().
>
> <faq>
>
> What board do you use?  Why do you use U-Boot 1.3.4 and not current code?
>
> </faq>
>
> > when i set to O3, it runs to prompt, but after several seconds(or
> minutes),
> > the code is dead,and the console has no response.
> > Os also has the problem,usually cannot run to main_loop().
> > How should i resolve this problem?
>
> Actually I presume that somebody tested U-Boot on the board you use.
> Probably there is a running version on it - so the most obvious problem
> seems to be your toolchain.  So my advise is:
>
> Find a working starting point, i.e. a known to work U-Boot version for
> your board (latest?) together with a known-to-work toolchain (eldk-4.2
> for arm?).
>
> Then use your toolchain, compare results, find problem and post answer
> :)
>
> Cheers
>  Detlev
>
> --
> There are three kinds of people in the world; those who can count and
> those who can't.
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
>


More information about the U-Boot mailing list