keystone: fix build with cmake 4 & gcc15 - #450265
Merged
Merged
Conversation
SuperSandro2000
approved these changes
Oct 9, 2025
|
Contributor
Author
|
The build errors on darwin seem to be caused by issues with the sandbox in other packages, based on these lines in the log:
It looks like all builds are aborted once this occurs, which then results in |
leona-ya
approved these changes
Oct 11, 2025
17 tasks
imheresamir
pushed a commit
to imheresamir/keystone
that referenced
this pull request
Apr 29, 2026
Adapted from NixOS/nixpkgs#450265
imheresamir
pushed a commit
to imheresamir/keystone
that referenced
this pull request
Apr 29, 2026
Adapted from NixOS/nixpkgs#450265
This was referenced Apr 29, 2026
amaanq
pushed a commit
to keystone-engine/keystone
that referenced
this pull request
Jul 18, 2026
* Support building with CMake 4 Adapted from NixOS/nixpkgs#450265 * Support building with GCC 15 Adapted from NixOS/nixpkgs#450265 * Fix building with MSVC * RISCV: Add RegSize/Alignment fields to RISCVGenRegisterInfo.inc initializers Keystone's MCRegisterClass retains the RegSize and Alignment fields from the LLVM 4.0 era, before they were moved to TargetRegisterInfo in LLVM 5.0 (D31783) and eventually removed from MCRegisterClass entirely in LLVM 7.0 (rL339350). The RISCV backend was ported from a newer LLVM snapshot where these fields no longer existed, so RISCVGenRegisterInfo.inc was generated without them, causing a member count mismatch against keystone's MCRegisterClass definition and a compile error on MSVC (C3852). Add the missing RegSize and Alignment values to each register class initializer to match the layout expected by MCRegisterClass. The values chosen reflect the natural register width of each class (4 bytes for FPR32, 8 bytes for all others). These fields are structurally required to satisfy the initializer but are never consulted by the assembler — spill slot calculations belong to the codegen layer which keystone does not include. All other architectures in keystone were ported from pre-LLVM-5.0 and have correct initializers. This change makes RISCV consistent with them.
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.
Things done
Fixes #449493
Adds two patches from keystone-engine/keystone#593 to fix building with cmake 4 and gcc15.
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.