Files
rijads 833e1811d9 Cross-build OpenRCT2 v0.5.5 into a PS5 module
Spike for the native PS5 title (PPSA99728). OpenRCT2 with the software renderer compiles and
links into a signed module; nothing has run on the console yet.

- tools/ps5-cc, ps5-c++ and ps5-link: clang 18 for x86_64-sie-ps5, and links that produce real
  PS5 modules (prospero-lld, native-app linker layout, ps5-native-tool), so configure checks see
  what the console offers.
- src/runtime: malloc from a direct-memory mspace, a sandbox-safe opendir family and scandir,
  and the libc functions libc++ and the libraries need that the console's libc lacks.
- tools/build-deps.sh: zlib, libpng, zstd, libzip, Ogg, Vorbis, FLAC, nlohmann/json, ICU 78.3
  (filtered to OpenRCT2's five code pages) and ps5-payload-dev's SDL2, pinned by SHA-256.
- tools/build-host.sh: the Linux build that makes OpenRCT2's data folder.
- patches/openrct2: the PS5 title supplies main.
2026-10-04 18:10:50 +02:00

26 lines
944 B
Bash

#!/bin/sh
# C compiler driver for the PS5 native title: clang 18 with the payload SDK's target flags.
# Links go to tools/ps5-link, so configure checks and CMake see a complete cross toolchain.
root=$(cd -- "$(dirname -- "$0")/.." && pwd)
sdk="$root/.deps/native-app/.deps/native/ps5-payload-sdk"
link=
inputs=
for arg; do
case $arg in
-c | -E | -S | -M | -MM | -dumpversion | -dumpmachine | -print-* | --print-* | -###) link=no ;;
*.o | *.obj | *.a | *.c | *.cc | *.cpp | *.cxx | *.C | *.s | *.S) inputs=1 ;;
esac
done
if [ -z "$link" ] && [ -n "$inputs" ]; then
exec "$root/tools/ps5-link" "$@"
fi
if [ -n "$PS5_CXX" ]; then
set -- clang++-18 -isystem "$sdk/target/include/c++/v1" -frtti -fexceptions "$@"
else
set -- clang-18 "$@"
fi
exec "$@" -target x86_64-sie-ps5 -fvisibility-nodllstorageclass=default -fPIC -isysroot "$sdk" \
-isystem "$sdk/target/include" -fno-stack-protector -fno-plt -femulated-tls