QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

PSP Toolchain on Gentoo Linux

This is a discussion on PSP Toolchain on Gentoo Linux within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hellas friends! I would like to write some C code on my gent00 machine. There are several tutorials. I choose ...

Reply
 
LinkBack Thread Tools
Old 11-04-2009, 04:08 AM   #1
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default PSP Toolchain on Gentoo Linux

Hellas friends!

I would like to write some C code on my gent00 machine. There are several tutorials.
I choose this one.

Pretty easy I thought, but the toolchain script stopped giving this error msg:
Code:
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x48)[0x40124ec8]
/lib/libc.so.6[0x40122f10]
/lib/libc.so.6[0x40122598]
/lib/libc.so.6(_IO_default_xsputn+0xa0)[0x400aad00]
/lib/libc.so.6(_IO_padn+0xd0)[0x4009e210]
/lib/libc.so.6(_IO_vfprintf+0x2827)[0x400811e7]
/lib/libc.so.6(__vsprintf_chk+0xa7)[0x40122647]
/lib/libc.so.6(__sprintf_chk+0x2d)[0x4012258d]
psp-ar[0x805106d]
psp-ar[0x804f18b]
psp-ar[0x8051dc2]
psp-ar[0x8059870]
psp-ar[0x804b835]
psp-ar[0x804c2e8]
/lib/libc.so.6(__libc_start_main+0xe5)[0x40057725]
psp-ar[0x8049691]
======= Memory map: ========
08048000-080c3000 r-xp 00000000 08:06 3165949    /usr/local/pspdev/bin/psp-ar
080c3000-080c4000 r--p 0007a000 08:06 3165949    /usr/local/pspdev/bin/psp-ar
080c4000-080c5000 rw-p 0007b000 08:06 3165949    /usr/local/pspdev/bin/psp-ar
080c5000-08439000 rw-p 00000000 00:00 0          [heap]
40000000-4001c000 r-xp 00000000 08:06 1839590    /lib/ld-2.9.so
4001c000-4001d000 r--p 0001c000 08:06 1839590    /lib/ld-2.9.so
4001d000-4001e000 rw-p 0001d000 08:06 1839590    /lib/ld-2.9.so
4001e000-4001f000 r-xp 00000000 00:00 0          [vdso]
4001f000-40026000 r--s 00000000 08:06 2115670    /usr/lib/gconv/gconv-modules.cache
40026000-40030000 rw-p 00000000 00:00 0 
40030000-4003c000 r-xp 00000000 08:06 1950820    /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/libgcc_s.so.1
4003c000-4003d000 r--p 0000b000 08:06 1950820    /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/libgcc_s.so.1
4003d000-4003e000 rw-p 0000c000 08:06 1950820    /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/libgcc_s.so.1
40040000-40041000 rw-p 00000000 00:00 0 
40041000-4017e000 r-xp 00000000 08:06 1839096    /lib/libc-2.9.so
4017e000-40180000 r--p 0013d000 08:06 1839096    /lib/libc-2.9.so
40180000-40181000 rw-p 0013f000 08:06 1839096    /lib/libc-2.9.so
40181000-40185000 rw-p 00000000 00:00 0 
40185000-4033f000 r--p 00000000 08:06 2101024    /usr/lib/locale/locale-archive
bffda000-bfff1000 rw-p 00000000 00:00 0          [stack]
make[3]: *** [libgcc.a] Abgebrochen
make[3]: *** Datei »libgcc.a« wird gelöscht
make[3]: *** Warte auf noch nicht beendete Prozesse...
make[3]: Leaving directory `/usr/local/src/psptoolchain/build/gcc-4.1.0/build-psp/gcc'
make[2]: *** [stmp-multilib] Fehler 2
make[2]: Leaving directory `/usr/local/src/psptoolchain/build/gcc-4.1.0/build-psp/gcc'
make[1]: *** [all-gcc] Fehler 2
make[1]: Leaving directory `/usr/local/src/psptoolchain/build/gcc-4.1.0/build-psp'
make: *** [all] Fehler 2
../scripts/002-gcc-4.1.0-stage1.sh: Failed.
I used this board´s search to find "gentoo psp toolchain" and got several results.
But no1 seemed to have my problems.
The stuff with the script in env.d does not work anyhow, I would place it into ~/.bashrc but the rest sounded logically. I am using Baselayout2 if this should matter.
I rather intend there is missing something in my system. Some special dev- Ebuilds??

There are lots of Gentoo Freaks in here like mk2k. I hope to get help.
Thanks in advance from your German friend Klaus
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 01:09 AM   #2
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

Oh, E17 ( or E16, at least E )

Code:
wget http://www.calebgray.com/psp/development/psptoolchain-20070626.tar.bz2
wget http://www.calebgray.com/psp/development/pspsdk-20070626.tar.bz2
20070626 is the date... It's too old. You should rather checkout the SVN.

Code:
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
svn co svn://svn.pspdev.org/psp/trunk/psplibraries
I'd place environnements variable in /etc/profile. So, if you use another user, or another shell, there'll be no problems.

I think nothing should be missing in your system, and you're probably not out-of-date :P

Anyway the dependences on Debian are :
Code:
build-essential autoconf automake bison flex libncurses5-dev libreadline-dev libusb-dev texinfo libmpfr-dev libgmp3-dev
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 05:44 AM   #3
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Hi Kode!
This seems to work. Compiling went through. You gave me a svn command to obtain psplibraries, but this was not mentioned in the wiki. Do I need them, too?
On the same svn method I am currently installing the sdk. You left this step out.
I am a bit confused *G*.

(Yes, it is e17 )
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 07:12 AM   #4
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

Well, they're not needed, the only library you absolutely must have is the PSPSDK. But you'll probably want to use other libraries, like SDL, zlib, ...
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 08:40 AM   #5
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Quote:
Originally Posted by Kode View Post
Well, they're not needed, the only library you absolutely must have is the PSPSDK. But you'll probably want to use other libraries, like SDL, zlib, ...
okay, I will probably do compile them when neede *G*
For now it seemes to work.
If my batterie is beeing rechared I will have a try with a new compiled PBP.

Thanx so far!

Later I will have a look for a newbie tut. I think I came along one in here ..
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 10:49 AM   #6
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

If you want to create game, you can use the oslib mod, still maintained by Sakya : Subversion & Trac | OSLib mod | Assembla
And there are really easy to understand tutorials ( but you can easily guess they were orignally written in French :P ) there: day2 - OldSchool Library ( The first chapter is about the installation on Windows... )

For plugins, and other kind of applications, I guess there are not that much tutorials. You'll easily find how to compile a PRX, how to hook a function, ... but that's all.
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 12:16 PM   #7
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Thanx again! I think the libraries are required .. just compiling them.
I rather wanna make some little apps. I never really learned C, but a little c++, basic, pascal, html, php and what came around.
Just adopting code and learning by doing. Future will tell if I get along with it.
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 12:51 PM   #8
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

You can compile C++ code if you want, using either a C library like the oslib, or a C++ one like JGE++, but you'll often need to use C libraries.
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 01:51 PM   #9
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Quote:
Originally Posted by Kode View Post
You can compile C++ code if you want, using either a C library like the oslib, or a C++ one like JGE++, but you'll often need to use C libraries.
where you are talking about oslib ..
it can't find this lib ..locate doesn't either, though I installed theres psplibraries from svn source.

Code:
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O2  -D_PSP_FW_VERSION=150   -c -o main.o main.c
main.c:6:25: Fehler: oslib/oslib.h: Datei oder Verzeichnis nicht gefunden
mmh 150? incredible.. this is a little counter someone wrote for me. It is working with 550gen-d2 ..
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 12:26 AM   #10
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

The oslib isn't in the psplibraries pack : you have to install it manually.

Quote:
mmh 150? incredible.. this is a little counter someone wrote for me. It is working with 550gen-d2 ..
It's normal
It doesn't work only if it's compiled in kernel mode.

I gave the oslib's SVN : Subversion & Trac | OSLib mod | Assembla
Just copy manually oslib.a and the headers in the right folder.
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 02:24 AM   #11
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Quote:
Originally Posted by Kode View Post
The oslib isn't in the psplibraries pack : you have to install it manually.

I gave the oslib's SVN : Subversion & Trac | OSLib mod | Assembla
Just copy manually oslib.a and the headers in the right folder.
I saw this. I used the internal install.sh ..hope that was correct. Got my laptop here at work. I will try it at 1230 CET ..

edit:
oslib dirs & files are at there position, but make seems to search theme at a wrong position.
psp-config Values are set correctly, environment variables, too.
compiling samples delivered by sdk works.

here an excerpt from the build log:
Quote:
/home/user/PSP/OSLib_MOD/OSLib_MOD/drawing.c:228: undefined reference to `sceGumMatrixMode'
this structure of folders does not exist at all.
in home is only me, /home/poedel/pspsdk/.. and so on
try to find out where to fix it. Do you know?

Last edited by poedel; 11-06-2009 at 06:24 AM..
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 08:50 AM   #12

Enter Custom Title
 
sakya's Avatar
 
Join Date: Jan 2006
Posts: 279
Trader Feedback: 0
Default

Hi!

Quote:
Originally Posted by poedel View Post
here an excerpt from the build log:

this structure of folders does not exist at all.
in home is only me, /home/poedel/pspsdk/.. and so on
try to find out where to fix it. Do you know?
You're probably using a wrong makefile (you're missing -lpspgum).
If you're using the OSLib MOD check the samples directory.
oslibmod - Revision 46: /trunk/samples

The makefile from the HelloWorld looks like this:
Code:
TARGET = helloworld
OBJS = main.o

#To build for custom firmware:
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
         -lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum  -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
         -lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World
#PSP_EBOOT_ICON = ICON0.PNG
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Ciaooo
sakya
__________________
"And they're giving me a wonderful potion,
'Cos I cannot contain my emotion.
And even though, I'm feeling good,
Something tells me, I'd better activate my prayer capsule."
Supper's Ready (Genesis)
sakya is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 10:01 AM   #13
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Thanx Sakya!
I will try and do this this evening.
But remember that someone startet writing this program and compiled it for me as is.
With the same main.c && Makefile it does not work on my machine.
Thus I rather intend something´s wrong with the settings.
Someone (a config or whatever) must have told the compiler to search under /home/user/PSP/ ... for the libraries. IMHO I just should edit this config ..but where
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 10:09 AM   #14
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

What does psp-config --pspsdk outputs ? If it's in rour home, many things would be at the wrong place. Check $PSPDEV's value too.
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 11:09 AM   #15
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

Quote:
Originally Posted by Kode View Post
What does psp-config --pspsdk outputs ? If it's in rour home, many things would be at the wrong place. Check $PSPDEV's value too.
Code:
poedel@poedel2duo ~ $ psp-config --pspsdk
/usr/local/pspdev/psp/sdk
poedel@poedel2duo ~ $ echo $PSPDEV
/usr/local/pspdev
quite right, isn't it.
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 01:20 PM   #16
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

Yeah, no problems there. The only problem is that there's an undefined reference, and, in that case, the compiler tell you where the function has been referencend to. It just knows where are the sources.

Didn't it work with Sakya's Makefile ?
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 01:29 PM   #17

Enter Custom Title
 
sakya's Avatar
 
Join Date: Jan 2006
Posts: 279
Trader Feedback: 0
Default

Hi!
Quote:
Originally Posted by poedel View Post
someone startet writing this program and compiled it for me as is.
With the same main.c && Makefile it does not work on my machine.
If the code is written for the "normal" OSLib it's possible that it can be compiled linked with the lib.
I added some reference to OSLib, is there -lpspgum in the makefile you're using?

Quote:
Thus I rather intend something´s wrong with the settings.
Someone (a config or whatever) must have told the compiler to search under /home/user/PSP/ ... for the libraries.
No this was the path I compiled the lib into (where drawing.c was located), you don't need that path.

Ciaooo
Sakya
__________________
"And they're giving me a wonderful potion,
'Cos I cannot contain my emotion.
And even though, I'm feeling good,
Something tells me, I'd better activate my prayer capsule."
Supper's Ready (Genesis)
sakya is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-06-2009, 02:30 PM   #18
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

wow! unbelievable! it worked!
With the libs settings of the "hello world" makefile it works.
Thanks, friend!
Now I can start testing C
Can I test the eboot directly on the laptop anyhow, or do I always have to test it on the psp?
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-07-2009, 04:24 AM   #19
 
Join Date: Aug 2009
Real First Name: Kilian
Location: Wherever
Just Played: A game.
Posts: 30
Trader Feedback: 0
Default

You have to run the EBOOT on your PSP. You might get a code which compiles on both system ( with libraries like the SDL ), but nothing more. There's psplink which allows to run a PRX from your computer. If you want to use it, add BUILD_PRX = 1 in your makefile, and then run usbhostfs_pc ( root privileges are required for this on my system ), and pspsh. On your PSP, run the oe eboot ( installed $PSPDEV/psplink/psp/oe/ ). Finally, in a terminal run pspsh and type your prx's path. Notice you can run commands like
Code:
pspsh -e "my.prx"
Kode is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-07-2009, 06:44 AM   #20
 
poedel's Avatar
 
Join Date: Mar 2008
Posts: 26
Trader Feedback: 0
Default

astonishing ..

okay, Then I will keep on copying the eboot to the psp. If I know how the code behaves I will get a feeling for what will happen on the screen. Previewing will be needed less then, I suppose.
Thanx anyway!
poedel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
gentoo , linux , psp , toolchain

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 03:01 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us