Skip to content

[CHIA-3769] - Update GMP to 6.3.0 and include new patch files#270

Merged
hoffmang9 merged 4 commits into
mainfrom
EL.linux-gmp6.3
Feb 20, 2026
Merged

[CHIA-3769] - Update GMP to 6.3.0 and include new patch files#270
hoffmang9 merged 4 commits into
mainfrom
EL.linux-gmp6.3

Conversation

@emlowe
Copy link
Copy Markdown
Contributor

@emlowe emlowe commented Oct 1, 2025

The enable-fat option for GMP results in binaries in linux that do not work correctly on pre-Haswell CPUs that do not have the BMI2 instruction set.

see original report here:
https://gmplib.org/list-archives/gmp-bugs/2021-January/004991.html
and newer (same bug) on 6.3.0 here:
https://gmplib.org/list-archives/gmp-bugs/2025-February/005562.html

This PR applies the same patch as the 6.2.1 files (src/lib/gmp-patch-6.2.1/compat.c and src/lib/gmp-patch-6.2.1/longlong.h - although it does so as a true patch file created with diff -u from the original 6.2.1 checked in files. The patch does apply cleanly in 6.3.0

The patch for mpz/inp_raw.c is no longer needed as the 6.3.0 source include the exact same fixed code

The wheel python tests were tested successfully on a Core 2 Duo P8600 that does not have the BMI2 instruction set.


Note

Medium Risk
Changes the native dependency build/patching flow and low-level GMP asm dispatch, which can affect wheel compatibility or performance across CPU variants.

Overview
Updates the Linux cibuildwheel build step to download/build GMP 6.3.0 and apply a checked-in patch (src/lib/gmp-6.3.0.diff) instead of copying patched source files for 6.2.1.

Adds unified diff patch files for GMP 6.2.1 and 6.3.0 that gate use of BMI1/BMI2/LZCNT instructions behind runtime CPUID checks (avoiding illegal instructions on older x86_64 CPUs), and removes the vendored src/lib/gmp-patch-6.2.1/* sources (including the no-longer-needed mpz/inp_raw.c fix).

Written by Cursor Bugbot for commit 0ceeeb9. This will update automatically on new commits. Configure here.

@emlowe emlowe changed the title add patch files for GMP6.3.0 and adjust build steps [CHIA-3769] - add patch files for GMP6.3.0 and adjust build steps Oct 1, 2025
@emlowe emlowe requested review from altendky and wjblanke October 1, 2025 22:26
@emlowe emlowe marked this pull request as ready for review October 1, 2025 22:28
@emlowe emlowe changed the title [CHIA-3769] - add patch files for GMP6.3.0 and adjust build steps [CHIA-3769] - Update GMP to 6.3.0 and include new patch files Nov 5, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 5, 2026

'This PR has been flagged as stale due to no activity for over 60
days. It will not be automatically closed, but it has been given
a stale-pr label and should be manually reviewed.'

Copy link
Copy Markdown
Member

@hoffmang9 hoffmang9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hoffmang9
Copy link
Copy Markdown
Member

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread src/lib/gmp-6.2.1.diff
@github-actions github-actions Bot removed the stale-pr label Feb 19, 2026
@hoffmang9 hoffmang9 merged commit 5976291 into main Feb 20, 2026
56 checks passed
@hoffmang9 hoffmang9 deleted the EL.linux-gmp6.3 branch February 20, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants