Commit Graph
648 Commits
Author SHA1 Message Date
Adrià 280bbad426 Merge pull request #12659 from JJenkx/codex/libc-scaled-nan-subject-20261028
fix(libc): parse scaled NaN subjects without numeric conversion
2026-10-30 13:45:37 +01:00
Adrià 8304ccaedb Merge pull request #11341 from SteelCrab/review/emscripten-libraries
build(libs): support Emscripten memory64 compilation
2026-10-30 12:49:20 +01:00
Adrià 0362b1521c Merge pull request #12861 from heditrigui/feat/libc-recallocarray
feat(libc): implement recallocarray
2026-10-30 06:36:10 +01:00
Adrià 0a2cda921d Merge pull request #12933 from heditrigui/feat/libc-dprintf
feat(libc): implement dprintf and vdprintf
2026-10-30 06:33:00 +01:00
Adrià 84368bddb2 Merge pull request #12160 from AlexFigas/feat/libc-pmr-resources
feat(libc): provide the pmr new-delete, null and default memory resources
2026-10-30 06:30:55 +01:00
Adrià 902c6ebfe9 Merge pull request #12111 from wanderingbug/cursor/upstream-macos-unwind-e22f
fix(libc): walk the Mach-O compact unwind index
2026-10-30 05:52:53 +01:00
Adrià b48afc66fb Merge pull request #12845 from heditrigui/feat/libc-qsort-r
feat(libc): implement qsort_r
2026-10-30 05:52:07 +01:00
Adrià 84e114e4eb Merge pull request #12715 from MarcZX10/feat/log-to-file
feat(libc): copy the runtime log into a file with ANYPS5_LOG_FILE
2026-10-30 05:51:34 +01:00
JJenkx 58fddd82c6 fix: integrate current main into PR #12659 2026-10-29 23:20:02 -04:00
pista d64e85164b build(libs): let the system libraries compile with Emscripten
Emscripten targets wasm64 without x86 assembly, Linux-only headers or the
x87 long double. These changes add __EMSCRIPTEN__ paths beside the host
ones; native builds compile the same code as before.

- libc: long doubles in guest varargs and scanf go through
  GuestLongDouble, a plain copy where long double is the x87 format;
  APS5_EXPORT emits no assembler alias; the guest arena is one aligned
  allocation that zeroes pages when they are committed again; getifaddrs
  keeps its link-level entries on Linux; /proc lookups and the host
  stderr duplicate are left out.
- libkernel: file-backed mmap, EVFILT_VNODE watches, getcontext and
  setcontext throw; getdents replaces the raw getdents64 syscall;
  getdtablesize takes the resource limit alone.
- VideoOut leaves SDL, the display window and the HDR probe out,
  Sysmodule asks libkernel for unwind information and Net includes
  sys/time.h.
2026-10-30 10:50:57 +09:00
Adrià 5e216d6aed Merge pull request #10927 from edubox/feat/libc-throw-bad-array-new-length
feat(libc): implement std::_Throw(const std::bad_array_new_length&)
2026-10-30 00:18:44 +01:00
Adrià 034e5a015a Merge pull request #11450 from edubox/feat/libc-sce-v2-locinfo
feat(libc): export std::__sce_v2::_Locinfo
2026-10-29 23:37:12 +01:00
Adrià 5c331df35d Merge pull request #12227 from klosixgaming-arch/perf/evict-skip-unwritten-pages
perf(libc): skip never-written pages when evicting a resident direct-memory run
2026-10-29 23:01:14 +01:00
Adrià d9f6887afb Merge pull request #12127 from iamthehimansh/split/macos-precise-sleep
fix(libc): absorb macOS nanosleep lateness in PreciseSleep
2026-10-29 22:18:39 +01:00
Adrià 33be5c14bb Merge pull request #11986 from juanpimg/feat/test-guest-sysmodule-spaces
fix(tests): parse maps pathname past whitespace in guest_sysmodule
2026-10-29 21:43:34 +01:00
Hedi Trigui 3dfc973fb8 fix(libc): address review feedback on vdprintf guest write path, short writes, ABI and test coverage 2026-10-29 17:30:21 +01:00
Hedi Trigui e999a37edd feat(libc): implement recallocarray 2026-10-29 17:01:12 +01:00
Hedi Trigui ed28f09157 feat(libc): implement dprintf and vdprintf 2026-10-29 16:04:11 +01:00
Alexandre Figueiredo 22b2496bfa feat(libc): provide the pmr new-delete, null and default memory resources 2026-10-29 15:02:00 +01:00
Adrià 9036e3c9e4 Merge pull request #12126 from morten-holm/fix/macos-host-stack-above-arena
fix(libkernel): move the macOS main stack out of the guest arena
2026-10-29 14:51:57 +01:00
Adrià e87f2d9394 Merge pull request #12162 from AlexFigas/feat/libc-aligned-array-operators
feat(libc): export the remaining aligned and array operator new and delete overloads
2026-10-29 14:39:44 +01:00
Adrià 157b02c4f1 Merge pull request #11852 from ionut27001/fix/wf-scanf-q-length-linux
fix(libc): end sscanf and vsscanf at a q length on Linux and macOS
2026-10-29 13:57:18 +01:00
Cursor Agentanddevindevsec 21d5544daf fix(libc): reject compact unwind entries without a real frame
A DWARF-mode index entry with no usable FDE, encoding 0, an unknown
personality, and a mode-3 immediate outside the function now fail the
unwind. A Linux test walks a synthetic __unwind_info blob.

Co-authored-by: devindevsec <[email protected]>
2026-10-29 12:53:13 +00:00
Adrià df53927b7b Merge pull request #10929 from Aspct3434/claude/modest-curie-705h76
fix(libc): read characters outside the BMP as surrogate pairs in fgetwc
2026-10-29 13:49:54 +01:00
Adrià aab650b4d3 Merge pull request #11893 from JJenkx/windows/libc-printf-ignored-lengths
fix(libc): ignore printf length modifiers that do not apply, as titles' libc.prx does
2026-10-29 13:49:01 +01:00
Adrià 7b57271358 Merge pull request #11504 from verusferro/feat/libc-xfilesystem-error
feat(libc): throw std::filesystem::filesystem_error from _Xfilesystem_error as the console's libc does
2026-10-29 13:47:45 +01:00
Cursor Agentanddevindevsec fef01787f8 fix(libc): walk the Mach-O compact unwind index
Co-authored-by: devindevsec <[email protected]>
2026-10-29 12:46:02 +00:00
Hedi Trigui 3f086c312a feat(libc): implement qsort_r 2026-10-29 13:28:05 +01:00
Adrià e3a7db45ed Merge pull request #11734 from verusferro/feat/libc-btowc-wctob-internals
feat(libc): export _Btowc and _Wctob, which give btowc and wctob results in the console's libc
2026-10-29 12:57:40 +01:00
MarcZX10 9b25533ecc refactor(libc): declare the log file flush and release beside the other shutdown hooks
The code that ends or replaces the process already includes Shutdown.hpp,
so LogFileFlush_nid_no_patch and LogFileRelease_nid_no_patch are declared
there instead of in LogFile.hpp, which only the log copy and its test
include.
2026-10-29 05:57:24 +01:00
MarcZX10 7f50a73736 feat(libc): add the standard-stream primitives of the ANYPS5_LOG_FILE log copy
The runtime writes its log to the process's standard output and error
through hundreds of direct stdio calls, so copying it into a file has to
work on the descriptors (POSIX) or handles (Windows) themselves.

Add the platform layer for that: opening the file for appending (relative
paths resolve against the working directory, the error text carries the
operating system error), pipes whose read end can be polled, keeping a
duplicate of the original standard stream, diverting a standard stream
into a pipe and putting it back only while it still is that pipe, and a
direct write to a standard stream for the crash reporters. Windows reads
the variable and the path as UTF-16. Nothing calls these yet.
2026-10-29 05:57:24 +01:00
JJenkx f7b1759879 fix(libc): parse scaled NaN subjects without numeric conversion 2026-10-28 20:13:03 -04:00
Eduardo Ruiz c7b70f44b0 feat(libc): implement std::_Throw(const std::bad_array_new_length&)
Follow the console libc.prx (PPSA02530) at 0xcb2d0: ignore the argument and throw the static bad_array_new_length object. Star Wars Racer (PPSA28416) imports it.
2026-10-29 01:03:00 +01:00
Eduardo Ruiz b524b25798 feat(libc): export std::__sce_v2::_Locinfo 2026-10-29 01:02:12 +01:00
Dean 711c4eca09 Merge pull request #11785 from ionut27001/fix/libc-hardware-concurrency
fix(libc): return the CPU count of the default thread mask from std::thread::hardware_concurrency
2026-10-29 12:16:46 +13:00
Dean 3e3fa79116 Merge pull request #12229 from Danigamer05/feat/libc-stdc-one-runs
feat(libc): add C23 leading and trailing one counts
2026-10-29 12:10:46 +13:00
Dean 34ae0d5e9e Merge pull request #12193 from Danigamer05/feat/libc-stdc-zero-runs
feat(libc): add C23 leading and trailing zero counts
2026-10-29 12:09:21 +13:00
Dean b76d41ea82 Merge pull request #11979 from xXPBSXx/carry/6713-default-heap-no-procparam
fix(libc): use the default heap for an executable without process parameters
2026-10-29 11:49:55 +13:00
Himansh Raj ddf5de8858 Merge remote-tracking branch 'origin/main' into split/macos-precise-sleep 2026-10-29 00:47:23 +05:30
Himansh Raj 8c3c205e6c fix(libc): cap the macOS PreciseSleep wake margin at 5 ms
nanosleep on macOS wakes about 25% late up to roughly 5 ms, then a
roughly constant 2 to 5 ms late for longer waits. Keeping 30% of the wait
as margin made a 100 ms wait spin about 25 ms. The margin is now 30% of the
wait, capped at 5 ms, so long waits spin at most about 5 ms.
2026-10-29 00:47:23 +05:30
Dean 1f52200308 Merge pull request #11333 from Danigamer05/feat/libc-signed-max32
feat(libc): implement signed 32-bit maximum value helper
2026-10-29 07:27:25 +13:00
juanpimg 1404a292e6 fix(libc): parse maps pathname past whitespace in the fallback scanner 2026-10-28 19:27:08 +01:00
Adrià 8c621aa276 Merge pull request #11729 from iAbdulrrahman/feat/libc-fetch-64-bit-atomics
feat(libc): implement 64-bit atomic fetch helpers
2026-10-28 17:35:48 +01:00
Claude 84aec8b0ac fix(libc): read characters outside the BMP as surrogate pairs in fgetwc
fputws and wprintf write a UTF-16 surrogate pair as one four-byte
UTF-8 sequence, but fgetwc decoded that sequence into a single code
point above 0xFFFF, which is not a 16-bit guest wchar_t value, and
fgetws stored it truncated: fputws(u"A\U0001F600\n") read back as
A, U+F600, newline.

fgetwc now returns the high surrogate and keeps the low one in the
stream for the next read, so fgetws stores the pair, also when the
buffer fills between the two halves. A successful seek discards it,
as FreeBSD's fseeko resets the stream's mbstate. Sequences that
decode to an overlong form or above U+10FFFF, and lead bytes F8 to
FF, fail with EILSEQ instead of returning made-up characters; the
three-byte surrogates that fputwc writes for a single unit are still
read back as that unit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QegaHM5QeCynUQ2ZLWHE4b
2026-10-28 14:43:48 +01:00
verusferro 7f2d69f340 feat(libc): export _Btowc and _Wctob, which give btowc and wctob results in the console's libc 2026-10-28 15:10:32 +03:00
verusferro 778c4a74ec feat(libc): throw std::filesystem::filesystem_error from _Xfilesystem_error as the console's libc does 2026-10-28 15:10:30 +03:00
klosixgaming-arch e21aa4cabd perf(libc): skip never-written pages when evicting a resident direct-memory run
Evicting a resident run read every 16 KiB page to find the written ones. On Windows, reading a committed page that was never touched faults in a zeroed page, and 97% of the pages the game releases were never written, so the scan took 2.9 us per page and most of the time the guest-allocation lock was held (Soul Hackers 2: 7.1 s of every 10 s). While the run is write-watched, no collection has cleared the watch and no host import touched it, GetWriteWatch lists the only pages that can be non-zero, so only those are read. Runs that fail any of those conditions are scanned as before.
2026-10-28 07:06:29 -05:00
Alexandre Figueiredo 2b21d42b76 feat(libc): export the remaining aligned and array operator new and delete overloads 2026-10-28 11:50:06 +00:00
Dean 14a269cfef Merge pull request #12187 from Danigamer05/feat/libc-stdc-count-zeros
feat(libc): add C23 count-zeros exports
2026-10-28 22:50:41 +13:00
Adrià 0cd07dc4ab Merge pull request #11399 from iAbdulrrahman/feat/libc-digittoint-and-numbers
feat(libc): implement digittoint, isnumber, and ishexnumber
2026-10-28 06:34:59 +01:00