Skip to content

Commit a9484fe

Browse files
authored
cython: add 3.2.9-specific riscv64 cibuildwheel patch (#1695)
The 3.3.0 patch (patches/cython/3.3.0/) does not apply to 3.2.9: its aarch64 override context includes an inherit.environment = "append" line that 3.2.9's pyproject.toml does not have. Add a version-specific patch carrying the same riscv64 CFLAGS override, matching 3.2.9's own override style.
1 parent f1b38f7 commit a9484fe

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From 9166cd9b78944c6bbba3513f1d2dc161033642b1 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Thu, 10 Sep 2026 11:04:48 +0200
4+
Subject: [PATCH] Add riscv64 cibuildwheel environment override
5+
6+
The [tool.cibuildwheel.linux.environment] default sets x86-specific
7+
CFLAGS (-march=core2 -mno-ssse3), and the per-arch overrides cover
8+
aarch64 and armv7l but not riscv64. Building manylinux_riscv64 wheels
9+
therefore inherits the x86 default and fails at the C compile:
10+
11+
gcc: error: '-march=core2': ISA string must begin with rv32 or rv64
12+
gcc: error: unrecognized command-line option '-mno-ssse3'
13+
14+
Add a riscv64 override mirroring the aarch64 one, using the RVA-baseline
15+
flags used to build riscv64gc packages (matches the Yocto qemuriscv64
16+
toolchain: rv64imafdc + lp64d ABI).
17+
18+
Backport of the equivalent override added upstream for cython 3.3.0
19+
(commit 353d241c339f14e9bddf81d64a485859e57964b1), adapted for 3.2.9's
20+
pyproject.toml which predates the inherit.environment = "append" style
21+
adopted later.
22+
23+
Upstream-Status: Backport [https://github.com/cython/cython/commit/353d241c339f14e9bddf81d64a485859e57964b1]
24+
25+
Signed-off-by: Ludovic Henry <git@ludovic.dev>
26+
---
27+
pyproject.toml | 4 ++++
28+
1 file changed, 4 insertions(+)
29+
30+
diff --git a/pyproject.toml b/pyproject.toml
31+
index 2b68685..f990d76 100644
32+
--- a/pyproject.toml
33+
+++ b/pyproject.toml
34+
@@ -35,6 +35,10 @@ RANLIB = "gcc-ranlib"
35+
select = "*aarch64"
36+
environment = {CFLAGS = "-O3 -g0 -pipe -fPIC -DNDEBUG -march=armv8-a -mtune=cortex-a72", AR = "gcc-ar", NM = "gcc-nm", RANLIB = "gcc-ranlib"}
37+
38+
+[[tool.cibuildwheel.overrides]]
39+
+select = "*riscv64"
40+
+environment = {CFLAGS = "-O3 -g0 -pipe -fPIC -DNDEBUG -march=rv64imafdc_zicsr_zifencei -mabi=lp64d -fstack-protector-strong", AR = "gcc-ar", NM = "gcc-nm", RANLIB = "gcc-ranlib"}
41+
+
42+
[[tool.cibuildwheel.overrides]]
43+
select = "*armv7l"
44+
environment.CFLAGS = "-O3 -g0 -pipe -fPIC"
45+
--
46+
2.50.1 (Apple Git-155)
47+

0 commit comments

Comments
 (0)