cpu: translate two named DLL imports from an EXE caller #256
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!256
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/256/head"
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?
@RonLogic on GitHub · 2026-11-21 19:29 UTC · original
RonLogic:cpu/exe-two-named-imports→main· +199 −29 · 8 files · 3 commits · merged 2026-11-22 08:20 UTCExtends #249 with a source-built EXE whose internal caller passes the result of
cpu_import_provider.dll!mix_argstocpu_exe_second_provider.dll!accumulate_args. The AOT entry point accepts the second DLL and symbol through an explicit--provider DLL SYMBOLbinding and verifies the import against that DLL. The existing DLL caller entry point keeps its single-slot policy.On both selector bytes, the native Windows process,
pe_map_runchild, and translated process match an independent reference for both providers' arguments, both output words, and the exit code. Removing the mapping for the second DLL stops before entry. The AOT test checks both an omitted binding and a binding to the wrong DLL. Both report the missing DLL and symbol.This change uses
lift_bodyand the EXE fixture shared with #247 and #253. It is based directly on #249 and does not depend on those PRs.Before this change, the source-built EXE ran on Windows and the translator stopped at
call to a second IAT slot at RVA 0x1096. At72c5a79on7233cec, all 34 CPU tests passed locally on Windows x64 with no skips.@R0Y00 on GitHub · 2026-11-21 19:58 UTC · original
The new
--provider DLL SYMBOLpath copies the accepted export name directly into the generated C++ declaration and call. PE export names can contain punctuation or be C++ keywords; a matching export such astrace-valuewould produce uncompilable output after translation reported success. Please reject unsupported symbol spellings before emission (including keywords and collisions with generated names), or assign a separate valid binding. Add a focused rejection control alongside the two-provider comparison.@RonLogic on GitHub · 2026-11-21 23:32 UTC · original
Addressed the provider-symbol feedback in
2d7323c, included in40bf87d. The translator now rejects unsupported--providersymbol spellings before emitting C++, includingtrace-value, keywords, reserved names, names that collide with generated identifiers, and duplicate bindings. I added 12 rejection cases alongside the native Windows,pe_map_run, and AOT two-provider comparison.All 43 CPU tests passed locally on Windows x64. All three CI jobs for
40bf87dpassed.@R0Y00 on GitHub · 2026-11-22 06:28 UTC · original
Thanks for addressing the provider names. I test-merged
40bf87dagainst current main. The remaining conflicts are in CMakeLists.txt, tests/cpu/exe_entry.asm, tests/cpu/mapped_exe_chain_check.py, tools/cpu_call_aot.py and tools/cpu_exe_aot.py. This branch has maintainer edits disabled. Please enable edits if you would like us to integrate it, or reconcile the two-provider fixture with the current EXE path and keep both provider-symbol rejection and the existing three-way comparisons.@R0Y00 on GitHub · 2026-11-22 08:14 UTC · original
I integrated your original commits on the maintainer branch in #502. The two-provider comparison and the four existing EXE comparisons all passed locally on Windows. The integration PR retains the original commit history and is waiting for the required checks.