Build: /Qspectre- is MSVC-only and breaks every Release target under clang-cl
Maintainer thường phản hồi trong vòng 5 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cmake, cpp
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Bắt đầu tại ps2xRuntime/cmake/ReleaseMode.cmake, ở EnableFastReleaseMode() (khoảng dòng 22), nơi /Qspectre- được thêm bên trong if(MSVC). Chỉ bỏ qua flag đó khi CMAKE_CXX_COMPILER_ID khớp với Clang (clang-cl). Xác nhận các bản build Release của những target được liệt kê thành công với clang-cl; /GL có thể giữ nguyên và chỉ tạo cảnh báo về đối số không được sử dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 3.3k
- Fork
- 149
- Merge trung bình
- 5 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ran-j/PS2Recomp
-
VU0 macro VSQI / VSQD: address and source registers swapped in generated codeCó thể đã có người làm @yanm1103 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
Runtime: SampleTexture casts unbounded or NaN texture coordinates to int, which is undefined behaviourCó thể đã có người làm @luisbraganca đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ran-j/PS2Recomp#273 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 5 ngày
-
Runtime: writes to D_ENABLEW (0x1000F590) are never visible at D_ENABLER (0x1000F520), hanging any game that suspends the DMACCó thể đã có người làm @luisbraganca đã nhận 6 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
ran-j/PS2Recomp#257 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của ran-j/PS2Recomp
Issue tương tự
-
Mac mini M6 (16 GB): Q2_0 streaming works - measured 11.7->27.2 tok/s + arena fix for sub-32 GB MacsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
champion good first issue remake source/qq
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
metasequoiaime/msime-windows#1025 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backlog bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
EchoTools/nevr-runtime#653 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`--fail-require-skip` never fires: run_tests.py searches stdout, but the unittest binary writes the skip summary to stderrCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
InfiniTimeOrg/InfiniTime#2492 ·