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 

Test Program

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



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sun Jul 10, 2005 12:44 am    Post subject: Test Program Reply with quote

Hi guys,

I'm trying to port my homebrew engine/games to PSP using the PSPSDK (the windows binary edition thats floating around)

After spending most of today with it, i ported most of it and got it compiling just fine, but i'm having trouble fixing the last few link errors....

Its worth mentioning, i am not using the makefile, and i am not using make (I've written a GCC compiler plugin for VS).. Can anyone perhaps give me a full command line for the link step? (including libs that should/shouldnt be linked)

I know some of the libs are linked implicitly, and are 'hard wired' in by psp-gcc, but i dont know what ones they are, and which libs i have to link manually/etc..

Sorry, i have next to no experience with working with linux/GCC, so if anyone can help me out with these last few errors i'd appreciate it heaps..

They are as follows:
/cygdrive/d/Programming/PSPDev/bin/../lib/gcc/psp/4.0.0/../../../../psp/lib/crt0.o: In function `__entrytable':
crt0.S:(.rodata.sceResident+0xc): undefined reference to `module_info'
D:/Projects/Fuji/Lib/libFuji_Debug_PSP.a(Util.o): In function `dprintf(char const*, ...)':
Util.cpp:(.text+0x248): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
D:/programming/pspdev/psp/lib/libc.a(sbrkr.o): In function `_sbrk_r':
../../../../../newlib/libc/reent/sbrkr.c:60: undefined reference to `sbrk'
D:/programming/pspdev/psp/lib/libc.a(makebuf.o): In function `__smakebuf':
../../../../../newlib/libc/stdio/makebuf.c:96: undefined reference to `isatty'
D:/programming/pspdev/psp/lib/libc.a(writer.o): In function `_write_r':
../../../../../newlib/libc/reent/writer.c:58: undefined reference to `write'
D:/programming/pspdev/psp/lib/libc.a(closer.o): In function `_close_r':
../../../../../newlib/libc/reent/closer.c:53: undefined reference to `close'
D:/programming/pspdev/psp/lib/libc.a(fstatr.o): In function `_fstat_r':
../../../../../newlib/libc/reent/fstatr.c:62: undefined reference to `fstat'
D:/programming/pspdev/psp/lib/libc.a(lseekr.o): In function `_lseek_r':
../../../../../newlib/libc/reent/lseekr.c:58: undefined reference to `lseek'
D:/programming/pspdev/psp/lib/libc.a(readr.o): In function `_read_r':
../../../../../newlib/libc/reent/readr.c:58: undefined reference to `read'
D:/programming/pspdev/psp/lib/libm.a(w_sqrt.o): In function `sqrt':
../../../../../newlib/libm/math/w_sqrt.c:83: undefined reference to `__errno'
../../../../../newlib/libm/math/w_sqrt.c:86: undefined reference to `__errno'
D:/programming/pspdev/psp/lib/libm.a(wf_acos.o): In function `acosf':
../../../../../newlib/libm/math/wf_acos.c:50: undefined reference to `__errno'
../../../../../newlib/libm/math/wf_acos.c:47: undefined reference to `__errno'
D:/programming/pspdev/psp/lib/libm.a(wf_sqrt.o): In function `sqrtf':
../../../../../newlib/libm/math/wf_sqrt.c:50: undefined reference to `__errno'
D:/programming/pspdev/psp/lib/libm.a(wf_sqrt.o):../../../../../newlib/libm/math/wf_sqrt.c:53: more undefined references to `__errno' follow
D:/programming/pspdev/psp/lib/libstdc++.a(pure.o):../../../../libstdc++-v3/libsupc++/pure.cc:54: undefined reference to `write'
collect2: ld returned 1 exit status

lots of them reference the __errno symbol.. wheres that sposed to be?
also read/write/close/etc feature in there..
and 'module_info'? is that some GCC thing?

Thanks heaps!
- Turkey
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sun Jul 10, 2005 10:20 am    Post subject: Reply with quote

no ideas?

perhaps i should just define them all myself for the sake of getting it to link :P

thats not what i had in mind tho..
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Jul 10, 2005 11:06 am    Post subject: Reply with quote

Use toolchain.sh to build the latest PSPSDK out of Subversion.
Back to top
View user's profile Send private message
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sun Jul 10, 2005 5:19 pm    Post subject: Reply with quote

well i built the latest stuff from svn successfully..
and after a little more tweaking, all link errors are fixed except some references from libc.a

my command line (probably wrong.. do i need all these libs?):

psp-gcc.exe Build/Debug_PSP/*.o ../Fuji/lib/libFuji_Debug_PSP.a -LC:\cygwin\usr\local\pspdev\psp\sdk\lib /usr/local/pspdev/psp/lib/crt0.o -lpspkernel -lpsplibc -lpspglue -lpspuser -lg -lm -liberty -lstdc++ -lsupc++ -lc

do i need to specify crt0.o like that?

and here are the remaining link errors (path's trimmed for readability):

../fuji/lib/libFuji_Debug_PSP.a(Util.o): In function `dprintf(char const*, ...)':
Util.cpp:(.text+0x248): relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
..../libc.a(makebuf.o): In function `__smakebuf':
/newlib/libc/stdio/makebuf.c:96: undefined reference to `isatty'
..../libc.a(sbrkr.o): In function `_sbrk_r':
/newlib/libc/reent/sbrkr.c:60: undefined reference to `sbrk'
..../libc.a(writer.o): In function `_write_r':
/newlib/libc/reent/writer.c:58: undefined reference to `write'
..../libc.a(closer.o): In function `_close_r':
/newlib/libc/reent/closer.c:53: undefined reference to `close'
..../libc.a(fstatr.o): In function `_fstat_r':
/newlib/libc/reent/fstatr.c:62: undefined reference to `fstat'
..../libc.a(lseekr.o): In function `_lseek_r':
/newlib/libc/reent/lseekr.c:58: undefined reference to `lseek'
..../libc.a(readr.o): In function `_read_r':
/newlib/libc/reent/readr.c:58: undefined reference to `read'
collect2: ld returned 1 exit status

same ones that were there before.. but a few less..

again, i appologise for my ignorance, this GCC stuff is all new to me, and i'm trying to perform all the build steps manually..
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Mon Jul 11, 2005 12:22 am    Post subject: Reply with quote

no takers? :(
i've been fiddling with it for 2 days now... its not giving me any love..
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Jul 11, 2005 1:05 am    Post subject: Reply with quote

There's a psptoolchain in Subversion that hasn't been released yet that fixes this problem. You can grab the one from subversion, or wait for it to be released (probably when ooPo reads this message :).

It's just that the psptoolchain on ooPo's site has become out of sync with PSPSDK in subversion.
Back to top
View user's profile Send private message
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Mon Jul 11, 2005 9:22 am    Post subject: Reply with quote

i did build the latest toolchain from svn...
so unless i screwed up building it (which i'm fairly sure i didnt) i suspect there may be another problem, or i am just doing something else wrong with the linker..

when you say 'theres *a* psptoolchain in subversion' .. is it like on a branch or something? i used this link:
svn://svn.pspdev.org/psp/trunk/pspsdk

it all built according to plan, and it fixed some of my link errors, but those ones still remain.. :/ .. perhaps i'll try again from scratch.. although i dont really know how to uninstall stuff in linux.. (it'll leave paths to deleted directories and stuff if i just delete it)

thanks anyway.. hopefully he reads this soon ;)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Agoln



Joined: 08 Jun 2005
Posts: 326
Location: Fort Wayne, IN

PostPosted: Mon Jul 11, 2005 9:42 am    Post subject: Reply with quote

turkeyman wrote:
although i dont really know how to uninstall stuff in linux.. (it'll leave paths to deleted directories and stuff if i just delete it)



To delete stuff in linux, just do a:

make clean


There is no registery in linux as there is in windows, so there isn't much left after you just delete the directory. Nothing is left behind.
_________________
Lego of my Ago!
Back to top
View user's profile Send private message AIM Address
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Mon Jul 11, 2005 9:46 am    Post subject: Reply with quote

what about dangling paths?

where are all the path's actually stored anyway?
and i'm in cygwin mind you, so does it share windows' path? or whats the story there?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Agoln



Joined: 08 Jun 2005
Posts: 326
Location: Fort Wayne, IN

PostPosted: Mon Jul 11, 2005 9:52 am    Post subject: Reply with quote

turkeyman wrote:
what about dangling paths?

where are all the path's actually stored anyway?
and i'm in cygwin mind you, so does it share windows' path? or whats the story there?


I'm not sure how cygwin deals with windows paths.

If you do a:
Code:
echo $PATH

in cygwin, does it return the same as a:
Code:
echo %path%

in windows?

That would probably give you some more infromation about it.

As for changing variables and path's, check out ~/.bashrc or ~/.bash_profile (~ is home directory), and anything that modifies your path or any variable for that matter is usually right there in those files.
_________________
Lego of my Ago!
Back to top
View user's profile Send private message AIM Address
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Mon Jul 11, 2005 10:18 pm    Post subject: Reply with quote

mrbrown:

when you refer to the 'psptoolchain' do you mean the compiler? or the sdk+tools? (they are separate at this point arent they?)

how is it possible for the compiler (psp-gcc.exe) to be incompatible with linking a particular lib?

perhaps i dont understand the problem, this GCC environment is still very foreign to me...

how can i build the compilers from svn? i only saw the pspsdk stuff in there...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Mon Jul 11, 2005 10:32 pm    Post subject: Reply with quote

ah okay, upon closer inspection, i noticed theres not only the pspsdk in the svn trunk... theres loads of stuff :P

so if i build the toolchain from 'svn://svn.pspdev.org/psp/trunk/psptoolchain' using the toolchain.sh from within the repository, will that build a set of compatible compilers/tools? (big download, takes ages.. want to be sure its what i'm looking for first before i try)

thanks
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Tue Jul 12, 2005 12:48 am    Post subject: Reply with quote

and i'm linking!! :)
now i'm in business.. time to cause some damage!

cool thanks heaps guys! :P
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
XxBAOxX



Joined: 06 Oct 2005
Posts: 19

PostPosted: Mon Oct 10, 2005 7:04 am    Post subject: Reply with quote

turkeyman wrote:
ah okay, upon closer inspection, i noticed theres not only the pspsdk in the svn trunk... theres loads of stuff :P

so if i build the toolchain from 'svn://svn.pspdev.org/psp/trunk/psptoolchain' using the toolchain.sh from within the repository, will that build a set of compatible compilers/tools? (big download, takes ages.. want to be sure its what i'm looking for first before i try)

thanks


ok...how do i build this toolchain from within the repository?.....


edit-im sorry if this was a stupid question.....i automatically assumed that all i had to do was download the toolchain.sh into my current psptoolchain dir.....so what i meant to ask is if im doing it right?
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Mon Oct 10, 2005 8:00 am    Post subject: Reply with quote

a simple read of the included
README file within the toolchain tarball
would have told you enough information

but just for clarity please input these
into your bash shell while cwd in psptoolchain
directory:

Installation from Subversion

1.) svn co svn://svn.pspdev.org/psp/trunk/pspsdk

(that will checkout current version from svn and
files will be under pspsdk dir complete with all you will need
including docs) :P

Once you've downloaded PSPSDK, run the following from the pspsdk directory
to create the configure script and support files (you must have autoconf and
automake installed):

2.) ./bootstrap

3.) ./configure

4.) make

5.) make doxygen-doc (only if you would like to build pspsdk
documentation and MUST of course have doxygen installed)

6.)finally do a - make install

if you performed these simple commands then
congratulation you have installed the freshest revision
of pspsdk off svn ;)

you wont need to perform these commands everytime
when you need to update from svn

a simple
svn up or svn update while cwd in psptoolchain will do this
for you :)

All i have described is written (coherently) in PSPSDK
README file .... next time do a little research
something as simple as reading those blasted dofagled
new age readme's is all you will need as i have just
demostrated ;)
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
XxBAOxX



Joined: 06 Oct 2005
Posts: 19

PostPosted: Mon Oct 10, 2005 8:27 am    Post subject: Reply with quote

thanks buddy....

youve really helped me out alot.....and actually....hold on *takes foot outta mouth* i just read it...lol.....
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