Repository navigation
feat(libc): read guest va_lists portably in lifted builds - #11
Open
oberonlift wants to merge 4 commits into
Open
oberonlift wants to merge 4 commits into
oberonlift wants to merge 4 commits into
Conversation
12 tasks done
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 1, 2026 19:35
5ee5806 to
7c87f5a
Compare
oberonlift
force-pushed
the
lifted-libc-va-list
branch
from
November 1, 2026 19:35
d040a96 to
007ac0e
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 1, 2026 22:07
7c87f5a to
d91f0c5
Compare
oberonlift
force-pushed
the
lifted-libc-va-list
branch
2 times, most recently
from
November 2, 2026 17:02
18527d4 to
c8cd394
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
2 times, most recently
from
November 2, 2026 18:30
7ba4609 to
f98143b
Compare
oberonlift
force-pushed
the
lifted-libc-va-list
branch
from
November 2, 2026 18:30
c8cd394 to
a7df5d7
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 2, 2026 22:07
f98143b to
60cb2c7
Compare
oberonlift
force-pushed
the
lifted-libc-va-list
branch
2 times, most recently
from
November 3, 2026 16:34
24d0f1d to
ca2b1c4
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 3, 2026 16:34
60cb2c7 to
6a4e3b7
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-libc-va-list
branch
2 times, most recently
from
November 4, 2026 16:20
9ec5a9d to
63dc196
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-va-list
branch
2 times, most recently
from
November 4, 2026 20:18
48afcc4 to
9cc882f
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
2 times, most recently
from
November 5, 2026 01:21
ba34115 to
56040c8
Compare
oberonlift
force-pushed
the
lifted-libc-va-list
branch
4 times, most recently
from
November 6, 2026 00:18
915b304 to
a0fa69d
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 6, 2026 00:18
1da9fef to
2fa99de
Compare
oberonlift
force-pushed
the
lifted-libc-va-list
branch
from
November 6, 2026 15:35
a0fa69d to
d5241b5
Compare
oberonlift
force-pushed
the
lifted-libc-exceptions
branch
from
November 6, 2026 15:35
2fa99de to
98e0f9a
Compare
In a lifted build every VaList is a SysV va_list built by the guest or by a bridge, so the libc formats and scans through FormatArguments and its in-process scanner instead of the host's vprintf and vsscanf. The libc's own variadic functions wrap the host va_list in a tagged VaList through the shared APS5_VA_BEGIN macro, which the formatting and scanning tests now use as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A report handler is guest code, which reads the call's arguments through the x86-64 SysV va_list in the report. The dispatcher copied its own host va_list there, which is that layout only on an x86-64 host, so a lifted build for aarch64 did not compile. In lifted builds the report now carries a SysV va_list built around the call's values: the named parameters fill every integer register, so the values are its overflow area, behind an empty register save area. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… builds sceAudioPropagationReportApi hands its report handlers the call's own va_list, which is the x86-64 SysV one the guest handler reads only on an x86-64 host; a lifted build for aarch64 did not compile. In lifted builds a host caller now stops as not implemented. Guest calls already stop at the bridge, which has no free integer register and no va_list sibling to forward them through. The library's test leaves out its report checks, which read the report's va_list as the host's, in lifted builds and checks the rejection instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oberonlift
force-pushed
the
lifted-libc-va-list
branch
from
November 6, 2026 17:39
d5241b5 to
f123e03
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#15801; this copy follows it.
Merge after #10. Until the PRs before it merge, this PR also shows their changes; #11 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 boykopovar#5021; boykopovar#1835 has an introduction.This is 5 of 8 PRs that let AnyPS5's libraries run a lifted program; the lifter itself follows them.
x86-64: behaviour unchanged. The shared
APS5_VA_BEGINmacro expands to the code it replaces, Audio3d's delivery loop moved into a helper, and the host-list handling inFormatArgumentsand the AudioPropagation change are compiled only in lifted builds.What
VaListis a SysVva_listbuilt by the guest or by a bridge, so libc formats and scans throughFormatArgumentsand its in-process scanner instead of the host'svprintfandvsscanf.va_listin a taggedVaListthrough the sharedAPS5_VA_BEGINmacro, which libSceLibcInternal'serrandwarnand the formatting and scanning tests now use as well.va_listbuilt around the call's values. It copied its own hostva_list, which has that layout only on an x86-64 host.sceAudioPropagationReportApi, which copies its own hostva_listinto the report, stops as not implemented when host code calls it; guest calls stop at the bridge. The debt file lists it, and the library's test checks the rejection in lifted builds in place of its report checks, which read the report'sva_listas the host's.vasprintfformats throughFormatWindows, as Windows builds do, so it reads only the guest's 24-byteVaList; andprintf_sorients stdout for bytes, as the other builds'printf_sdoes.boykopovar#5021 also changes some of the same files:
Formatting.cpp,WindowsFormatting.hpp.Tested
Compiled for x86-64 Linux before and after this PR (GCC 13, same flags): 16 of the 19 objects it reaches on both sides are byte-identical; the other three are libSceAudio3d's
Export.cpp, whose delivery loop moved into a helper, and the two libc tests that gained checks. AudioPropagation'sExport.cppand test 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,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