Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldfire-gnu-discuss] Override printf


  • To: <coldfire-gnu-discuss@xxxxxxxxxxxxxxxx>
  • Subject: [coldfire-gnu-discuss] Override printf
  • From: "Corrin Meyer" <Corrin.Meyer@xxxxxxxxxxxxxxx>
  • Date: Thu, 10 Jul 2008 18:09:16 -0400

What is the correct way to provide my own implementation of 'printf'?

 

I am trying to use my own 'printf' which is stripped down and to avoid
linking in Newlib in its entirety.  I am trying to use some combination
of '-nodefaultlibs', '-nostdlib', and/or '-nostartfiles' to tell the
linker not to link in Newlib, however, I keep getting the following
warnings.

 

c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
unhosted.a(unhosted-close.o): warning: IO function 'close' used

c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
unhosted.a(unhosted-fstat.o): warning: IO function 'fstat' used

c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
unhosted.a(unhosted-isatty.o): warning: IO function 'isatty' used

c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
unhosted.a(unhosted-lseek.o): warning: IO function 'lseek' used

c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
unhosted.a(unhosted-read.o): warning: IO function 'read' used

c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
unhosted.a(unhosted-write.o): warning: IO function 'write' used

 

It looks like this is part of the CS3 library so I am guessing that
Newlib is getting linked in which then makes calls to the functions
above and that CS3 is complaining that they don't exist since I haven't
provided them for my hardware.  Is this correct?  How can I get rid of
these warnings?  If Newlib is being linked in (which I think it is
because my final binary is MUCH bigger than before), how do I get it not
to link in and instead use my provided printf?

 

Corrin J. Meyer 
DornerWorks, Ltd. 
Embedded Systems Engineering 
  
T: 616.389.8336 
F: 616.245.8372 
E: corrin.meyer@xxxxxxxxxxxxxxx <mailto:corrin.meyer@xxxxxxxxxxxxxxx>  
  
3445 Lake Eastbrook Blvd. SE 
Grand Rapids, MI 49546