feat(libc): export scriptingGetMem and scriptingFreeMem from application heap #1611
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1611"
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 neuralsin on 2026-10-08T14:31:20Z.
What
Certain titles perform a process-wide lookup for scripting heap entry points at runtime via
dlsym(NULL, "scriptingGetMem")anddlsym(NULL, "scriptingFreeMem")(NIDsayuoL6Vjz2kandyV45DG6ei28). The entry points were not exported.This exports
scriptingGetMem(alignment, size)andscriptingFreeMem(pointer)fromlibc, backed byApplicationHeapAlign_nid_no_patchandApplicationHeapFree_nid_no_patch. The names are the real symbols, so the NID comes from the name and noAPS5_EXPORTalias is needed.Closes #694.
Tested
Linux:
application_heap_tests(asserts the allocator callback gets the size and alignment, and that free reaches it), plus thelibcandlibsctest set (71 tests) on the PR rebased onto currentmain. Windows (MinGW GCC 15.2, Release) run by @popcoder565 reported the duplicate-export failure fixed by dropping the aliases. Not run on a title.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:22:21Z.
Which title calls
scriptingGetMem, and which console library exports it? #694 doesn't name the title, and if the symbol comes from the title's own modules it doesn't belong in libc. Please also fill in the PR template (Tested, AI-assisted).Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:44:45Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
39159bb4, merged ontomaind70b8998in one build with 38 other PRs that had no Windows run.libc.prxfails its NID patch on Windows, so the build stops:scriptingGetMemandscriptingFreeMemareextern "C"and named after the real symbols. The patcher derivesayuoL6Vjz2kandyV45DG6ei28from those names.libc.prxexports both the plain names and theAPS5_EXPORTaliases (ayuoL6Vjz2k_nid_no_patch_cut). Both patch to the same NID.APS5_EXPORTlines (and theExportMacros.hppinclude) fixes it on Windows. The patchedlibc.prxthen exportsayuoL6Vjz2kandyV45DG6ei28. The fourapplication_heap_*tests pass, and so does the full suite in that build (519 of 519). I haven't checked Linux with that change.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:25:37Z.
Review: CHANGES_REQUESTED
Thanks. Changes needed:
libc.prxfails the NID patch withduplicate patched export name: ayuoL6Vjz2k.scriptingGetMem/scriptingFreeMemareextern "C"and already named after the real symbols, so the patcher derives the NID from the plain name; MinGW exports every global, so theAPS5_EXPORTalias (ApplicationHeap.cpp:240,:245) yields the same NID twice. Drop bothAPS5_EXPORTlines and theExportMacros.hppinclude; with that the patchedlibc.prxexportsayuoL6Vjz2k/yV45DG6ei28and the full suite passes on Windows (519/519 in that build). Please confirm on Linux too.scriptingGetMem, and which console library exports it? If it comes from the title's own modules it doesn't belong in libc (see CONTRIBUTING: modules titles ship themselves are not reimplemented). Please answer it in the PR.Tested,AI-assisted).ApplicationHeap.cpp; list it in Depends on if you build on it, and rebase after it lands.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T21:42:25Z.
Progress report (
9f4bd71→39159bb)📈 System libraries: 84.77% (+0.01%, +2 implemented functions)
✅ 2 implemented
scriptingFreeMemscriptingGetMemImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:21:55Z.
Ready to merge from my side, but the PR description fails the conventions check:
Please fill those template lines in (only you can answer AI-assisted); it merges once they pass.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T07:37:20Z.
Closing: the questions from 10-09 are still open (which title calls
scriptingGetMem, and which console library exports it), the Windows build fails on the duplicateayuoL6Vjz2kexport, and the branch conflicts with main. If you decide to continue, please reopen.Pull request closed