Building toolchains: Guessing the proper platform triplet - for game consoles

0

I personally am new to cross-compiling, and so far I have had to use pre-created build scripts that would automatically setup binutils and GCC for me. But those scripts are rather outdated and very old (I was surprised that the PS2 one actually worked...). So, in order to create those toolchains myself and utilize open-source SDKs, I need to get a hand on the platform triplets to pass to the --target= flag.

So far, I know that the architecture is: (maschine)-(vendor)-(os). Therefore, my MacBook returns x86_64-apple-darwin18.0.0 to represent macOS 10.14. But how do I actually obtain the proper triplets for platforms such as Sony PlayStation 3, Nintendo Wii or even some special cases like Nintendo GameBoy or Microsoft XBox 360 or Nokia N-Gage QD (S60)? I know that the 360 is actually a PowerPC, so I probably would need ppc-. But, is that really right?

When you build a cross-compiling toolchain, how do you get the platform triplet to go for? I also only know how to tell GCC to configure for cross-compiling, I haven't figured that out for LLVM Clang, yet.

Ingwie Phoenix

Posted 2018-12-14T02:26:38.373

Reputation: 1 187

"how do you get the platform triplet to go for?" Bad grammar aside, the toolchain prefix should not be that crucial. The build tools I use (e.g. Buildroot) allow specification of the toolchain prefix. So since I can assign the toolchain prefix when I build the toolchain and when I use that toolchain, the actual name of that prefix is not important. If I build a project that does expect a prefix different from what I created, then the makefile can usually be edited to what I have. – sawdust – 2018-12-14T08:40:13.597

@sawdust I am not a native english speaker - I am german. :) Please excuse my occasionally bad grammar here. Well it is not so much about the prefix, that is pretty fine and easy. But if I look at the NGage QD, the CPU is described as "ARM9E". Now that would get me to arm9e-unknown. But is it elf or eabi? What exactly do I need to know to figure this part out? Thank you in advance. :) – Ingwie Phoenix – 2018-12-14T22:32:09.413

Apparently the prefix depends on the architecture. Take a look at https://gcc.gnu.org/install/specific.html for the range of prefixes used by different architectures. "Now that would get me to arm9e-unknown" -- No, just the arch rather than the CPU type is used. "But is it elf or eabi?" -- I've only seen eabi or a variation of it (e.g. gnueabi or eabihf) used with ARM toolchains. So you could use arm-unknown-eabi.

– sawdust – 2018-12-18T22:10:59.843

No answers