GP2X Problem With Fw 4.1.0 Libm's Dynamic Library


Flynn_fr

Still Fresh
Joined
Jun 16, 2008
Messages
7
Hello everyone.

I'm getting crazy trying to make the internal dynamixc LIBM to work properly in formware 4.1.0.
It links properly, but all functions returns wrong values, as if the format was wrong or something.

exemple :
double d = atof("9999")
printf("%f", d) prints "-1.998871

I'm not using anything weird, here are the main things in my Makefile :

TOOLS=/opt/open2x/gcc-4.1.1-glibc-2.3.6
CFLAGS=`$(TOOLS)/bin/sdl-config --cflags`
LDFLAGS=-Wl,-rpath,$(TOOLS)/lib -L$(TOOLS)/lib -lSDL_ttf -lSDL_mixer -lfreetype -lSDL -lm

As you can see, i'm using open2x, and if I link with synamic libraries, that's beca

_Flynn_ said:
As you can see, i'm using open2x, and if I link with synamic libraries, that's beca
... ooops hit the return key, silly me.

... that's because I want to use the internal SDL to get access to the fixed touchscreen routines. Seems a bad idea finally but what the heck ?

I'd appreciate if somebody can point what's going wrong with these stupid libraries ?

Flynn
 
Last edited by a moderator:
notaz said:
Now you see why we all use static linking here.
If I were you, I would just use my hack with paeryn's SDL.




I must admit that you're right (and I was wrong stating before that the last version of SDL fixed the touchscreen issue - it does, but the cost maybe too high.)

I didn't surrender without a fight though, but I'm getting tired of this, trying everything for the last 4 days to make it right, without success, including trying all the exotic parameters of gcc dedicated to the ARM. I even rewrote part of SDL_rotozoom to make it working without a call to sin() and cos() ...

What surprises me most, is that LIBM has plenty of safety systems to check the data types passed in the parameters, and one must be really nasty to do something that will screw up these safeties ! I really would be onterestesd to get why it has such a behaviour ...

Anyway, it wouldn't be fun if it was too easy ;-)
Flynn
 
Last edited by a moderator:
For those interested by this problem of mixing static and dynamic libs, a working solution may be seen in the sources of Fcalc 0.2 that I just released.

Flynn
 
Back
Top