feat(build): add ANYPS5_GUEST_LIFTED to build the libraries for ps5lift #15799
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15799"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oberonlift on 2026-11-04T16:23:53Z.
Merge after #15798. Until the PRs before it merge, this PR also shows their changes; oberonlift/AnyPS5#9 shows only its own.
ps5lift is a static recompiler for PS5 executables: it lifts a game's x86-64 code to LLVM IR and compiles it ahead of time to aarch64, which runs on Linux against AnyPS5's own libraries with no interpreter or JIT. It runs AnyPS5's PS5-style test programs and a homebrew media player to its home screen; commercial games are not playable yet. Branch
ps5lift-previewmerges all of its PRs (how to try it); native Apple Silicon support is coming along fast. It is a separate approach from the ARM64 compiler in #5021; #1835 has an introduction.This is 3 of 8 PRs that let AnyPS5's libraries run a lifted program; the lifter itself follows them.
x86-64: unchanged. The option is off by default, and with it off nothing is compiled differently, apart from a
const_castthat libc'sstd::error_categorycode now takes in every build and that GCC compiles to the same object.What
A build option that compiles the libraries for a guest that ps5lift has recompiled to aarch64.
ANYPS5_GUEST_LIFTEDdefines the macro for every target undercore/libs, so thelibstarget builds all 368 libraries for a lifted guest on an aarch64 host, including those that need generated and configured headers. It needs Linux and Clang; configuring it otherwise stops with an error.GuestCpu.hppgets its lifted half: the helpers callGuestCpu*_nid_no_patchfunctions, which ps5lift's runtime implements on the guest's emulated CPU state, so the fenv functions, the timestamp counter,cpuidandxgetbvsee the guest's FPU and the PS5's CPU.ANYPS5_LIFTED_RUNTIMEnames ps5lift's runtime (#15798), which provides theGuestCpufunctions. libc links it publicly, so every library that links libc gets it.<cfenv>and pick NaN results as x86 does,lrintandllrintraise invalid out of range and inexact when they round, ascvtsd2sidoes, the 16-byte atomics use__atomic_compare_exchange_n, Bessel usesstd::sqrtandstd::fma, and the call-trace thunks and thesetjmp/longjmpassembly are left to the host runtime, which owns the guest registers. Direct builds are unchanged.std::error_categorycode casts a vtable entry away fromconstbefore it reinterprets it in every build, as Apple builds already did; Clang rejects the other form.CMAKE_SYSTEM_PROCESSORinstead of always being the x86-64 one. A processor with no package, and MinGW on arm64, which has none either, stop the configuration.core/libslink the runtime andcore/libs/tests/LiftedEmptyProgram.cpp, which hands it an empty program.ForwardExports.cppout of lifted builds. Its exports are x86jmps to the exports they alias, and a lifted guest reaches an export only through an import bridge generated from its C declaration, which these aliases don't have; the debt file lists the gap.ANYPS5_GUEST_LIFTEDon GitHub's Linux arm64 runner and runs the tests thatps5lift/tests/lifted_tests.txtnames on lavapipe;ps5lift/tools/lifted_tests.pybuilds the files their commands name and runs them with ctest. The list holds the 101 tests whose programs do not link libc.#5021 also changes some of the same files:
JumpBuffer.cpp.Tested
Compiled for x86-64 Linux before and after this PR (GCC 13, same flags): all 154 objects it reaches are byte-identical.
On a DGX Spark (aarch64 Linux, NVIDIA GB10, LLVM 18), with all eight PRs and ps5lift on top: every library builds for a lifted program, 2,285 of AnyPS5's own tests pass in that build on lavapipe, and ps5lift's 69 tests pass, among them its libc, exceptions, kernel, fiber and module-loading fixtures and upstream's libc test programs.
The conventions check passes on this branch.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Pull request closed