Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/packages/rhino3dm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ versions:
- filename: rhino3dm-8.32.1-cp314-cp314t-manylinux_2_39_riscv64.whl
sha256: 8571cdd88b3f5e169e2ce7fdf0ef6bd16863d465b543820d48dd01ec73460665
requires-python: '>=3.9'
- version: 8.35.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 576cbc65673d632fd10e4c946abe159ef83b01d7 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Fri, 11 Sep 2026 20:42:24 +0200
Subject: [PATCH] setup: disable pybind11 LTO on Linux to avoid riscv64
relocation overflow

pybind11_add_module links pybind11::lto (-flto=auto -fno-fat-lto-objects)
whenever CMAKE_INTERPROCEDURAL_OPTIMIZATION is unset. GCC's riscv64 LTO
codegen overflows R_RISCV_PCREL_HI20 relocations when linking a
translation unit this large (opennurbs + draco + bindings combined by
LTO), failing with 'relocation truncated to fit'. Disable
CMAKE_INTERPROCEDURAL_OPTIMIZATION on Linux to avoid pybind11's default
LTO; x86_64/aarch64 do not hit this relocation limit so this only
matters for riscv64.

Upstream-Status: Inappropriate [riscv64 GCC LTO relocation-overflow workaround; x86_64/aarch64 don't hit this]
---
setup.py | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/setup.py b/setup.py
index d0cf103..f1fcc01 100644
--- a/setup.py
+++ b/setup.py
@@ -87,6 +87,12 @@ class CMakeBuild(build_ext):
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
if platform.system() == "Darwin":
cmake_args += ['-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64']
+ if platform.system() == "Linux":
+ # pybind11_add_module links pybind11::lto (-flto=auto) whenever
+ # CMAKE_INTERPROCEDURAL_OPTIMIZATION is unset; GCC's riscv64 LTO
+ # codegen overflows R_RISCV_PCREL_HI20 relocations linking a
+ # translation unit this large (opennurbs + draco + bindings).
+ cmake_args += ['-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF']
build_args += ['--', f'-j{max(1,os.cpu_count()-1)}']

env = os.environ.copy()
Loading