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]

newlib and libgloss questions


Hi,
   I am trying to run C++ programs on an OS less system. I have an already prebuild gnupro tools. I have written a crt0.S and a syscalls.c which impelment _write , _read, _sbrk and a list of other calls which are given in the gnupro documentation. I have compiled these two files using

xscale-coff-gcc -c crt0.S -o crt0.o
xscale-coff-gcc -c syscalls.c -o syscalls.o

I then wrote a simple cpp program to do an sprintf and compiled it using the following 

xscale-coff-g++ -specs="specsfile" test.cpp -o test.o 

The specs file contains the following

%rename link       old_link

*link
-Tlnkscript.ld%s %old_link

*startup
crt0%O%s syscalls%O%s

I have tested this setup using malloc and also new and it works. But when I use sprintf or printf, they do not go to the _write that I have implemented in syscalls.c. 

Do I have to implment the reentrant versions of these functions, _write_r etc. 

Or is my using the specs option wrong? Do I have to recompile newlib with my crt0.S and syscalls.c. If so how can I do that. 

I really appreciate your answers.

Thanks
Vish



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