OpenCores
no use no use 1/1 no use no use
ecos, printf -O2 gcc? bug
by Unknown on Jan 8, 2004
Not available!
hello all!

some time ago Heiko posted a 'unificaation' patch to merge oc's and uc's
gcc. i've aplied the patch witch should have fixed (among others):

- I tested if the optimization (-O2) works by running eCos, which has in
the past produced errors in printf()-like routines when the compiler had
-O2 enabled.

i've tried ecos with it, and i still experience this problem. (it goes
away when disabling optimizations). i have used both the
oc gcc-3.2.3 (with Heiko's patch) and also uc gcc-3.4.
Also i tried binutils-2.14 (official gnu release) and nothing works
with -O2 optimizations. this is not a problem with output to
UART (or similar), since cygwin debug messages get through just fine.

the relevant testcase is 'stdiootput'. while running in simulator ecos
crashes with bus error just at printf():

INFO:testcase
/center/opencores/nibbler/ecos-uctc/ecos/pack
ages/language/c/libc/stdio/v2_0/tests/stdiooutput.c for C library stdio
output f
unctions>
INFO:
INFO:

---> simulator bus error @ EA: 0x1920f000

Alternatevly in ecos examples directory any of examples crash since
they all use printf()...

Heiko could you please recheck that what i checked into cvs is
indeed supposed to fix the problem.

I'd really like to find out where this bug is coming from.
No optimizations seam to fix it, and also binary goes from 2.6M _with_ -O2
-g to 1.9M without optimizations and with -g...

does anybody have any idea ?

best regards,
p.
ecos, printf -O2 gcc? bug
by Unknown on Jan 8, 2004
Not available!
- I tested if the optimization (-O2) works by running eCos, which has in
the past produced errors in printf()-like routines when the compiler had
-O2 enabled.

i've tried ecos with it, and i still experience this problem.


You're right. printf() does not work here either. I always use
diag_printf(). So after I had that working, I did not check printf().

The 3.2.3 I started with was checked out 2003-10-10.

Regards,
Heiko


ecos, printf -O2 gcc? bug
by Unknown on Jan 8, 2004
Not available!
* Heiko Panther (heiko.panther@web.de) wrote:
>- I tested if the optimization (-O2) works by running eCos, which has in
>the past produced errors in printf()-like routines when the compiler had
>-O2 enabled.
>
>i've tried ecos with it, and i still experience this problem.


You're right. printf() does not work here either. I always use
diag_printf(). So after I had that working, I did not check printf().

The 3.2.3 I started with was checked out 2003-10-10.


i'm not sure but i have it somwhere in my memory that there were
some problems with static initalizers in or32 ecos. does anybody perhaps
remember something more ?

best regards,
p.

ecos, printf -O2 gcc? bug
by Unknown on Jan 8, 2004
Not available!
i'm not sure but i have it somwhere in my memory that there were
some problems with static initalizers in or32 ecos.


Scott has made a fix to the linker for this. Here's what he's told me.

I, too, found that some configurations of eCos died in the static
constructors on boot. The linker patches that I submitted to the
openrisc list on November 11th cured that problem for me.


The reason these patches haven't made it into the opencores binutils
tree is that they apparently break uClinux and I haven't had time to
investigate.


Heiko




no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.