GP2X Using Devkitgp2x In The Wiz


Franxis

MAME 4 ALL
Joined
Aug 22, 2004
Messages
788
Age
49
Location
Spain
Website
franxis.zxq.net
I have succesfully used DevKitGp2X to compile MAME4ALL on the Wiz.

But you have to modify two files to be able to link dinamically the libm and libpthread libraries.

C:\devkitGP2X\sysroot\usr\lib\libm.so:
CODE

/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libm.so.6 )



C:\devkitGP2X\sysroot\usr\lib\libpthread.so:
CODE

/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libpthread.so.0 )



Also you have to compile with the following flags: -mcpu=arm926ej-s -mtune=arm926ej-s

And link WITHOUT the -static flag.

That's all.

Regards.
 
For what it's worth, I've been linking statically with libpthread and libm for GP2X (using Open2x compiler/environment) and I haven't had any problems so far. This might not be a great idea.

I've always wondered, is it possible to statically link only some libraries and dynamically link others? Maybe someone could tell me how to do this with gcc.
 
Exophase said:
I've always wondered, is it possible to statically link only some libraries and dynamically link others? Maybe someone could tell me how to do this with gcc.
Yes, look up -Bstatic and -Bdynamic. There is some information here. I don't know if that link is actually about gcc, but I do know it works the same way.
 
Last edited by a moderator:
Orkie said:
Exophase said:
I've always wondered, is it possible to statically link only some libraries and dynamically link others? Maybe someone could tell me how to do this with gcc.
Yes, look up -Bstatic and -Bdynamic. There is some information here. I don't know if that link is actually about gcc, but I do know it works the same way.


Thanks. It looks like you have to pass the option to the linker with -Wl,-Bstatic ... -Wl,-Bdynamic
 
Last edited by a moderator:
I realize this is an old thread, but I don't quite understand part of the original discussion:

I can certainly find the libm.so file in the specified location, but then I'm a bit confused about what to do with the code snippet above. Originally I thought they were directions on how to modify the libm.so file, but I see that it's a large binary file. Should I be running the linker against the .so file somehow, using the above code snippet as arguments? Should I be placing that code into a specially named file in the same location?
 
Last edited by a moderator:
GROUP ( /lib/libm.so.6 "]
I can certainly find the libm.so file in the specified location, but then I'm a bit confused about what to do with the code snippet above. Originally I thought they were directions on how to modify the libm.so file, but I see that it's a large binary file. Should I be running the linker against the .so file somehow, using the above code snippet as arguments? Should I be placing that code into a specially named file in the same location?[/quote]Delete the old file and create a new ASCII file with the content i have pasted.
 
Last edited by a moderator:
Hi :)

thanks Franxis, I've tried what you suggested using a Guyfawkes SDL test program (just the init and a screen present with a text) and it indeed compile but hangs up when launched on the wiz with the GPH loading screen.

Is there a method i can use to debug it? like using the usb cable maybe or a text log maybe?

I'm using Octoate's DevkitGP2x toolchain (2006-03-06) with Guyfawke's SDL Libs (2006-10-21)...

Basically i did what it's on this old tutorial http://wiki.gp2x.org/wiki/Using_CodeBlocks plus your changes, what you suggest? Thanks... :(

edit: i've tried with a simpler SDL program, still nothing, i'm linking with -lz -lmad -lSDL -lgcc -lm -lc -lexpat -lpthread -msoft-float
and compiling with -mcpu=arm926ej-s -mtune=arm926ej-s


edit2: solved linking only with -lSDL, still i don't know what the Wiz miss and what libraries it has... i'm still new to linux and i don't know how to check what i can use dinamically and what i'll miss...
 
I'm have a similar problem.

I've followed the instructions from here. And figured to try the GuyFawkes demo first.

However I'm getting a fatal error when compiling.

I've removed the -static from the link in the makefile and have tried leaving it blank AND replacing it with -mcpu=arm926ej-s -mtune=arm926ej-s.

This is what I'm getting

C:\devkitGP2X\demo\guyfawkes>make
C:/devkitGP2X/bin/arm-linux-g++ -mcpu=arm926ej-s -mtune=arm926ej-s -o sdltest.gp
e sdltest.o -L"C:/devkitGP2X/lib" -lSDL -lSDL_gfx --start-group -lSDL_ttf -lfree
type -lSDL --end-group -lSDL_image -ljpeg -lpng12 -lz --start-group -lSDL_mixer
-lvorbisidec -lmikmod -lsmpeg -lSDL --end-group -lgcc -lm -lc -lexpat -lpthread
-ldl
c:\devkitgp2x\bin\..\lib\gcc\arm-linux\4.0.2\..\..\..\..\arm-linux\bin\ld.exe: c
annot find /usr/lib/ inside c:\devkitgp2x\arm-linux\bin\../../sysroot
make: *** [sdltest.gpe] Error 1

any idea where I might be going wrong?
 
Back
Top