tcc 0.9.27's lib/bcheck.c uses __malloc_hook, removed in glibc 2.34, so
the pinned build failed on Ubuntu 24.04 (lib/bcheck.c:738). Shards never use
-b; the build now passes BCHECK_O= unconditionally, keeping every other
libtcc1.a object. The bundle smoke also clears LIBRARY_PATH, CC and
GCC_EXEC_PREFIX and checks shards import no bounds-checking symbols.
Verified: linux_tcc_bundle_smoke_test passes on Ubuntu 24.04 x86_64
(glibc 2.39, gcc + libc6-dev installed, so host headers exist but are not
used) and on Steam Runtime sniper (glibc 2.31).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- compile_overlays: the bundle layout now compiles with -nostdinc and only
the bundle's own headers (tcc's include/, then musl's libc-include/), so a
host with libc6-dev cannot change what a shard compiles against.
- runtime/tests/test_linux_tcc_bundle_smoke.py (ctest
linux_tcc_bundle_smoke_test): stages the bundle exactly as a release does
(pinned tcc 0.9.27 built from source, musl 1.2.5 headers, runtime
headers), compiles an emitter-shaped overlay shard through
compile_overlays' own tcc path (preamble shim, call_by_address rewrite,
exports) for PGXP flavors 0 and 2 with PATH emptied, loads the .so and
checks overlay_abi() and the exported function. Linux x86_64 only (skips
77 elsewhere). Passes in the Steam Runtime sniper SDK image.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the clean-box smoke: every shard failed with "';' expected (got
va_list)". With the adaptation, 26 overlay shards compile on a Debian box
with no compiler and no libc headers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tinycc publishes no Linux binary, so Linux release toolchains had no tcc and
a player without a compiler -- every Steam Deck: SteamOS has none and a
read-only root -- kept overlays interpreted. stage_toolchain now builds the
pinned, unmodified tcc 0.9.27 source on the packaging machine and stages it
as overlay_toolchain/tcc/ (tcc, libtcc1.a, tcc's include/) with musl 1.2.5's
MIT-licensed C headers in libc-include/ (both sources SHA-256 pinned).
compile_overlays.py recognises that layout and calls tcc with -B<dir>
-nostdlib -isystem <dir>/libc-include <dir>/libtcc1.a, so nothing from the
player's system is needed; shard libc symbols resolve against the game's
glibc at dlopen. Windows and system tcc invocations are unchanged. The
TinyCC notice names the Linux build and the musl headers.
Tests: test_release_stage_cache.py (Linux pins, notice, bundle args).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default demanded SCPH1001.emitter.sha, which is gitignored (retail output
is generated from a dump, never committed), so every game's release CI failed
with 'SCPH1001.emitter.sha missing' on a clean checkout. Default to every
generated/*.emitter.sha; naming a stem still requires it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Per ring save, the section CRCs (and small sections in hex) of the
boot_state blob, marked live or replay. tools/rb_snap_audit_diff.py
checks a seat's replay against its own live save and seats against each
other, naming the first differing section and bytes. Off unless set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#575 stopped tracking generated/SCPH1001_*, but check_generated.sh and the
game-release template still required them, failing title release packaging.
SCPH1001 is now optional/local: complete -> noted, absent -> skipped with a
note, partial -> error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #561. Guest time now has two entry points (psx_cycles.h): the
CPU charge psx_cpu_charge() (instruction base, load fudge/region/completion,
i-cache refills, BIOS HLE costs), which applies [timing] guest_cycle_scale,
and the unscaled device advance psx_advance_cycles() (DMA, idle skips,
mul/div and GTE deadline waits). The emitters' block-mode charges emit
psx_cpu_charge; overlay DLLs accumulate it raw and publish through the
cpu_charge callback (was advance_cycles, same slot) into the same host
function, so nothing is scaled at the DLL boundary. The batched
psx_cyc_charge path, the dirty-RAM interpreter, psx_cyc_readmem, i-cache
refills and bios_hle.c all charge through it. At scale 1 it is exactly
psx_advance_cycles.
Gate in psxrecomp: [timing] guest_cycle_scale_gate, RAM predicates judged
at every VBlank edge (deterministic, works online, no mod needed), plus
psx_mod_set_guest_cycle_scale_gate() in mod_plugins.h for custom logic or
to tie the scale to a mod (guest_cycle_scale_gated = true; every mod
session reset shuts it). The carried fraction and both gate states are a
boot_state section (BS_SEC_GCS, written only when the scale is not 1), so
savestates and the netplay rollback snapshot re-simulate the same cycles.
psx_guest_cycle_scale_gate_test pins tier identity, the gates and rollback
re-simulation against the real psx_cycles.c.
OpenBIOS regenerated (emitter stamp); retail SCPH1001 is not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>