[MIPS32] Can't get printf to work with %f && %lld
Jeff Johnston
jjohnstn@redhat.com
Fri Apr 3 22:34:00 GMT 2009
Xavier,
Nothing obvious. You haven't mentioned what the failures are. You'll
have to try debugging it. Follow inside vfprintf.c and see where it
goes. Making sure that gcc is passing things properly on the var arg
list is one thing to look for. If you don't include <stdio.h> for your
test, the compiler can get things totally wrong as it doesn't put things
on the var arg list correctly. Another thing to look for is that newlib
understands the format of your floating-point properly (see
libc/stdlib/mprec.h). When you enable long double support, you get
_ldtoa_r being called from printf. If you remove that enablement, you
can see if newlib can get simple doubles working correctly using _dtoa_r
instead.
Note that normal mips platforms set the -DMISSING_SYSCALL_NAMES flag in
configure.host
and unless you add your configuration type there, this won't happen.
-- Jeff J.
Xavier Guérin wrote:
> Hi list,
> :
> I'm currently working on a MIPS32 processor and it seems that I can't
> get printf to work with float, long long, double, and long double.
> I'm using the 1.17 version of newlib, and I got the same behavior with
> the 1.16 version. Here are my configurations :
>
> GCC 4.3.2 :
>
> Configured with: configure
> --prefix=/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain
> --target=mips-sls-dnaos --enable-multilib --enable-languages=c
> --with-newlib
>
> The mips-sls-dnaos is the same configuration as mips-elf. It only
> enables the support of my OS. I'm using the following multilib
> configuration: msoft-float EL/EB.
>
> Newlib 1.17.0 :
>
> configure
> --prefix=/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain
> --enable-multilib --enable-newlib-io-long-long
> --enable-newlib-io-long-double --enable-newlib-io-c99-formats
> --disable-newlib-may-supply-syscalls
> --disable-newlib-supplied-syscalls --enable-newlib-multithread
>
> The mips-sls-dnaos target support my OS. Its files are place in the
> libc/sys directory. The ${newlib_cflags} only contains "-G0
> -DHAVE_NANOSLEEP".
>
> I regression-tested those types without printing them, and them seem
> to work fine. I think it's important to notice that the same printf()
> with the same newlib configuration is working perfectly on the ARM
> architecture.
>
> Any insight ?
>
> Thank you for your help,
> Xavier
>
>
> -----
> Xavier Guérin - Doctoral student
> TIMA Laboratory, SLS Group
> 46, av. Félix Viallet, 38000 GRENOBLE, FR
> Mail : xavier.guerin@imag.fr
> Phone : +33(0)4 76 57 47 59
> Ad Astra Per Aspera
> Triste e' quel discepolo che non avanza il suo maestro
>
More information about the Newlib
mailing list