Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

OpenOrbis Toolchain PS4

From GameBrew
Revision as of 03:52, 23 February 2025 by Hyatt (talk | contribs)
OpenOrbis Toolchain
General
AuthorCryptogenic
TypeDevelopments
Version0.5.3
LicenseGPL-3.0
Last Updated2021/12/22
Links
Download
Website
Source

The OpenOrbis PS4 Toolchain is an open-source project designed to facilitate the development of homebrew (unofficial) applications for the PlayStation 4, without relying on Sony’s official SDK. It provides a collection of tools, libraries, and scripts that work together to enable developers to write, compile, and package PS4-compatible applications. Below are the key points that characterize the project:

  1. Purpose
    • Allows developers to create PS4 homebrew software and games.
    • Eliminates the need for proprietary (and often legally restricted) Sony development tools.
  2. Core Components
    • Clang/LLVM-based toolchain for compilation.
    • Libraries and headers tailored for PS4-specific development.
    • Linker and additional utilities designed to generate PS4 executables (self/elf files).
  3. Cross-Platform Support
    • Provides build scripts for multiple platforms, including Linux and Windows (through MSYS2).
    • Aims to streamline the setup process across different operating systems.
  4. Ease of Setup & Usage
    • Automated build scripts help users install and configure the toolchain.
    • Documentation (including a Wiki) offers guidance on how to compile and package homebrew apps.
  5. Active Development & Community
    • Maintained by contributors who continually refine and expand functionality.
    • Encourages community feedback and contributions for improvements.
  6. Open-Source Licensing
    • Distributed under permissive licensing (e.g., MIT or similar), allowing free use and modification.
    • Encourages developers to inspect, modify, and share the toolchain’s source code.

Setup & Installation

For detailed setup and installation instructions, please visit the project's GitHub repository. The maintainers provide step-by-step guidelines to help you install dependencies, configure paths, and get the toolchain up and running on your system of choice.

Changelog

v0.5.3

v0.5.2

  • C++ exception support has been added (thanks Nikita Krapivin)!
  • Added OpenGL/piglet GPU rendering sample + headers (thanks Nikita Krapivin)!
  • Added automated package generation to sample build scripts!
  • Added C++ support for building libraries/PRXs!
  • Added and updated prototypes/types for over 13 PS4-specific headers (thanks 0x199, sleirsgoevy, Nikita Krapivin, OSM, al-azif, bucanero)!
  • Updated build system/scripts for samples and VS project templates to a more clean and convenient system.
  • Fixed an issue where homebrew apps were hard to debug in GDB due to improper .dynamic section (thanks sleirsgoevy)!
  • Fixed more discrepancies between BSD and MUSL headers (thanks sleirsgoevy, al-azif).
  • Fixed an issue where C++ cmath headers failed to use certain namespaces (thanks Nikita Krapivin).
  • Fixed various miscalculation bugs in create-fself.
  • Reworked musl to use libkernel instead of syscalls for compatibility (thanks sleirsgoevy, John Tornblom).
  • Merged create-eboot and create-lib into one tool for ease-of-use.

v0.5.1

  • Fixed various discrepancies between BSD and MUSL including function prototypes, structure definitions, and macros!
  • Added Docker container support (thanks alazif)!
  • Added proper TLS support (thanks sleirsgoevy)!
  • Added a battery of unit tests for issues addressed in v0.5.1. These tests will be kept up to date with future additions to attempt to improve release qualities.
  • Fixed an issue where MUSL was not thread-safe due to custom CRT.
  • Added support '+' and '-' escaping in NIDs (thanks sleirsgoevy).
  • Fixed an issue where relocations could refer to incorrect symbols due to not accounting for an additional SECTION entry (thanks sleirsgoevy).
  • Fixed copy/paste induced bugs in the autobuild.py script (thanks alazif).
  • Fixed a minor issue where the __bswap32 macro in the endian include header produced compiler warnings (thanks astrelsky).

v0.5

  • The toolchain now includes stub/empty libc and libSceFios2 modules to avoid breaking non-homebrew games and applications!
    • Note: This change works in conjunction with Mira, meaning you'll want to update the version of Mira you're loading as well.
    • Additional note: these modules can be found in /bin/data/modules/libc.prx and /bin/data/modules/libSceFios2.prx, and should be placed in sce_module/ in your homebrew's package file.
  • SDL2 headers as well as a mini game sample have now been added (thanks znullptr for the original SDL port)!
  • C++ threading (std::thread) support has been added!
  • C++ locking / synchronization support has been added!
  • Fixed a performance issue in create-eboot, giving it a 7858% performance boost (measured with the SDL sample)!
  • Visual studio project templates now support and link with C++ by default.
  • Added various macros and function definitions to libkernel, libScePad, libSceUserService, and libSceVideoOut, as well as documentation for these additions.
  • Added right.prx by IDC to all samples (thanks IDC for right.prx).
  • Slightly adjusted sample pkg gp4 files to use the same eboot.bin created by build scripts instead of unnecessarily using a copy.
  • Fixed jagged text rendering in /samples/_common/graphics.cpp due to not factoring in the freetype greyscale bitmap alpha properly.
  • Buffering is now disabled on stdout automatically due to it not handling buffering well.
  • Updated pthread header to use PS4/BSD-specific values.
  • Samples now have DWARF / debug symbols included by default (thanks sleirsgoevy).
  • Reworked the threading sample to use std::thread and std::mutex now that C++ threading is supported.
  • Reworked the networking sample to a TCP server instead of a TCP client.
  • Fixed an issue where a really silly FreeBSD change broke any networking functions that need to use the sockaddr struct such as bind.
  • Fixed an issue where GP4 project files were using non-portable windows-style path separators (thanks sleirsgoevy).
  • Fixed an issue where the non-sce sleep() function didn't work due to a MUSL-related issues (thanks LM, ChendoChap).
  • Fixed an issue where SPRX visual studio projects contained a typo in an include statement and an incorrect set of libraries for the build script.
  • Fixed the cmath c++ header, which included using statements for functions that are macros on FreeBSD targets (thanks kiwidog).
  • Fixed an issue where the sockaddr_in structure was incorrect due to a discrepancy between Linux and FreeBSD (thanks kiwidog).
  • Fixed an issue where AF_INET6 was erroneously set to 10 due to a discrepancy between Linux and FreeBSD (thanks sleirsgoevy).

v0.4

  • Added C++ support via include/c++/v1 headers and statically built libcxx.
  • Added support for C++ init_array/fini_array dynamic tags in create-eboot / create-lib.
  • Remade a new fancy windows installer.
  • Created a script to streamline the release creation process.
  • Added initial PS4 library documentation into /docs for libkernel, pad, sysmodule, userservice, and videoout.
  • Common functionality between samples (graphics and logging as well as PNG decoding) have been moved into /samples/_common.
  • Font sample has been rewritten to use C++.
  • Hello world sample has been rewritten to use C++.
  • Input sample has been rewritten to use C++ and now has a visual component to make the sample more obvious in what it does.
  • PNG decoding sample has been rewritten to use C++.
  • System sample has been rewritten to use C++ and now prints to the screen instead of stdout to better demonstrate what it does.
  • Threading sample has been rewritten to use C++ and similar to system sample, now prints to the screen.
  • Fixed an issue where the create-eboot/lib and readelf build scripts were not building for macOS.
  • Fixed a minor typo in readelf which caused DT_INIT_ARRAY_SZ and DT_FINI_ARRAY_SZ tags to be incorrectly identified as DT_INIT_ARRAY and DT_FINI_ARRAY tags.
  • Updated various sample readmes to account for reworked samples.
  • Removed old installer NSIS script.

Known Issues

  • iostream's std::cout does not function properly and will cease to work after one write. For writing to stdout, use the DEBUGLOG macro in samples/_uncommon/log.h. We hope to address this in the future.

v0.3

  • Added MUSL libc support, removed old BSD headers, and reworked samples to use MUSL.
  • Added libraries sources for Continuous Integration (CI).
  • Added debugging info via section header table into OELFs via create-eboot.
  • Fixed an issue in create-eboot where NIDs were written for local symbols when they shouldn't be.
  • Fixed an issue where drawPixel() in the font, graphics, and pngdec samples were not inlined, causing performance slowdown (thanks m0rph3us1987).
  • Added interpreter string write to linker script and removed it from create-eboot.
  • Removed condition from create-eboot where requiring a .got.plt section was only checked for SPRX libraries and not SELF eboots; all binaries need this section.
  • Removed sample package files to reduce bloat. They will later be available as separate releases.
  • Disabled buffering on stdout on various samples for MUSL.

v0.2

  • Added macOS support (thanks Lord Friky).
  • Added package file sources for samples to make deploying samples easier, and to better demonstrate how packages should be constructed.
  • Fixed an issue where create-lib did not properly export NIDs and therefore dynamic resolving would fail (thanks IDC).
  • Fixed an issue where create-eboot/create-lib would occasionally calculate an incorrect data program size due to not accounting for the size of the .sce_proc_param section (thanks IDC).
  • Fixed an issue where create-eboot/create-lib would occasionally calculate an incorrect size of the string table due to an off by one via a subtle logic bug related to section padding (thanks IDC).
  • Fixed an issue where libraries would not have their Global Offset Table (GOT) / Procedure Linkage Table (PLT) aligned if no .data.rel.ro section was present (thanks IDC).
  • Added a build script for create-eboot/create-lib for Windows (thanks IDC).
  • Fixed an issue where the __GNUC__ fix was being applied even if it was already defined, causing the compiler to complain if you manually defined it via compiler flags (thanks IDC).
  • Added include/x86 directory for systems that don't have it.
  • Fixed an issue where even if there was no GOT/PLT, the PS4 would complain on libraries because it needs it for some silly reason. .got.plt is now forced into the build, even if there are no PLT entries (thanks IDC).

v0.1.1

  • Fixes issue #6 where samples would fail to build on clang 10.0+. Credit to IDC, frangarcj for help root causing the issue, 1UP, and Tustin for initial reports.
  • Fixes issue #7 where makefiles were not creating intermediate directories and would thus fail on build.
  • Fixes issue #8 where the setup-*.sh scripts in /extra had CRLF line endings, causing errors when attempting to run the scripts.

v0.1 BETA The first public BETA release of the OpenOrbis PS4 Toolchain. Attached is a copy of the release zip with binaries, as well as a windows NSIS installer for convenience.

Credits + Special Thanks

  • Specter: Create-eboot/lib relinker, miralib, assistant suite, readelf, samples and documentation
  • CrazyVoid: Stub generator, headers, samples and documentation
  • maxton: Create-pkg pkg and SFO generation tools
  • Kiwidog: Mira, assistance, documentation
  • IDC: Lots of help with libraries and other bug fixes
  • flatz: Homebrew research and writeups, SELF reversing and documentation
  • m0rph3us1987: Help with debugging stuff
  • bigboss / psxdev: Library research and reverse engineering, used for reference by various samples
  • John Tormblom: Build system prototyping
  • LightningMods / LM: Testing via APP_HOME and lib loading help on the Mira side
  • Lord Friky: Proper macOS support
  • sleirsgoevy: Bug fixes and support, various samples
  • ChendoChap: Bug fixes and support
  • astrelsky: Bug fixes and support
  • Nikita Krapivin: C++ exception support, openGL/piglet work
  • MrSlick: Awesome logo <3
  • OpenOrbis Team
  • Other anonymous contributors

External links

Advertising: