<div dir="ltr"><div dir="ltr">Hello,<br><br>I'm part of the (sadly fairly small) community of PS2 hackers. The current cross-toolchain for the PS2 is based on GCC 3.2.3, an outdated and buggy compiler, which I have personally gotten tired of working with, so I would like to port Clang as a newer cross-compiler for the PS2.<br><br>However, the PS2 has some notable quirks which make this a non-trivial task for the current compiler. It has two main CPUs, the "Emotion Engine" (EE), which controls the main operating system, and the "I/O Processor" (IOP), which is used for PS1 compatibility and for I/O.<br><br>The EE is based on a custom chip called the R5900, which implements most of MIPS III (except the <font face="monospace, monospace">ll</font><font face="arial, helvetica, sans-serif"> and </font><font face="monospace, monospace">sc</font><font face="arial, helvetica, sans-serif"> instructions, which make little sense on a single-core CPU), as well as some instructions from MIPS IV (</font><font face="monospace, monospace">pref, movz/movn, rsqrt.s</font><font face="arial, helvetica, sans-serif">), and a set of SIMD instructions known as Multimedia Instructions (MMI). It also contains a non-IEEE 754 single-precision FPU (which has provided a lot of headaches). It was later re-used by Toshiba as the TX79, along with a proper FPU.</font><br><br><font face="arial, helvetica, sans-serif">The IOP is based on the MIPS I R3051A, and was also used as the PS1 CPU.</font><br><br><font face="arial, helvetica, sans-serif">I'd like to go through some of the issues I've had so far.</font><br><br><font face="arial, helvetica, sans-serif">I've tried to use `mips64el` as a target, but it would invoke the system GCC with obvious bad results, so I have used the `mips64el-img-linux` target to generate ELF files which the PS2 BIOS can load (is there a better solution to generate bare-metal ELF?).</font><br><br><font face="arial, helvetica, sans-serif">I then tried to compile newlib 3.0.0-20180802, as newlib is used as the standard C library for the PS2, and hit multiple asserts, which I have attached below.<br><br>I don't mind trying to fix these myself, but I would appreciate some pointers.</font></div><div dir="ltr"><div><font face="monospace, monospace"><br></font></div></div></div>