Detect riscv64 targets and disable JIT#2684
Open
carlosqwqqwq wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
melonDS used host compiler predefined macros for architecture selection, so a simulated or cross-target
riscv64configuration could still inherit the hostx86_64JIT path. This patch makes the riscv64 baseline path explicit and keeps RISC-V on the interpreter-only core build.What changed
CMAKE_SYSTEM_PROCESSOR=riscv64explicitly in the top-level CMake architecture selection instead of relying on host compiler predefined macros.ENABLE_JIToff by default.Verification
BUILD_QT_SDL=OFF,ENABLE_OGLRENDERER=OFF,TEAKRA_BUILD_UNIT_TESTS=OFF, andTEAKRA_BUILD_TOOLS=OFF.cmake --build build-codex-native-riscvfix --parallel 4.riscv64CMake configuration withCMAKE_SYSTEM_NAME=Linux,CMAKE_SYSTEM_PROCESSOR=riscv64,CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY,BUILD_QT_SDL=OFF,ENABLE_OGLRENDERER=OFF,TEAKRA_BUILD_UNIT_TESTS=OFF,TEAKRA_BUILD_TOOLS=OFF, and forced__riscv=1/__riscv_xlen=64macros because no real RISC-V toolchain is available on the host.riscv64tree successfully withcmake --build build-codex-riscv-riscvfix --parallel 4.riscv64configuration printsDetected RISC-V 64-bit target; building interpreter path with JIT disabled.build-codex-riscv-riscvfix/build.ninjaandcompile_commands.json: they containARCHITECTURE_RISCV64=1,__riscv=1, and__riscv_xlen=64.build-codex-riscv-riscvfix/build.ninjadoes not containARCHITECTURE_x86_64=1,JIT_ENABLED,ARMJIT_x64,ARMJIT_A64,x64Emitter,Arm64Emitter,GPU_OpenGL, orOGLRENDERER_ENABLED.Notes
This is a conservative portability patch. It only fixes target architecture selection so that
riscv64no longer inherits the hostx86_64JIT path during configuration. Verification covers native core-only build stability plus simulated RISC-V target selection and backend exclusion checks, but not a real riscv64 cross-toolchain build, frontend dependency build, or hardware run.