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 

libpspglue issues

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



Joined: 24 Jun 2005
Posts: 50

PostPosted: Sat Jul 02, 2005 3:19 am    Post subject: libpspglue issues Reply with quote

Hi Guys,

Currently in ScummVM-PSP we've had to stub off these functions because of the following undefined symbols:

Code:

/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(pure.o):../.
./../../libstdc++-v3/libsupc++/pure.cc:54: undefined reference to `write'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(sbrkr.o): In func
tion `_sbrk_r':
../../../../../newlib/libc/reent/sbrkr.c:60: undefined reference to `sbrk'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(writer.o): In fun
ction `_write_r':
../../../../../newlib/libc/reent/writer.c:58: undefined reference to `write'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(closer.o): In fun
ction `_close_r':
../../../../../newlib/libc/reent/closer.c:53: undefined reference to `close'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(fstatr.o): In fun
ction `_fstat_r':
../../../../../newlib/libc/reent/fstatr.c:62: undefined reference to `fstat'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(lseekr.o): In fun
ction `_lseek_r':
../../../../../newlib/libc/reent/lseekr.c:58: undefined reference to `lseek'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(readr.o): In func
tion `_read_r':
../../../../../newlib/libc/reent/readr.c:58: undefined reference to `read'
collect2: ld returned 1 exit status
make: *** [scummvm-psp.elf] Error 1


Now I know libpspglue implements these right? Has anyone successfully compiled a c++ file using libstdc++, libpspglue, libpsplibc and libc combined?

Here is the PSPSDK_LIBC_LIB var we are using:

PSPSDK_LIBC_LIB = -lm -lstdc++ -lpsplibc -lpspglue -lc

Tommy.[/code]
Back to top
View user's profile Send private message Send e-mail
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jul 02, 2005 5:24 am    Post subject: Reply with quote

You're only to use either libpsplibc, or libc + libpspglue. Never both at the same time.
Back to top
View user's profile Send private message
TommyBear



Joined: 24 Jun 2005
Posts: 50

PostPosted: Sat Jul 02, 2005 7:26 pm    Post subject: Reply with quote

mrbrown wrote:
You're only to use either libpsplibc, or libc + libpspglue. Never both at the same time.


Well okay but libpsplibc does not implement:
__errorno
_impure_ptr
__assert

I'm using this:
-lm -lstdc++ -lpsplibc

Get this:

Code:

/cygdrive/c/DOCUME~1/THOMAS~1/LOCALS~1/Temp/cc4PTjnp.o: In function `Scumm::ScummEngine_v2::redrawV2Inventory()':
verbs.cpp:(.text+0x4d0): undefined reference to `__assert'
/cygdrive/c/DOCUME~1/THOMAS~1/LOCALS~1/Temp/cc4PTjnp.o: In function `Scumm::ScummEngine::drawVerbBitmap(int, int, int)':
verbs.cpp:(.text+0xee8): undefined reference to `__assert'
verbs.cpp:(.text+0xf08): undefined reference to `__assert'
/cygdrive/c/DOCUME~1/THOMAS~1/LOCALS~1/Temp/cc8VgpXq.o: In function `Scumm::wizPackType1Helper2(unsigned char*&, int, Scumm::wizPackCtx*)':
wiz_he.cpp:(.text+0x5a8): undefined reference to `__assert'
/cygdrive/c/DOCUME~1/THOMAS~1/LOCALS~1/Temp/cc8VgpXq.o: In function `Scumm::Wiz::getWizImageDim(int, int, int&, int&)':
wiz_he.cpp:(.text+0x6c8): undefined reference to `__assert'
/cygdrive/c/DOCUME~1/THOMAS~1/LOCALS~1/Temp/cc8VgpXq.o:wiz_he.cpp:(.text+0x750): more undefined references to `__assert' follow
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libm.a(w_atan2.o): In function `atan2':
../../../../../newlib/libm/math/w_atan2.c:110: undefined reference to `__errno'
../../../../../newlib/libm/math/w_atan2.c:107: undefined reference to `__errno'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libm.a(w_hypot.o): In function `hypot':
../../../../../newlib/libm/math/w_hypot.c:99: undefined reference to `__errno'
../../../../../newlib/libm/math/w_hypot.c:102: undefined reference to `__errno'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libm.a(w_log.o): In function `log':
../../../../../newlib/libm/math/w_log.c:106: undefined reference to `__errno'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libm.a(w_log.o):../../../../../newlib/libm/math/w_log.c:110: more undefined references to `__e
rrno' follow
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(pure.o):../../../../libstdc++-v3/libsupc++/pure.cc:54: undefined reference to `wri
te'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:69: undefined refer
ence to `_impure_ptr'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:70: undefined refer
ence to `_impure_ptr'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:74: undefined refer
ence to `_impure_ptr'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:74: undefined refer
ence to `_impure_ptr'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:51: undefined refer
ence to `_impure_ptr'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:51: more undefined
references to `_impure_ptr' follow
/usr/local/pspdev/psp/sdk/lib/libpsplibc.a(ftell.o): In function `ftell':
../../../sdk/libc/stdio.c:718: undefined reference to `__errno'
../../../sdk/libc/stdio.c:724: undefined reference to `__errno'
/usr/local/pspdev/psp/sdk/lib/libpsplibc.a(strtol.o): In function `strtol':
../../../sdk/libc/stdlib.c:1034: undefined reference to `__errno'
../../../sdk/libc/stdlib.c:1034: undefined reference to `__errno'
collect2: ld returned 1 exit status
make: *** [scummvm-psp.elf] Error 1


Unless I'm doing something completely whacky... This is why I included libc which implements these. This is using the latest released psptoolchain 625.

Tommy.
Back to top
View user's profile Send private message Send e-mail
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jul 02, 2005 10:11 pm    Post subject: Reply with quote

Well, you should really be using Newlib's libc. Your earlier output indicated you weren't using the latest toolchain, as read, write, sbrk, etc. should have an underscore in front of their names.

So grab the latest toolchain, and if you are manually specifying your libraries use -lc -lpspglue. Preserve the library order in build.mak.
Back to top
View user's profile Send private message
TommyBear



Joined: 24 Jun 2005
Posts: 50

PostPosted: Sat Jul 02, 2005 11:05 pm    Post subject: Reply with quote

Ok will do. Thanks

Tommy.
Back to top
View user's profile Send private message Send e-mail
abszero



Joined: 06 Jul 2005
Posts: 2

PostPosted: Wed Jul 06, 2005 1:01 pm    Post subject: Reply with quote

I'm basically in the same situation as TommyBear. After switching to newlib I got rid of some errors with _ctype_, _errno, etc, but now it's unable to find a number of functions (open, lseek, read, write, close, stat, fstat, and several others).

mrbrown indicated that if it had been compiled with the most recent toolchain that these functions should be prefixed with underscores, but I'm running today's 20050705 release and that doesn't seem to be the case. That's newer than the one available at the time of that post so things may have reverted or something but I had the same errors at one point with the 0625 version of the toolchain. Any suggestions?

For reference:
psp-gcc -O2 -G0 -fno-strength-reduce -Wall -D"USE_PSP" -L$(PSPSDK)/lib -lpspdebug -lstdc++ -lc -lpspglue -lpspkernel ...

-abszero
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