diff --git a/docs/packages/mmcif.yaml b/docs/packages/mmcif.yaml index 07c08621d7b..e5b94cd1764 100644 --- a/docs/packages/mmcif.yaml +++ b/docs/packages/mmcif.yaml @@ -18,3 +18,4 @@ versions: - filename: mmcif-1.1.1-cp314-cp314t-manylinux_2_39_riscv64.whl sha256: 694743bd4e50b39742aae0958728c802528b8af651d870db86fe1492646d55c4 requires-python: '>=3.8' +- version: 1.2.0 diff --git a/patches/mmcif/1.2.0/0001-build-compile-the-C-core-with-fPIC.patch b/patches/mmcif/1.2.0/0001-build-compile-the-C-core-with-fPIC.patch new file mode 100644 index 00000000000..5c7da6570ef --- /dev/null +++ b/patches/mmcif/1.2.0/0001-build-compile-the-C-core-with-fPIC.patch @@ -0,0 +1,39 @@ +From c4810cb4b5b938fd8c2f0bff467f1fbbd4d012ec Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 10 Sep 2026 08:07:11 +0200 +Subject: [PATCH] build: compile the C++ core with -fPIC + +Upstream-Status: To upstream [not submitted; this port's automation may not open issues or PRs on repos other than riseproject-dev/python-wheels] + +CMAKE_C_FLAGS carries -fPIC but CMAKE_CXX_FLAGS does not, so the C++ +object files that make up mmciflib-all (linked into the pybind11 +shared module mmciflib.*.so) are compiled position-dependent. This +goes unnoticed on x86_64/aarch64, but riscv64's binutils ld enforces +PIC strictly for shared-object relocations and segfaults while +generating the -flto link (an assertion failure in elfnn-riscv.c), +after first reporting the underlying cause: + + relocation R_RISCV_HI20 against `a local symbol' can not be used + when making a shared object; recompile with -fPIC + +Add -fPIC to CMAKE_CXX_FLAGS to match CMAKE_C_FLAGS. +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 35eeaca..6571ac5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,7 +60,7 @@ if (NOT CONFIGURED_ONCE) + #set(CMAKE_CXX_FLAGS "${warnings} ${mydefines} -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -std=c++14 -flto " + # CACHE STRING "Flags used by the compiler during all build types." FORCE) + # +- set(CMAKE_CXX_FLAGS "${warnings} ${mydefines} -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -flto " ++ set(CMAKE_CXX_FLAGS "${warnings} ${mydefines} -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -flto -fPIC " + CACHE STRING "Flags used by the compiler during all build types." FORCE) + # + set(CMAKE_C_FLAGS "${warnings} ${mydefines} -fPIC" +-- +2.50.1 (Apple Git-155) +