cpu: translate a multi-record archive reader from standard startup #453

Merged
R0Y00 merged 2 commits from upstream-pr/459 into main 2026-11-22 05:02:30 +00:00
R0Y00 commented 2026-11-22 04:55:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T04:55:54Z.


Refs #317. Extends the existing EXE three-way milestone in #455 with a stock toolchain startup and a real decompressor. No upstream PR dependency.

Build the Zig 0.13.0 single-threaded Windows console program from source and translate its linked entry and record loop. Recognize bound linker import thunks, terminate the CFG at a declared noreturn import, and propagate the defined low register width through wide moves. Unknown imports remain rejected. A widened exit-status consumer must fail translation.

The same native provider calls blast 1.3 (unmodified upstream source from zlib v1.3.1, notices retained) on each runner. Two distinct records give 26 output bytes and exit 0. Truncating the second stream yields a callback delivering one tentative byte which must never be published. Expect 13 bytes, exit 2, one completed record, both allocations freed. The test checks each callback sequence independently of the native executable.

Windows x64, MSVC 19.51: after building archive_reader_lifted and pe_map, both commands passed (1/1 each):

ctest --preset dev --no-tests=error -R '^cpu_native_archive_reader$' -V
ctest --preset release --no-tests=error -R '^cpu_native_archive_reader$' --output-on-failure
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6538649204 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/459). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T04:55:54Z. --- Refs #317. Extends the existing EXE three-way milestone in #455 with a stock toolchain startup and a real decompressor. No upstream PR dependency. Build the Zig 0.13.0 single-threaded Windows console program from source and translate its linked entry and record loop. Recognize bound linker import thunks, terminate the CFG at a declared noreturn import, and propagate the defined low register width through wide moves. Unknown imports remain rejected. A widened exit-status consumer must fail translation. The same native provider calls blast 1.3 (unmodified upstream source from zlib v1.3.1, notices retained) on each runner. Two distinct records give 26 output bytes and exit 0. Truncating the second stream yields a callback delivering one tentative byte which must never be published. Expect 13 bytes, exit 2, one completed record, both allocations freed. The test checks each callback sequence independently of the native executable. Windows x64, MSVC 19.51: after building archive_reader_lifted and pe_map, both commands passed (1/1 each): ```powershell ctest --preset dev --no-tests=error -R '^cpu_native_archive_reader$' -V ctest --preset release --no-tests=error -R '^cpu_native_archive_reader$' --output-on-failure ```
upstream-sync closed this pull request 2026-11-24 06:43:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!453
No description provided.