Win32 native Toolchain for PSPSDK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
orphean
Posts: 8
Joined: Sun Apr 20, 2008 2:27 pm

Post by orphean »

This was exactly what I was looking for and it works great.

I'm running into a problem with psplink however. It refuses to run .elf files, always giving me an error. Also, psplink will not start homebrew'ed software that I didn't compile already on my psp (like snes9xtyl among others).

If I compile my projects as a .prx I can get it to run with psplink.

After searching the forums here it seems the most common solution is updating and recompiling the toolchain, though I am not sure if this is the issue.

Any ideas would be great.

Thanks for all your work on this.

edit: I should mention that everything I've compiled with this toolchain works great on the hardware itself. I would love to get psplink working better though!
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

hlide i never tried gcc 4.2.3 or the latest 4.3 series. In order to get it to build i need to see if the mingw has already ported it and it works. Unfortunately my knowledge is limited all all i do is picking from their work and adapt it to the psp. It seems that they manage to port it to 4.3 a fews weeks ago, i've to take time building and reading how they did it.

I'll try to build a 4.3 gcc but i can't promise for when to deliver.

In the meanwhile can you give me pointer on how to build it on linux or cygwin? required libs, dependencies script flags, that would help a lot since i only do this on my free time.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

orphean, unfortunately psplink is build in cygwin because i'd need to port ptread, ncurses and more difficult the fork() function to get it working under windows. i haven't had enough time to investigate further and test it for real, but since it's a cygwin build maybe someone else on the forums can help you better than me.

Sorry
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall wrote:hlide i never tried gcc 4.2.3 or the latest 4.3 series.

In the meanwhile can you give me pointer on how to build it on linux or cygwin? required libs, dependencies script flags, that would help a lot since i only do this on my free time.
hlide.free.fr/download/PSP/gcc-4.3.0-PSP.patch.zip

on cygwin, you should follow what Gauri tells me in his post. It is true there is two new libraries, I forgot them :/.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Hi hlide,

A experimental build with GCC 4.3.0 and GDB 6.8 is available on the download site:

http://sourceforge.net/projects/minpspw

Docs are not included (al least all of them) it still uses newlib 1.15 and binutils 1.16.1
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

good news :) I'm gonna try it
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

how can I update the pspsdk? do I have to wait for you? If yes, I'll do it, no problem....

http://forums.ps2dev.org/viewtopic.php?t=10098
Ciao! from Italy
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

I'll trigger the build tonight hopefully tomorrow i'll add it in the morning to the binary download page
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall, now i've been using your pspsdk on a regular basis since you added gcc 4.3.0. And don't have any major problem. Maybe I'll consider to port the last binutils too.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

phobox you have a new release 0.7.3! with HTTP client

hlide that would be great, i've read the changelog of binutils and it seems that the latest version has some bug fixes like null pointer derreferences that are fixed. Personally i never faced any but it would be nice to have it fixed.
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

you should create a way to update in an easy way...like a little updater that updates the necessary files of a previous release...

Thanks for everything you've done.
Ciao! from Italy
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Heimdall, is a good idea a simple cmd line updater!
If you want i can help you to create this in C!
What do you think about this?
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

I've started to work on a small script that shows the added, removed and modified files between 2 versions. After i get this script tuned i'll need to pack then for example a zip or even beter a 7z (because it's open and free) or even better self extractor 7z with the differences.

later on it would be nice to have a small app in the SDK that checks for a known file in the project site and parses it to get the current latest version and if it's different downloads the self extracting file and expands it over the SDK.

The problem here is security some bad intentioned people can just replace the patch with bad stuff and hack the SDK users, still need to think about this.

Maybe sign it, but that requires me to buy a certificate and i do this for free.

Any other ideas?
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

You can make a self-signed certificate....it's not Alcatraz-like security (discontinued self-signed certificates do not even get blacklisted, of course), but it's better than nothing. Eventually we could code a small app checking signatures in a proprietary way (5 minutes of c# coding...that often is enough to discourage script kiddies)
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Heimdall, your is a good idea, to download the file you can use telnet, and to extract the file there is a cmq line version for 7z!
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

Heimdall, i can't see the problem...
you write a software that reads the pspsdk svn, is there a way to check the revision?

if the revision is bigger than te installed one download new or modified files (how to know which files are these I don't know..) and than copy them to their paths.

For a toolchain update you can check your web server for new or modified files and then download and install them.

i can't see the security problem...
Ciao! from Italy
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Hi guys and girls!

A new fresh release of the SDK (0.7.4) with the latest SVN changes has been added to the download site. it now contains the audio stuff discussed last week on the forum.

There is also a 7z file called patch for all of you who don't want to download the 30mb installer and it contains a fresh GCC + SDK only (no docs, no psplink) an it is around 6Mb in size. Just download and decompress over your PSPSDK installation dir.

as usual get it from the sourceforge site: http://sourceforge.net/projects/minpspw

or the direct link:
https://sourceforge.net/project/showfil ... _id=597733

Cheers!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall wrote:Hi guys and girls!

A new fresh release of the SDK (0.7.4) with the latest SVN changes has been added to the download site. it now contains the audio stuff discussed last week on the forum.

There is also a 7z file called patch for all of you who don't want to download the 30mb installer and it contains a fresh GCC + SDK only (no docs, no psplink) an it is around 6Mb in size. Just download and decompress over your PSPSDK installation dir.

as usual get it from the sourceforge site: http://sourceforge.net/projects/minpspw

or the direct link:
https://sourceforge.net/project/showfil ... _id=597733

Cheers!
Arrrgggghhh !!!! why didn't you warn this one has no gcc 4.3.0. Now that I used your patch, I cannot compile anymore... grrr...

anyway, I think gcc 4.3.0 should be considered as a serious candidate to replace 4.1.x which has more bugs.

EDIT:

Am I the only one to test this patch ?

even removing offending option -std=gnu++0x, I still got some problems :

Code: Select all

------ Build started: Project: pspvftl, Configuration: Debug Win32 ------
Performing Makefile project actions
psp-g++ -I. -ID:/dev/pspsdk/psp/sdk/include -O3 -G0 -Wall -fsingle-precision-constant -fomit-frame-pointer -ffast-math -save-temps -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=150   -c -o main.o main.cpp
In file included from D:/dev/pspsdk/psp/sdk/include/pspuser.h (18) ,
                 from D:/dev/pspsdk/psp/sdk/include/pspkernel.h (18) ,
                 from psp.h (3) ,
                 from main.cpp (1) :
D:/dev/pspsdk/psp/sdk/include/psptypes.h (22) :20: error: stdint.h: No such file or directory
In file included from D:/dev/pspsdk/psp/sdk/include/pspuser.h (26) ,
                 from D:/dev/pspsdk/psp/sdk/include/pspkernel.h (18) ,
                 from psp.h (3) ,
                 from main.cpp (1) :
D:/dev/pspsdk/psp/sdk/include/psputils.h (32) :22: error: sys/time.h: No such file or directory
In file included from main.cpp (2) :
psp_disasm.h (1) :20: error: stdlib.h: No such file or directory
psp_disasm.h (2) :20: error: string.h: No such file or directory
psp_disasm.h (3) :19: error: stdio.h: No such file or directory
In file included from main.cpp (5) :
test.hpp (5) :18: error: vector: No such file or directory
test.hpp (6) :18: error: string: No such file or directory
In file included from core.h (2) ,
                 from test.hpp (8) ,
                 from main.cpp (5) :
core/folder.h (3) :19: error: errno.h: No such file or directory
core/folder.h (4) :20: error: dirent.h: No such file or directory
main.cpp (265) :7: warning: no newline at end of file
D:\dev\pspsdk\bin\make: *** [main.o] Error 1
Build log was saved at "file://d:\dev\pspvftl\trunk\pspvftl\Debug\BuildLog.htm"
pspvftl - 9 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

hlide, sorry for that :) I was using the 0.7.x versions as GCC 4.1.x and 0.8.x for GCC 4.3.x.

I'm in the process of moving my build environment from windows GCC 4.2.1 to windows GCC 4.3.x

Once I've completed this I'll trigger a new 0.8 build. with the latest SDK. Now the question is: Should I promote GCC 4.3.x and GDB 6.8 as the main release? does everything that works with GCC 4.1.x works? If it does I'll definitely start to support only GCC 4.3.x and keep 4.1.x builds for legacy features.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Heimdall, you're the best, thank you very much for your work....after months of inactivity, maybe i succeded in obtaining some free time to develop a small project; so i will use this new release and test it.....there's something specific you need to test this time?

cheers,
jean
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

MINGW GCC 4.3.0 still seems to be buggy, it fails to build GDB 6.8 with some strange error messages on printf with invalid sequence "I".

I'm falling back to Win32 GCC 4.2.1 to build the cross compiler for PSP GCC 4.3.0 with the latest SDK.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

A first attempt to use this last sdk makes me think that some files are missing...now i'm trying to use a "frankenstein version" made merging your last release with a previous one...
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

jean wrote:A first attempt to use this last sdk makes me think that some files are missing...now i'm trying to use a "frankenstein version" made merging your last release with a previous one...
Are you trying to mix experimental 8.X (with gcc 4.3.0) and 7.X (with gcc 4.1.2) ? I did it (not on purpose) but got some troubles, so I decided to wait for Heimdall to upgrade 8.X.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

guys i found a bug on the windows compiler mingw 4.3.0 and already reported it to the project, i now know that i can only build the SDK with mingw gcc 4.2.1, so today or tomorrow i'll post a new 0.8 build with:

+ latest SDK
+ GCC 4.3.0
+ GDB 6.8
+ I've also enabled precompiled headers which were off by default

I've been also busy creating a plugin for Eclipse to use directly the SDK without needing to tune anything.

FYI the mingw issue is that windows printf for types like: long long int uses the format %I64d and linux uses %lld, it seems that the latest mingw gcc emits a warning for the format %I64 because it is not part of the standard but since mingw uses msvcrt8.dll to invoke printf it needs to be that otherwise it won't print the correct value.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

I'm just installed 0.7.4 and I'm NOT able to compile :O

Code: Select all

psp-gcc -I. -ID:/PSPSDK/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150   -c -o main.o main.c
In file included from D:/PSPSDK/psp/sdk/include/pspuser.h:26,
                 from D:/PSPSDK/psp/sdk/include/pspkernel.h:18,
                 from main.c:1:
D:/PSPSDK/psp/sdk/include/psputils.h:32:22: error: sys/time.h: No such file or directory
In file included from D:/PSPSDK/psp/sdk/include/pspuser.h:26,
                 from D:/PSPSDK/psp/sdk/include/pspkernel.h:18,
                 from main.c:1:
D:/PSPSDK/psp/sdk/include/psputils.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sceKernelLibcTime'
D:/PSPSDK/psp/sdk/include/psputils.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sceKernelLibcClock'
D:/PSPSDK/psp/sdk/include/psputils.h:48: warning: 'struct timezone' declared inside parameter list
D:/PSPSDK/psp/sdk/include/psputils.h:48: warning: its scope is only this definition or declaration, which is probably not what you want
D:/PSPSDK/psp/sdk/include/psputils.h:48: warning: 'struct timeval' declared inside parameter list
main.c:4:19: error: stdio.h: No such file or directory
main.c:5:20: error: stdlib.h: No such file or directory
main.c:6:20: error: string.h: No such file or directory
main.c:7:20: error: unistd.h: No such file or directory
In file included from main.c:11:
D:/PSPSDK/psp/sdk/include/pspnet_resolver.h:22:24: error: netinet/in.h: No such file or directory
In file included from main.c:11:
D:/PSPSDK/psp/sdk/include/pspnet_resolver.h:62: warning: 'struct in_addr' declared inside parameter list
D:/PSPSDK/psp/sdk/include/pspnet_resolver.h:76: warning: 'struct in_addr' declared inside parameter list
main.c:14:23: error: arpa/inet.h: No such file or directory
main.c:15:24: error: sys/select.h: No such file or directory
main.c:16:19: error: errno.h: No such file or directory
main.c:17:24: error: sys/socket.h: No such file or directory
main.c: In function 'connect_to_apctl':
main.c:37: warning: implicit declaration of function 'printf'
main.c:37: warning: incompatible implicit declaration of built-in function 'printf'
main.c:41: warning: incompatible implicit declaration of built-in function 'printf'
main.c: At top level:
main.c:72: warning: 'struct sockaddr_in' declared inside parameter list
main.c: In function 'initSocket':
main.c:74: error: dereferencing pointer to incomplete type
main.c:74: error: 'AF_INET' undeclared (first use in this function)
main.c:74: error: (Each undeclared identifier is reported only once
main.c:74: error: for each function it appears in.)
main.c:75: error: dereferencing pointer to incomplete type
main.c:75: warning: implicit declaration of function 'inet_addr'
main.c:76: error: dereferencing pointer to incomplete type
main.c:76: warning: implicit declaration of function 'htons'
main.c: In function 'connect_to':
main.c:82: error: storage size of 'name' isn't known
main.c:86: warning: implicit declaration of function 'socket'
main.c:86: error: 'PF_INET' undeclared (first use in this function)
main.c:86: error: 'SOCK_STREAM' undeclared (first use in this function)
main.c:86: error: 'IPPROTO_TCP' undeclared (first use in this function)
main.c:101: warning: implicit declaration of function 'connect'
main.c:104: warning: implicit declaration of function 'close'
main.c:84: warning: unused variable 'flag'
main.c:82: warning: unused variable 'name'
main.c: In function 'main':
main.c:136: warning: implicit declaration of function 'strcpy'
main.c:136: warning: incompatible implicit declaration of built-in function 'strcpy'
make.exe: *** [main.o] Error 1
Process terminated with status 2 (0 minutes, 3 seconds)
22 errors, 18 warnings
Could you kindly post a fix soon. Thanks!
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

I just clean my machine and installed the build 0.7.4 full installer, and compiled the net demo:

(I used this demo because it contains the headers your output is complaining not to be available)

Code: Select all

C:\pspsdk\psp\sdk\samples\net\simple>make
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O0 -G0 -Wall -g -D_PSP_FW_VERSION=150
 -c -o main.o main.c
main.c: In function 'start_server':
main.c:149: warning: passing argument 3 of 'accept' from incompatible pointer ty
pe
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O0 -G0 -Wall -g -D_PSP_FW_VERSION=150
-L. -LC:/pspsdk/psp/sdk/lib   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl
-lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputilit
y -lpspuser -lpspkernel -o netsample.elf
psp-fixup-imports netsample.elf
mksfo 'netsample' PARAM.SFO
psp-strip netsample.elf -o netsample_strip.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL  \
        NULL NULL NULL  \
        NULL  netsample_strip.elf NULL
[0]        408 bytes | PARAM.SFO
[1]          0 bytes | NULL
[2]          0 bytes | NULL
[3]          0 bytes | NULL
[4]          0 bytes | NULL
[5]          0 bytes | NULL
[6]      91528 bytes | netsample_strip.elf
[7]          0 bytes | NULL
C:/pspsdk/bin/rm -f netsample_strip.elf

C:\pspsdk\psp\sdk\samples\net\simple>
It builds, I guess you used the update patch. As time goes by it seems that the patch was a terrible idea, it creates more problems than helps, I'll disable it from the download page.

Can you confirm this?
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Flash update:

New SDK 0.8.2 available, latest SVN SDK, GCC 4.3.0 and GDB 6.8.

Removed the 7z patch because it was causing more trouble than helping. I'll move the experimental builds to the history of the SDK builds.

From now on, i'll assume GCC 4.3.0 as "the" compiler version and only keep watching SVN for patches for 4.1.0 and see if they can be merged to the core 4.3.0.

I've noticed that the installers work quite well and the 7z patch doesn't so I'll start making 2 build from now on:
1) the usual installer
2) the trimmed down installer, basically the same as above but without Doxygen Docs (this should reduce the size of the installer in 50%) around 15Mb.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

I guess you used the update patch. As time goes by it seems that the patch was a terrible idea
Nope. I installed the complete version on a clean machine (this time under Vista...don't know if that matters...) and i got similar problems: im not able to compile at all. First i found platform-related missing files; when i provided such files copying them from another release the compiler started saying that other files where missing, while they actually existed in the right folder. Need something more specific to track the issue?
I've been also busy creating a plugin for Eclipse to use directly the SDK without needing to tune anything.
Pleeeeeeeeeeease, NetBeans tooooooooooooooo!!!!...if you're busy and not comfortable with NetBeans, maybe i could help....
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Humm... Vista... I've been to lazy to move from my XP that could be the problem... I'll investigate, i read something about mingw (the windows compiler) and vista... I've to see...

About netbeans, I tryed once the C/C++ dev tools and didn't manage to get it working, if you can make a tutorial or a plugin for it it would be great, I'd add it to the installer
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

ok!
Post Reply