Build: /Qspectre- is MSVC-only and breaks every Release target under clang-cl
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cmake, cpp
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia da ps2xRuntime/cmake/ReleaseMode.cmake, in corrispondenza di EnableFastReleaseMode() (intorno alla riga 22), dove /Qspectre- viene aggiunto all’interno di if(MSVC). Fai in modo che questo flag venga omesso quando CMAKE_CXX_COMPILER_ID corrisponde a Clang (clang-cl). Verifica che le build Release dei target indicati vadano a buon fine con clang-cl; /GL può rimanere come argomento inutilizzato che genera solo un avviso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 3.3k
- Fork
- 149
- Merge medio
- 5g 10h
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ran-j/PS2Recomp
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 4 giorni
-
VU0 macro VSQI / VSQD: address and source registers swapped in generated codeForse già presa @yanm1103 l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
Runtime: SampleTexture casts unbounded or NaN texture coordinates to int, which is undefined behaviourForse già presa @luisbraganca l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ran-j/PS2Recomp#273 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 4 giorni
-
Runtime: writes to D_ENABLEW (0x1000F590) are never visible at D_ENABLER (0x1000F520), hanging any game that suspends the DMACForse già presa @luisbraganca l’ha presa 9 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ran-j/PS2Recomp#257 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di ran-j/PS2Recomp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
[BUG] Clipboard History: Buffer over-read in WideCharToMultiByte on double-click pasteForse già presa @softmgr l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
notepad-plus-plus/notepad-plus-plus#18519 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
justcallmekoko/ESP32Marauder#1635 ·
I maintainer di solito rispondono entro 1 giorno
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
grizzlypeak3d/DJV#931 ·