GP32 libg.a linker errors.. why does it use hw fp?


skratchy

Still Fresh
Joined
Nov 11, 2003
Messages
5
hello,

i have got minigp32 and i can compile and run a test sdl app no
problem (i was very impressed with how easy it was, well done guys!).
i am porting some code which uses the libg.a standard(?) library but
when i link it i get linker errors because libg.a uses hardware
floating point but my elf does not. why does libg use hardware
floating point? is there a way round this? is there a libg available
which is compiled with software floating point? i dont understand why
libg would use hardware fp when the gp32's arm chip does not have
floating point registers.

i was getting interworking linker errors, as the libg which came with
minigp32 was built without interworking support but i found another
libg.a in the devkitadv archive and that stopped me getting the
interworking linker error but it doesnt help the fp errors.

anybody got any ideas. i dont want to have to code the needed
functions by hand! if i can get the source to the libg library i can
build it myself with software fp support but i cannot seem to find it
anywhere.

thanks in advance.

sam
 
I'm not sure why some of the libraries have hardware fp set (it's just a flag in the header of an object file). As you say, it's pretty strange. As far as I can tell, it makes no difference to the code (unlike interworking, which changes the calling conventions).

But here's another strange thing: I was just checking out what libg is, and I found that on my Linux system with a home-built arm-elf-gcc 3.3.2, libg.a is exactly the same as libc.a! So, one thing to try is just to leave the -lg line out of your linker comand, or perhaps to change it to -lc, or even just copy libc.a over as libg.a. Play around with it, see how it goes.

Alternatively, you could build your own lib(c/g).a. I (and other people) use newlib, which is available from Red Hat. However, it's a bit of a mission to compile it on Windows unless you have cygwin installed. Do you?

If you can't get it to work, tell us what version of gcc you're using (I'm not familiar with minigp32) and any other useful information(!) and maybe someone can help

Good luck!
 
Back
Top