This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How to get printf() output?


Hi Toralf,

I have only done this with newlib and I found I had to implement the _read(), _write(), etc. calls (actually, since I am using the reentrant build of newlib I needed to implement the _read_r(), etc functions). I don't have a complete list of what I needed to implement but if you look at Bill Gatliff's article on porting newlib at http://billgatliff.com/articles/newlib/newlib.pdf he has the complete list that I used there.

IIRC, the vfprintf function (or one of the other lower level calls inside printf) went directly to _write() and didn't use write(), generating a syscall() on my hardware which used one of the software exceptions (not implemented on my system at that time of course) and caused my headaches.

Stan Katz

-----Original Message-----
From: Toralf Lund [mailto:toralf@procaptura.com]
Sent: Tuesday, September 23, 2003 2:11 PM
To: Crossgcc list at Redhat (E-mail)
Subject: How to get printf() output?


Can someone repeat for me what I should do to get printf() to work when 
linking with newlib, but not libgloss? I was under the impression that 
write() would be called eventually, but it looks like it isn't. I've 
tried step-tracing the printf execution via the ROM monitor to find out 
what is going on, but it's a bit hard to follow...

Just to make it clear: I have provided custom version all routines 
necessary to link the application correctly, including read(), write(), 
open() and close(). I'm linking with libc, libm and crt0.o, but not 
libgloss or similar.

- Toralf


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]