refactor(libs): add full export headers for libs #10706
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10706"
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 boykopovar on 2026-10-24T18:34:04Z.
What
Added umbrella headers for 368 libraries and canonical declarations for exported functions (suitable for writing homebrew apps compatible with our libs, which means they are also compatible with PS5 libraries). Removed duplicate declarations and types from sources and tests. Added the Python
public_headerstest and the corresponding CONTRIBUTING rule.Tested
Windows: new
public_headerspassed for 368 libraries and 12,168 exports. Checked declaration uniqueness, umbrella coverage and standalone header compilation.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T18:39:59Z.
Review: CHANGES_REQUESTED
Reviewed head
fed4f8c59d335f3e145ccfc3ab4eb3cecbc56ec7against currentmain(0ea0f25e1bfbf63e90bc28a3ca1bc4cd2a3972f6). The current Conventions check fails on a concrete duplicate export:sceMsgDialogGetResultis implemented/exported in bothlibSceMsgDialog/Export.cppandlibSceMsgDialog.native/Export.cpp. I reproduced that exact finding with the repository checker. Please resolve the duplicate according to the checker guidance (remove the duplicate export, or useAPS5_DUMMY_FUNif no implementation remains). The branch also does not merge cleanly with current main: merge-tree reports conflicts incore/libs/prx/libSceAudioOut/tests/AudioOut2DeviceState.cpp,core/libs/prx/libc/src/Math.cpp, andcore/libs/tests/GuestLocale.cpp; please rebase/resolve those and rerun conventions.git diff --checkpasses. Hosted intake and labels pass; both recent hosted Conventions runs fail on the duplicate. The full build/test jobs have not run, so I have not treated the Windows header test described in the PR as hosted validation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T19:07:07Z.
Review: COMMENTED
Follow-up on updated head c346adce8874ed8cefe10bdab8c599890dd2c1bf: the duplicate
sceMsgDialogGetResultis now removed and the conventions check passes. The merge state is still DIRTY only inAudioOut2DeviceState.cpp; I checked the newAudioOut2.hpp/AudioOut.hppin this branch and they contain the two declarations (sceAudioOut2InitializeandsceAudioOutInit) added on main, so resolving the conflict by keeping the canonical-header include should preserve those APIs. Please rebase/resolve that final conflict and rerun the header test on the updated head. One signature coordination remains: this branch keepssceCompanionUtilGetEvent()parameterless because the native body does not reveal an argument, while open #10705 declaresvoid*from a PS4-derived prototype. Please align that canonical declaration with the maintainer-selected source before merge, or document an explicit decision to retain the conservative signature.Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-10-24T19:40:39Z.
Review: COMMENTED
Built against macOS and Linux, since the PR was tested on Windows only. I compiled every
.cppundercore/libswith-fsyntax-only, once on this branch and once on its basec035bd5b70, with the same flags each time. The counts below are files that compile on the base and fail on the branch. I measured onfed4f8c59d, so the counts are from that head. I then re-checked each point on the rebased headf57552b4aa: all of them still apply except item 3 under Linux, which that head fixes.Linux: GCC 14 (
gcc:14image, x86-64)22 files that compile on the base fail on this branch. Seven of them are
libcandlibkernelsources, so those two libraries no longer build on Linux:sigreturn.libkernel/include/Api.hpp:169declaresint APS5_VABI sigreturn();, which conflicts with glibc'sint sigreturn(struct sigcontext*)in<signal.h>. Before, it was declared only inlibkernel/Unimplemented.cpp. This breaksPthread/src/Thread.cpp,System/src/Exception.cpp,System/src/Signals.cppand 13 tests (GuestSignals,GuestItimer,GuestKill,GuestSslTransport, ...).ElfTypes.hpp.libc/include/Api.hppandlibkernel/include/Api.hppincludespecifics/linux/ElfTypes.hppunconditionally. On Linux, the files that also include the real<elf.h>and<link.h>now see conflicting declarations (typedef struct Elf64_Phdr, a redefinition ofdl_phdr_info). This breaksModule/src/ModuleInfo.cpp,System/src/Rtld.cppandTime/Time.cpp.strerror_r_nid_postfix(fixed inf57552b4aa, which declares it inlibc/include/Api.hpp:202).libc/src/Syslog.cpp:54lost its local declaration of the function. The function is now declared only inWindowsFormatting.hpp, whichSyslog.cppincludes under_WIN32, so outside Windows it is undeclared.GuestFopenErrors.cpp(if(UNIX)) passes avoid*wherefopen_s_nid_postfixnow takesFileStream*.SharedWrites.cpp:250converts avoid*touint64_t.GuestAmprThreads.cpp:496, in the#ifndef _WIN32block, usestype->nameas a field of what is now astd::type_info*.macOS: Apple clang 21.0.0, libc++, x86-64 (macOS 27.0.1)
292 files that compile on the base fail on this branch.
288 of them come from one block,
libc/include/Api.hpp:1094-1101(1095-1102onf57552b4aa, still unguarded). It declares the libstdc++-specific exports (_ZNSt13__future_base12_Result_baseD2Evwithstd::__future_base::_Result_base*,exception_ptr::_M_addrefand the others withstd::exception_ptr*). Onmainthese exist only under#ifndef _LIBCPP_VERSIONinExceptionPointer.cpp. Its libc++ branch defines the same symbols with aGuestExceptionPointer*, because the guest'sexception_ptrlayout is not libc++'s.With that block wrapped in
#ifndef _LIBCPP_VERSION, 287 of the 292 compile again. The other five are:Syslog.cpp,GuestFopenErrors.cppandGuestAmprThreads.cpp: the same errors as on Linux.GuestGenericCategory.cpp:64: areinterpret_castfromconst void*to a function pointer, which clang rejects as casting away qualifiers.libSceVideoOut/tests/OutputModePolicy.cpp:19: it now needs#include <initializer_list>, which libc++ doesn't pull in transitively.public_headerson macOSThe audit part passes: 368 libraries, 689 headers and 12168 exports with unique declarations and full umbrella coverage. The standalone header compilation fails on 19 headers, for three reasons:
Api.hppblock above.-Werrorturns clang's-Wreturn-type-c-linkageinto errors for 13extern "C"declarations that return C++ types: the sixstd::filesystem::pathandstd::vectorones inGeneral.hpp(already onmain), fiveHmd2::SizeAlignones inHmd2.hpp, one inEqueue.hppand_ZSt17current_exceptionv_nid_postfixinApi.hpp. GCC has no such warning, so this would also fail on Linux with clang.CMAKE_CXX_COMPILERto--compiler. On an Apple Silicon Mac that compiler targets arm64 unless given-arch x86_64(CMAKE_OSX_ARCHITECTURESin the build), soWindowsFormatting.hpp:354-355also fails itsstatic_asserts there.Method: the macOS run uses each file's command from a
-DCMAKE_OSX_ARCHITECTURES=x86_64build. The Linux run usesg++ -std=gnu++20 -fsyntax-onlywith the project's include paths, without the build's generated headers or definitions. The same flags on the base are the control: 1881 of 2073 files compile there and 1859 on this branch, and no file fails on the base and compiles on this branch. I can re-run both on a new head.AI-assisted: yes