Build: /Qspectre- is MSVC-only and breaks every Release target under clang-cl
Maintainers usually reply within 5 days
@ahmedgamalalzatary is already working on this.
Since Oct 23, 2026.
- #386 by @ahmedgamalalzatary — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cmake, cpp
- Domain
- build-system, tooling
Research direction
Start in ps2xRuntime/cmake/ReleaseMode.cmake at EnableFastReleaseMode() (around line 22), where /Qspectre- is added under if(MSVC). Guard that one flag so it is omitted when CMAKE_CXX_COMPILER_ID matches Clang (clang-cl). Confirm Release builds of the listed targets succeed with clang-cl; /GL can stay as a warning-only unused argument.
Written by the indexing model from the issue text.
Description
What happens
EnableFastReleaseMode() (ps2xRuntime/cmake/ReleaseMode.cmake:22) adds 12 optimisation flags under an if(MSVC) guard. CMake sets MSVC to 1 for any MSVC-like command-line frontend, clang-cl included. Eleven of those flags are fine under clang-cl; the twelfth, /Qspectre-, is cl.exe-only. clang-cl does not recognise it, treats it as an input file name, and fails:
clang-cl: error: no such file or directory: '/Qspectre-'; did you mean '/Qspectre'?
Every target that calls EnableFastReleaseMode therefore fails to compile in Release under clang-cl -- ps2_recomp_lib, ps2_recomp, ps2_analyzer_lib, ps2_analyzer, ps2_runtime, ps2EntryRunner, plus the ps2xStudio and ps2xTest targets. The whole project is blocked.
It is invisible under cl.exe, and it only hits the Windows + clang-cl combination -- the one worth recommending, since it builds our 2752-file runner in about 60 seconds.
Measured, flag by flag
Each of the 12 flags passed individually to clang-cl /c on a neutral translation unit:
/O2 /Ob2 /Oi /Gy /Gw /GF /Zc:inline /fp:fast /arch:AVX2 /GS- ok
/GL ok, but "warning: argument unused during compilation: '/GL'"
/Qspectre- REJECTED
At link time /LTCG /OPT:REF /OPT:ICF all work: the binary is produced and runs. So the problem is confined to this one compile flag.
Suggested fix
Keep the flag for a real cl.exe, drop it for clang-cl:
if(MSVC)
set(_ps2x_cl_only_flags /Qspectre-)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(_ps2x_cl_only_flags "")
endif()
target_compile_options(${TargetName} PRIVATE
$<$<CONFIG:Release>:
... the other 11 flags, unchanged ...
/GS-
${_ps2x_cl_only_flags}
>
)
CMAKE_CXX_COMPILER_ID is Clang for clang-cl and MSVC for cl.exe, so the test separates exactly the two cases. With that change: 243 targets built, 0 errors.
Note that /GL is accepted but ignored at compile time under clang-cl (it warns). Not an error, but dead weight in that configuration.
Found while statically recompiling Ridge Racer V (NTSC-U, SLUS_200.02) with PS2Recomp.
Tested on commit 75d729ce; main was c5a9d02 at the time of writing, one README-only commit ahead.
Host: Windows 11 x64, clang-cl 22.1.3 + Ninja, MSVC toolset 14.51.36231, Windows SDK 10.0.26100.0, CMake 4.2.3.
None of these are specific to this game.
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 149
- Avg merge
- 8h 46m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ran-j/PS2Recomp
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ran-j/PS2Recomp#393 · 1 comment ·
Maintainers usually reply within 5 days
-
EE sceCdStatus stub always reports READ (6), hanging games that wait for PAUSEPossibly taken @ahmedgamalalzatary claimed this 11 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 5 days
-
VU0 macro VSQI / VSQD: address and source registers swapped in generated codePossibly taken @yanm1103 claimed this 19 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 5 days
-
Runtime: SampleTexture casts unbounded or NaN texture coordinates to int, which is undefined behaviourMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ran-j/PS2Recomp#273 · 2 comments ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 5 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
meshcore-dev/MeshCore#3760 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepseek-ai/DeepGEMM-Ascend#29 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
EchoTools/nevr-runtime#2042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
emscripten-core/emscripten#28160 · 1 comment ·
Maintainers usually reply within 1 day
-
Download size and speed show scientific notation between 1000 and 1023 unitsPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 Under an hour Newbie friendliness 88/100
kiwix/kiwix-desktop#1570 ·
Maintainers usually reply within 1 day