Repository navigation
feat(libc): unwind guest frames and keep the host's exception runtime in lifted builds - #10
Open
oberonlift wants to merge 3 commits into
Open
oberonlift wants to merge 3 commits into
oberonlift wants to merge 3 commits into
Conversation
12 tasks done
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
3 times, most recently
from
November 2, 2026 17:02
d91f0c5 to
7ba4609
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 2, 2026 17:02
05609b5 to
971055a
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 2, 2026 18:30
7ba4609 to
f98143b
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
2 times, most recently
from
November 2, 2026 22:07
7127627 to
dcc7de1
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
2 times, most recently
from
November 3, 2026 16:34
60cb2c7 to
6a4e3b7
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 3, 2026 16:34
dcc7de1 to
5700e07
Compare
Owner
Author
Review findings (unverified)Code review of
|
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 4, 2026 15:40
6a4e3b7 to
f0a368b
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 4, 2026 15:40
5700e07 to
d956b58
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 4, 2026 16:20
d956b58 to
39a6b84
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 4, 2026 16:20
f0a368b to
23da0d9
Compare
12 tasks done
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 4, 2026 20:18
23da0d9 to
ba34115
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 5, 2026 01:21
19e1243 to
a14472a
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 5, 2026 01:21
ba34115 to
56040c8
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 5, 2026 15:34
a14472a to
28f9dbb
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 5, 2026 15:34
56040c8 to
09961d7
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 5, 2026 19:28
28f9dbb to
9634bbe
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
2 times, most recently
from
November 6, 2026 00:18
1da9fef to
2fa99de
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
2 times, most recently
from
November 6, 2026 15:35
1988618 to
c7d8a9b
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 6, 2026 15:35
2fa99de to
98e0f9a
Compare
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 6, 2026 17:39
c7d8a9b to
da948de
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 6, 2026 17:39
98e0f9a to
44e9092
Compare
In a lifted build the DWARF unwinder starts from the guest frame that called the import, finds frames through the unwind tables of the guest images, which dl_iterate_phdr lists through the program's GuestCpuIterateImages, resolves the personality routine from its import name and installs a landing pad by handing its registers back to the guest CPU, through new GuestCpu functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In an ANYPS5_GUEST_LIFTED build the guest images are not host shared objects, so glibc's dl_iterate_phdr cannot see them: the application heap never found the executable's process parameters. Every caller now includes ElfTypes.hpp instead of <link.h>, which in a lifted build lists the program's guest images through GuestCpuIterateImages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lifted build keeps the host's C++ runtime, but with libstdc++ the libc still defined std::current_exception, std::rethrow_exception and exception_ptr's members over its own runtime. Host code that caught an exception then got a null exception_ptr from the runtime that had not thrown it: the AGC driver reported a failed compute dispatch as "null asynchronous failure" and terminated. Lifted builds now give the guest its own exception pointer type, as libc++ builds do, and leave the host's exception pointers to the host runtime. The guest's _Result_base destructor export releases the guest pointer in place. Lifted builds also stop exporting the host ABI's names: Exports.cpp's __cxa_* and _Unwind_* aliases and Personality.cpp's global __gxx_personality_v0. A lifted executable loads libc before libstdc++ and libgcc_s, so the host's own throws bound to libc's versions and aborted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oberonlift
force-pushed
the
lifted-build-switch
branch
from
November 6, 2026 20:43
da948de to
b4880be
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 6, 2026 20:43
44e9092 to
41c7aed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Open on AnyPS5 as boykopovar#15800; this copy follows it.
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 boykopovar#5021; boykopovar#1835 has an introduction.This is 4 of 8 PRs that let AnyPS5's libraries run a lifted program; the lifter itself follows them.
x86-64: unchanged: the code compiles to the same objects. The new
host_exception_pointertest builds and runs in every build; in CI's lifted build it runs from the last PR of the series on, since libc first compiles for a lifted guest there.What
GuestCpufunctions.ElfTypes.hppredirectsdl_iterate_phdrto the runtime'sGuestCpuIterateImages, which lists the guest images. libc and libkernel includeElfTypes.hppinstead of<link.h>where they walk images (the unwinder, the application heap's process parameters, direct memory, module info and the AGC driver's guest memory), so each of them sees the guest images.Exports.cpp's__cxa_*and_Unwind_*aliases andPersonality.cpp's global__gxx_personality_v0. A lifted executable loads libc before libstdc++ and libgcc_s, so the host's ownthrowbound to libc's versions and aborted.std::current_exception,std::rethrow_exceptionandexception_ptr's members over its own runtime. Host code that caught an exception then got a nullexception_ptr: the AGC driver reported a failed compute dispatch as "null asynchronous failure" and terminated. Lifted builds now give the guest its own exception pointer type, as libc++ builds do, and leave the host's exception pointers to the host runtime;HostExceptionPointertests it. The guest's_Result_basedestructor export releases the guest pointer in place.boykopovar#5021 also changes some of the same files:
GuestMemory.cpp,GuestAllocations.cpp,DirectMemory.cpp,ModuleInfo.cpp.Tested
Compiled for x86-64 Linux before and after this PR (GCC 13, same flags): all 217 objects it reaches are byte-identical; the new
host_exception_pointertest builds after it only.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,288 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