This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GccPowerpc eabi HowTo - probem with stido functions ( sprintf)
- From: Jim Wilson <wilson at specifix dot com>
- To: moshed <f dot drori at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 27 Oct 2005 13:05:25 -0700
- Subject: Re: GccPowerpc eabi HowTo - probem with stido functions ( sprintf)
- References: <1250042.post@talk.nabble.com>
moshed (sent by Nabble.com) wrote:
/ usr/local/bin/../powerpc-eabi/lib/libc.a(vfprintf.o)(.text+0x18a0): In function `_vfprintf_r':
.../../../.././newlib/libc/stdio/vfprintf.c:1065: undefined reference to `__umoddi3'
These are in the libgcc library.
/usr/local/bin/../powerpc-eabi/lib/libc.a(vfprintf.o)(.text+0x18bc):../../../.././newlib/libc/stdio/vfprintf.c:1066: undefined reference to `__udivdi3'
/usr/local/bin/../powerpc-eabi/lib/libc.a(makebuf.o)(.text+0x12c): In function `__smakebuf':
.../../../.././newlib/libc/stdio/makebuf.c:96: undefined reference to `isatty'
These are syscalls, which need to be provided by you. There are stubs
you can use in libgloss.
Only this example working well only without %d ? It?s insignificant for me
sprintf (buff, "%s", "my_test");
If you compile with optimization, gcc will convert this to a string copy
which needs no library calls.
powerpc-eabi-ld -Map ADLAP.map -o ADLAP.elf appl.o main.o hardware.o init.o -T lnk_mpc555_rom.lcf -L c:/555/libumas -lumas -lm -lc
Using ld to link is almost always a mistake. You should use gcc to link
instead, and this will solve half your trouble, which is the failure to
link in libgcc. If you really need to use ld directly, then use gcc -v
to see what the correct linker command is, and then modify as necessary.
The other half is probably a bug in your linker script, not including
the necessary libgloss system call stubs which will work on the
simulator. If you are running on a bare board, then you will need
syscall stubs that call monitor routines. Some of these may not be
supported on the board, in which case you can return an error, and just
avoid calling them.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com