Undefined Symbol: __floatsisf


charlieb

Member
Joined
Nov 30, 2006
Messages
116
Hi all,
So I got my gp2x for christmas (yay!) and now that I have played all the great games I turned my attention to some development work. I got the dual Makefile from the wiki and used it o compile the image demo, also from the wiki. That went fine so I tried to compile one of my programs. It uses floats quite heavily so I added the -msoft-float flag. The compile when OK but when I tried to run it (inside a shell script) I got the following on the output:
./helloworld.gpe: relocation error: ./helloworld.gpe: undefined symbol: __floatsisf

I added a float to the wiki demo program and the same thing happened. Here are the two compilation commands:

gp2x-gcc -c -Wall -I/usr/local/gp2xdev/include `/usr/local/gp2xdev/bin/sdl-config --cflags` -msoft-float demo.c -o demo.o
gp2x-gcc `/usr/local/gp2xdev/bin/sdl-config --static-libs` -msoft-float -lgcc -lm -lg -lpthread -lSDL demo.o -o helloworld.gpe

Any ideas?

Cheers,
Charlie
 
If I remember correctly, you get this error when you are using the gcc3.4/glibc2.2.5 toolchain with the -msoft-float compile flag, it has to do with libfloat being required to use the flag in glibc2.2.5 and I've not been able to compile it.

If you are using the gcc4.0/glibc2.3.5 toolchain, then I'm not sure what to tell you.
 
charlieb posted on Dec 30 2006 at 09:33 PM said:
I'm using ooPo's GP2XDev toolchain which has gcc 4.0.2 and glibc-2.3.5 :(
Try this:

gp2x-gcc -static `/usr/local/gp2xdev/bin/sdl-config --static-libs` -msoft-float -lgcc -lm -lg -lpthread -lSDL demo.o -o helloworld.gpe

Also note that there is some redundancy in that line since sdl-config expands to -L... -lSDL -lpthread -lm -ldl.
I also think -lgcc and -lg are not needed.

Hope this helps

EDIT: tried it with my gp2xdev gcc 4.0.2/glibc 2.3.5. Without -static I get the same error as charlieb. With -static it works.
 
Last edited by a moderator:
Laurent posted on Dec 31 2006 at 06:08 AM said:
charlieb posted on Dec 30 2006 at 09:33 PM said:
I'm using ooPo's GP2XDev toolchain which has gcc 4.0.2 and glibc-2.3.5 :(
gp2x-gcc -static `/usr/local/gp2xdev/bin/sdl-config --static-libs` -msoft-float -lgcc -lm -lg -lpthread -lSDL demo.o -o helloworld.gpe

Thank you for trying. I actually already tried that but when I did I got many compile-time complaints about being unable to find SDL_ symbols. I have switched to the open2x toolchain (which is compiling now) in the hopes that clear up some of these issues or if not at least it'll be up-to-date

Thanks, I'll let you know what the next problem is once I've finished compiling the open2x libs.

Cheers,
Charlie
 
Last edited by a moderator:
I got the same errors with the open2x-gcc but I also found the solution; it was the order of the arguments to open2x-gcc so that the input .o files and the -o argument were first and the rest were later. But alas I now have another problem. The image is no longer being displayed properly it's become a bunch of black and white bands with black dots on the white. But when I hit a button to quit, I get a flash of the proper image before I get back to the menu.

Here are my new compile commands:
open2x-gcc -c -Wall -I/usr/local/open2x/include `/usr/local/open2x/bin/sdl-config --cflags` demo.c -o demo.o
open2x-gcc demo.o -o helloworld.gpe -static `/usr/local/open2x/bin/sdl-config --static-libs` -lgcc -lm -lg -lpthread -lSDL

Oh and the executable is ~800k

Cheers
Charlie
 
hi charlie,
just a 'me too' on this issue, exactly same as of about 4 days ago.
worked perfect b4 that.
can't think what i've apt-get upgraded except for a load of mono stuff and some qt4 libs.
tried to rebuild entire toolchain as well, but still snowing on the gp2x.
using mepis6 (basically ubuntu 6.06).
 
I did an apt-get dist-upgrade (Debian Etch) just before I got the open2x tk so the problems changed, at least :huh:
 
I got the demo to work, here are the commands:

open2x-gcc -c -Wall -I/usr/local/open2x/include `/usr/local/open2x/bin/sdl-config --cflags` demo.c -o demo.o
open2x-gcc demo.o -o helloworld.gpe `/usr/local/open2x/bin/sdl-config --static-libs` -lgcc -lm -lg -lpthread -lSDL

I don't have any floats in there yet, so no -msoft-float, that's the next thing ...
Oh well, I added the pointless float code and now the error is:
./helloworld.gpe: relocation error: ./helloworld.gpe: undefined symbol: __extendsfdf2
with or without the -msoft-float flag
So I tried to add -static and got the messed up black and white banded screen, but appart from that it seems to work, the float part certainly works, according to the output.

How odd, any ideas, suggestions, cries of disbelief?

Charlie
 
Back
Top