forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem "relocation truncated to fit",please help,

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
patpsp



Joined: 25 Oct 2005
Posts: 31

PostPosted: Fri Nov 04, 2005 9:25 am    Post subject: Problem "relocation truncated to fit",please help, Reply with quote

Hello, i have a problem with libpng.
when i compile my program, it says :

/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngerror.o): da
ns la fonction « png_warning »:
pngerror.c:(.text+0x14c): référence indéfinie vers « _impure_ptr »
pngerror.c:(.text+0x14c): relocalisation tronquée pour concorder: R_MIPS_GPREL16
avec _impure_ptr

(relocation truncated to fit: R_MIPS_GPREL16 against '_impure_ptr' in english)

Can you explain me what i have to do ?

A search in the forum says that i have to compile the libpng with -G0
but it seems to be done :

1) i have downloaded the last libpng from svn
2) make
3) make install

I see "psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -c -o png.o png.c"

so the -G0 is passed



Any idea ?

I have no problem to compile test programs provided with pspsdk or pspGL

just the libpng i have installed causes problem.

Thanks for your help


Last edited by patpsp on Sat Nov 05, 2005 10:10 am; edited 2 times in total
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Fri Nov 04, 2005 11:19 am    Post subject: Reply with quote

Try adding -G0 to your own program too.
Back to top
View user's profile Send private message
patpsp



Joined: 25 Oct 2005
Posts: 31

PostPosted: Fri Nov 04, 2005 8:48 pm    Post subject: Reply with quote

thanks for your answer jimparis

i've tried, but same error :

$ make
psp-gcc test.o -O2 -G0 -DMODULE_NAME="test" psp-setup.c -L.. -L/usr/local/pspdev/psp/sdk/lib -lglut -lGLU -lGL -lpng -lz -lm -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lpsplibc -lpspuser -lpspkernel -lpsprtc -o test.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngerror.o): dans la fonction « png_warning »:
pngerror.c:(.text+0x14c): référence indéfinie vers « _impure_ptr »
pngerror.c:(.text+0x14c): relocalisation tronquée pour concorder: R_MIPS_GPREL16 avec _impure_ptr
pngerror.c:(.text+0x1a8): référence indéfinie vers « _impure_ptr »
pngerror.c:(.text+0x1a8): relocalisation tronquée pour concorder: R_MIPS_GPREL16 avec _impure_ptr
pngerror.c:(.text+0x1ac): référence indéfinie vers « _impure_ptr »
pngerror.c:(.text+0x1ac): relocalisation tronquée pour concorder: R_MIPS_GPREL16 avec _impure_ptr
...


Any ideas ?
Back to top
View user's profile Send private message
patpsp



Joined: 25 Oct 2005
Posts: 31

PostPosted: Fri Nov 04, 2005 11:11 pm    Post subject: Reply with quote

well, i wrote my Makefile again, including the build.mak this time and it now compiles just fine. I don't have the old makefile, so i can't tell you my previous mistake.

So it is resolved.

If someone has the same problem, i advice him to test whether the screenshot program included in libpng compiles or not.
If it compiles, have a look at the Makefile for the screenshot and try to modify it for your app.
Back to top
View user's profile Send private message
patpsp



Joined: 25 Oct 2005
Posts: 31

PostPosted: Sat Nov 05, 2005 9:53 am    Post subject: Reply with quote

Well, i'm sorry, but i've just tested my app, and my psp reboots...
So my new makefile, which allows me to compile fine, doesn't work as well as i thougt. All compile fine, but the execution failed...

So, i start again with the old makefile, which just compiles fine my app before the need of using libpng.

So, i ask you again with the "relocation truncated to fit: R_MIPS_GPREL16 against '_impure_ptr'"

Please help...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group