Skip to content

Allow disabling IPO for large generated game runners - #249

Open
GTTeancum wants to merge 1 commit into
ran-j:mainfrom
GTTeancum:codex/runner-ipo-toggle
Open

GTTeancum wants to merge 1 commit into
ran-j:mainfrom
GTTeancum:codex/runner-ipo-toggle

Conversation

@GTTeancum

Copy link
Copy Markdown

Summary

  • add a default-on PS2X_ENABLE_RUNNER_IPO option
  • let EnableFastReleaseMode retain the normal Release optimizations while omitting /GL, /LTCG, and CMake IPO for one target
  • apply that opt-out only to ps2EntryRunner; runtime libraries keep their existing IPO behavior

Motivation

Large statically generated game targets can exhaust linker memory even with a single link worker. A 107-translation-unit X-Men Legends runner exceeded a 2 GiB linker-process cap with IPO enabled. Disabling IPO only for the generated runner allowed the complete executable to link under the same cap while preserving /O2 and optimized/IPO-enabled runtime libraries.

The option defaults ON, so existing builds are unchanged.

Validation

Configured current upstream main with MSVC/Visual Studio 2022, CMAKE_BUILD_TYPE=Release, and global IPO enabled:

  • PS2X_ENABLE_RUNNER_IPO=OFF: generated ps2EntryRunner.vcxproj has no WholeProgramOptimization or LinkTimeCodeGeneration; ps2_runtime.vcxproj still has whole-program optimization.
  • PS2X_ENABLE_RUNNER_IPO=ON: the runner again has whole-program optimization and LTCG, preserving the default behavior.

The 107-unit game runner was compiled with /O2 and no /GL, linked with /CGTHREADS:1 under the unchanged 2 GiB guard, passed PE section validation, and reached rendered gameplay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant