Welcome to Obscure Gamers

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

GNU Build Toolchains for 5th Gen

segaloco

Registered
Registered
Joined
Jun 4, 2020
Messages
3
Reaction score
4
Points
3
Location
USA
Website
github.com
AG User Name
segaloco
AG Join Date
20...08?
Hey all, just wanted to share some toolchains I've built for the Saturn, PSX, and N64.

Sega Saturn: https://anonfiles.com/t5u0eb35of/ss-gnu_7z
PSX: https://anonfiles.com/ncw4eb30o9/psx-gnu_7z
N64: https://anonfiles.com/5055e836of/n64-gnu_7z

Contained herein are GNU Binutils and GCC binaries for x86_64 Linux. I've built these with the following targets:

SS: sh-saturn-coff
PSX: mips-psx-ecoff
N64: mips64-n64-elf

I've verified each of these toolchains for binary compatibility with the libraries shipped by each vendor, so you should be able to use the official devkit libraries with these. These are based on binutils version 2.16.1 and gcc 3.6.6. I've made no modifications to the base code, if you need sources these are identical to those that you can find on the GNU ftp. These were the last versions I could find of these packages that supported all three platforms in their original linker formats. If you want to build these yourself on other platforms, simply:
Bash:
./configure --program-prefix=<prefix> --target=<canonical-name> --with-gnu-as --with-gnu-ld

You may need to supply your canonical name as --build= depending on OS and CPU.

Note, I've seen PSX kits ship with both .lib and .a libraries, you'll want the .a variants, these were designed to work with SN systems' tools I believe and provide libraries in ecoff format.

Additionally, you may need to include void __main(void) {} somewhere in your code. GCC implements a process called collect2 that I believe attempts to preload constructors for C++ code. I haven't built a C++ compiler for any of these systems, so this functionality is unnecessary. However, GCC expects this entry point to be exported somewhere, so implementing an empty one works.

You should be able to use your system's version of make with minor modifications to makefiles in the various kits, mainly substituting in the prefixed application names and include paths appropriately. I recommend -nostdinc -nostdlib when compiling, but if you don't use standard includes anyway this may not be necessary. I *highly* recommend storing system includes in the platform-specific directory under your prefix, you never know when you might run into a name conflict with native libraries.

Also, do not use make install on its own to install these, instead:
Bash:
make DESTDIR=/full/path/to/temp/install/folder install

And then install just the bin components to your prefixed bin folder and the platform specific folder into your prefix. Don't copy anything into share, and move includes likewise into the platform-specific prefixed folder. You don't want to risk overwriting shared files with incredibly old versions.

I may do Windows builds of these at some point using mingw, at which point I'll post them here as well. Happy developing!
 

davo123

2020 Donator
2020 Donator
Registered
Joined
Jan 25, 2020
Messages
16
Reaction score
10
Points
3
Oh looks really useful. Thanks for putting this together and look forward to your Windows builds whenever you get to it. :)
 
Top