This is the mail archive of the crossgcc@sourceware.org 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]

Re: Mipsel - big float problem with g++, not gcc (crosstool-ng.1.3.4)


On Mon, Feb 20, 2012 at 2:15 AM, Yatko <yatko@gmx.net> wrote:
> Hello list,
>
> we are trying to compile a program which is written in c++.
> All the outputs for float values are NAN. After some research we was able to produce this on a simple testprogram see below (fl2.c):
>
> g++ configured as shown below:
> $ mipsel-unknown-linux-gnu-g++ -v
> Using built-in specs.
> Target: mipsel-unknown-linux-gnu
> Configured with: /crosstool-ng-1.13.4/.build/src/gcc-4.3.2/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=mipsel-unknown-linux-gnu --prefix=/x-tools/mipsel-unknown-linux-gnu --with-sysroot=/x-tools/mipsel-unknown-linux-gnu/mipsel-unknown-linux-gnu/sysroot --enable-languages=c,c++ --disable-multilib --with-arch=mips1 --with-abi=32 --with-float=soft --with-pkgversion='crosstool-NG 1.13.4' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --with-gmp=/crosstool-ng-1.13.4/.build/mipsel-unknown-linux-gnu/build/static --with-mpfr=/crosstool-ng-1.13.4/.build/mipsel-unknown-linux-gnu/build/static --enable-threads=posix --enable-target-optspace --with-local-prefix=/x-tools/mipsel-unknown-linux-gnu/mipsel-unknown-linux-gnu/sysroot --disable-nls --enable-c99 --enable-long-long
> Thread model: posix
> gcc version 4.3.2 (crosstool-NG 1.13.4)

It would be helpful if you posted your .config to pastebin.com or something.
I'm guessing that you intended on building with soft-float?

> program in action:
> [ mipsel-mips32-linux-gnu-g++ fl2.c -o fl2 ]
> $./fl2
> min float value == nan
> max float value == nan

Something wrong with soft-float... or...

> [ mipsel-mips32-linux-gnu-g++ fl2.c -o fl2 -static ]
> $./fl2
> FATAL: kernel too old
> Segmentation fault

Kernel too old? Hmm, maybe you need to set CT_LIBC_GLIBC_MIN_KERNEL to
a lower version number?

> [ mipsel-mips32-linux-gnu-g++ fl2.c -o fl2 ] (changing in the program float to double works, but we need to use floats)
> $./fl2
> min float value == 0.000000
> max float value == 340282346638528859811704183484516925440.000000
>
> ?---
>
> testprogram reproduce this problem:
> compile with g++, not gcc:
> mipsel-mips32-linux-gnu-g++ fl2.c -o fl2
>
> fl2.c:
> #include <float.h>
> #include <stdio.h>
>
> int main()
> {
> float minval = FLT_MIN; // with float NAN
> float maxval = FLT_MAX; // with float NAN
>
> printf("min float value == %f\n"
> "max float value == %f\n",
> (double)minval, maxval);
>
> return 0;
> }
>
> all kind of support is much appreciated.
> Thanks !
> Yatko

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]