PS3 Compiling open-source PS3 toolchain nowadays (in 2020)

ok thanks @bucanero i will try cygwin, Blckbear isnt that basically the same as using a VM to run ubuntu ? its not a real windows build
Yep, it's not a real Windows build but because of WSL it's pretty close to running it on real Ubuntu. At first I also tried with MSYS and cygwin but I have up and used WSL.
For me, I it gave the same functionality as I can call Ubuntu on whatever folder I'm at and work with Ubuntu on my Windows folders, so it is a pretty seamless integration.
 
Thanks guys, im running it on Cygwin now and its already gotten a lot further then MinGW (Msys1+2) but going to take a few hours from the slow rate this is going,
Yeah blckbear i can see how that could be useful, i use VM's and i have a linux laptop i use instead which all work quite well with this, i was just trying to do a windows build.
 
Thanks guys, im running it on Cygwin now and its already gotten a lot further then MinGW (Msys1+2) but going to take a few hours from the slow rate this is going,
Yeah blckbear i can see how that could be useful, i use VM's and i have a linux laptop i use instead which all work quite well with this, i was just trying to do a windows build.

This could be usefull for cygwin build...
 
ok @Crystal looking at that post i just edited the SCRIPTS files for binutils and changed the line
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" \
to
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" --build=x86_64-pc-linux-gnu \
and now it works in MinGW (so far but still compiling) so thank you @Crystal and @Omage i will let you know how it goes (if it fails later or completes)
 
ok @Crystal looking at that post i just edited the SCRIPTS files for binutils and changed the line
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" \
to
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" --build=x86_64-pc-linux-gnu \
and now it works in MinGW (so far but still compiling) so thank you @Crystal and @Omage i will let you know how it goes (if it fails later or completes)

Probably you have to change more scripts...
 
Yeah i have had to add that line to each of the scripts so far that have a configure line, and so far its building nicely (but VERY slowly)
Also Cygwin is going fine too, got to PSL1GHT so far then failed due to not having UNZIP and RHASH (@bucanero maybe these needed to be added to the requirements ?) so after grabbing those PSL1GHT is working so far and going to see how it goes
 
Last edited:
Yeah i have had to add that line to each of the scripts so far that have a configure line, and so far its building nicely (but VERY slowly)
Also Cygwin is going fine too, got to PSL1GHT so far then failed due to not having UNZIP and RHASH (@bucanero maybe these needed to be added to the requirements ?) so after grabbing those PSL1GHT is working so far and going to see how it goes

Using MSYS2 + MINGW64 i got:
../../binutils/rename.c:93:1: error: conflicting types for 'set_times'
93 | set_times (const char *destination, const struct stat *statbuf)
| ^~~~~~~~~
In file included from ../../binutils/rename.c:23:
../../binutils/bucomm.h:70:13: note: previous declaration of 'set_times' was here
70 | extern void set_times (const char *, const struct stat *);

on 001-binutils-PPU.sh
 
thats the error i get before i put changed the script to
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" --build=x86_64-pc-linux-gnu \
make sure to delete your build folder before you start since it may not reconfigure it correctly (i started with a fresh toolchain when i edited the scripts)

Also a update, Cygwin compiled PSL1GHT ok after the previous problems where sorted, then it stoped at

Code:
Build library...
  CC    aes.c
In file included from aes.c:31:0:
../include/mbedtls/config.h:117:1: error: stray '\' in program
 \n#include "check_config.h"\n
 ^
../include/mbedtls/config.h:117:3: error: stray '#' in program
 \n#include "check_config.h"\n
   ^
../include/mbedtls/config.h:117:2: error: unknown type name 'n'
 \n#include "check_config.h"\n
  ^
../include/mbedtls/config.h:117:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
 \n#include "check_config.h"\n
            ^~~~~~~~~~~~~~~~
../include/mbedtls/config.h:117:28: error: stray '\' in program
 \n#include "check_config.h"\n
                            ^
make: *** [Makefile:195: aes.o] Error 1
../scripts/028-mbedTLS-2.16.6.sh: Failed.
../scripts/009-ps3libraries.sh: Failed.
this seemed to be caused in "028-mbedTLS-2.16.6.sh" on the line
echo "\n#include \"check_config.h\"\n" >> ../include/mbedtls/config.h
if i remove the \n before and after it will compile fine, i now have the newest toolchain in Cygwin

With Msys2 Mingw64 i have managed to get to ps3libraries with a few problems in PSL1GHT, the MAKEFILES at
psl1ght/tools/fself
psl1ght/tools/cgcomp
psl1ght/tools/sprxlinker
all have the line " -mno-cygwin"
which makes Mingw stop with a error, removing those from those make files seems to fix the problem.

And now im stuck at PS3LIBRARIES, keeps giving errors

Code:
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Rev4, Built by MSYS2 project)
configure:3102: $? = 0
configure:3091: gcc -V >&5
gcc.exe: error: unrecognized command-line option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3102: $? = 1
configure:3091: gcc -qversion >&5
gcc.exe: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc.exe: fatal error: no input files
compilation terminated.
configure:3102: $? = 1
configure:3122: checking whether the C compiler works
configure:3144: gcc -I/usr/local/ps3dev/ppu/include -I/usr/local/ps3dev/portlibs/ppu/include  -L/usr/local/ps3dev/ppu/lib -L/usr/local/ps3dev/portlibs/ppu/lib -lrt -llv2 conftest.c  >&5
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib\librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/liblv2.a when searching for -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib\liblv2.a when searching for -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/liblv2.a when searching for -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/liblv2.a when searching for -llv2
collect2.exe: error: ld returned 1 exit status
configure:3148: $? = 1
 
You downloaded
thats the error i get before i put changed the script to
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" --build=x86_64-pc-linux-gnu \
make sure to delete your build folder before you start since it may not reconfigure it correctly (i started with a fresh toolchain when i edited the scripts)

Also a update, Cygwin compiled PSL1GHT ok after the previous problems where sorted, then it stoped at

Code:
Build library...
  CC    aes.c
In file included from aes.c:31:0:
../include/mbedtls/config.h:117:1: error: stray '\' in program
 \n#include "check_config.h"\n
 ^
../include/mbedtls/config.h:117:3: error: stray '#' in program
 \n#include "check_config.h"\n
   ^
../include/mbedtls/config.h:117:2: error: unknown type name 'n'
 \n#include "check_config.h"\n
  ^
../include/mbedtls/config.h:117:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
 \n#include "check_config.h"\n
            ^~~~~~~~~~~~~~~~
../include/mbedtls/config.h:117:28: error: stray '\' in program
 \n#include "check_config.h"\n
                            ^
make: *** [Makefile:195: aes.o] Error 1
../scripts/028-mbedTLS-2.16.6.sh: Failed.
../scripts/009-ps3libraries.sh: Failed.
this seemed to be caused in "028-mbedTLS-2.16.6.sh" on the line
echo "\n#include \"check_config.h\"\n" >> ../include/mbedtls/config.h
if i remove the \n before and after it will compile fine, i now have the newest toolchain in Cygwin

With Msys2 Mingw64 i have managed to get to ps3libraries with a few problems in PSL1GHT, the MAKEFILES at
psl1ght/tools/fself
psl1ght/tools/cgcomp
psl1ght/tools/sprxlinker
all have the line " -mno-cygwin"
which makes Mingw stop with a error, removing those from those make files seems to fix the problem.

And now im stuck at PS3LIBRARIES, keeps giving errors

Code:
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Rev4, Built by MSYS2 project)
configure:3102: $? = 0
configure:3091: gcc -V >&5
gcc.exe: error: unrecognized command-line option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3102: $? = 1
configure:3091: gcc -qversion >&5
gcc.exe: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc.exe: fatal error: no input files
compilation terminated.
configure:3102: $? = 1
configure:3122: checking whether the C compiler works
configure:3144: gcc -I/usr/local/ps3dev/ppu/include -I/usr/local/ps3dev/portlibs/ppu/include  -L/usr/local/ps3dev/ppu/lib -L/usr/local/ps3dev/portlibs/ppu/lib -lrt -llv2 conftest.c  >&5
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib\librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/librt.a when searching for -lrt
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/liblv2.a when searching for -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib\liblv2.a when searching for -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/liblv2.a when searching for -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llv2
C:/MSYS64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/MSYS64/usr/local/ps3dev/ppu/lib/liblv2.a when searching for -llv2
collect2.exe: error: ld returned 1 exit status
configure:3148: $? = 1

You downloaded develop version of ps3libraries.... switch to master branch, it's the official and well tested. Scripts are up to 022-libjson.sh.
 
Thanks Crystal that did help with a few that i could not build correctly, so i finally managed to build everything in the MSYS2/MINGW64 and i got it to generate ELF files but in RPCS3 all of them give VM memory errors, this doesn't happen when i compile in Linux so im guessing something is wrong with it (havent tried them on my actual ps3 yet but im not hopefull), which is a shame but not totally unexpected, going to try building some samples and programs in Cygwin next to see if they work correctly.
 
Thanks Crystal that did help with a few that i could not build correctly, so i finally managed to build everything in the MSYS2/MINGW64 and i got it to generate ELF files but in RPCS3 all of them give VM memory errors, this doesn't happen when i compile in Linux so im guessing something is wrong with it (havent tried them on my actual ps3 yet but im not hopefull), which is a shame but not totally unexpected, going to try building some samples and programs in Cygwin next to see if they work correctly.

There is no way to execute ELF files builded with windows compiled PSL1GHT on RPCS3. It's a mistery.
Enyway that is irrilevant because you can execute equivalent SELF files.
 
Ok well i tried my SELF's made in MSYS2/MINGW64 on RPCS3 and on my PS3 and both just crash, the Cygwin made SELF's run fine on both RPCS3 and the PS3 so i guess i will be sticking with cygwin for now.
 
Ok well i tried my SELF's made in MSYS2/MINGW64 on RPCS3 and on my PS3 and both just crash, the Cygwin made SELF's run fine on both RPCS3 and the PS3 so i guess i will be sticking with cygwin for now.

Do you compiled ps3toolchain using MINGW32 shell or MINGW64 shell?
Becosee many configures and sources check __MINGW32__ system variable and not __MINGW64__
 
ok started fresh install of msys2 and ps3toolchain, i started in mingw32 but binutils and gcc wouldn't compile in x86 so i had to use mingw64 upto psl1ght then switched to mingw32 for psl1ght and ps3libraries and that went well, but im still getting errors on all elf/selfs i make, both on rpcs3 and on ps3, im guessing it just doesn't like mingw or im doing something wrong or maybe binutils and gcc also need to be compiled in mingw32 but that seems impossible (well i can't figure it out, im sure its actually possible)
 
ok narrowed down the problem, it seems to be cgcomp on MINGW64, i built a old version of psl1ght and it worked great but you cannot use the old version with the new files (i tried and it just corrupts every elf/self made), The latest version of CGCOMP gives segmentation fault
Annotation 2020-10-17 205933.png

If i run it without any input it doesnt do that but what is the point in the program if it can't take input/output ?
Cygwin doesn't have this problem, at first i thought it was a GCC error so i tried compiling the EXE on GCC 9.3.0 and same problem, so i went back further to GCC 7.5.0 and still there, the only versions that work are the version pre JULY 2020 (versions from June compile and work fine but corrupt ELF/SELF when combined with newer PSL1GHT files.
 

Similar threads

Back
Top