Override printf
Corrin Meyer
Corrin.Meyer at dornerworks.com
Thu Jul 10 22:09:16 UTC 2008
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 at dornerworks.com <mailto:corrin.meyer at dornerworks.com>
3445 Lake Eastbrook Blvd. SE
Grand Rapids, MI 49546
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20080710/f3b6f003/attachment.html>
More information about the coldfire-gnu-discuss
mailing list