From f59d7e5e4e724de96238c6b7619316024bda16ce Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 29 Jun 2025 19:59:16 +0530 Subject: [PATCH 1/3] Fix `__Pyx_IsSameCFunction` cast --- pyodide_build/_f2c_fixes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyodide_build/_f2c_fixes.py b/pyodide_build/_f2c_fixes.py index d66ef823..1874c154 100644 --- a/pyodide_build/_f2c_fixes.py +++ b/pyodide_build/_f2c_fixes.py @@ -76,6 +76,15 @@ def scipy_fix_cfile(path: Path) -> None: text = text.replace("void(*)", "int(*)") text = text.replace("static void f2py_setup_", "static int f2py_setup_") + # Fix Cython-generated function pointer casts for __Pyx_IsSameCFunction + # for _matfuncs_sqrtm + # TODO: not sure if this is the best place to put this, but it works + text = re.sub( + r"(__Pyx_IsSameCFunction\([^,]+,\s*)\(int\(\*\)\(void\)\)", + r"\1(void(*)(void))", + text, + ) + if path.name.endswith("_flapackmodule.c"): text = text.replace(",size_t", "") text = re.sub(r",slen\([a-z]*\)\)", ")", text) From f98e8c652b1767da1e0312e7c915d62caeb45a11 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 29 Jun 2025 19:59:40 +0530 Subject: [PATCH 2/3] Port #168 in this branch, temporarily --- pyodide_build/pywasmcross.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyodide_build/pywasmcross.py b/pyodide_build/pywasmcross.py index 13b2ee64..fd821df4 100755 --- a/pyodide_build/pywasmcross.py +++ b/pyodide_build/pywasmcross.py @@ -188,6 +188,9 @@ def replay_genargs_handle_linker_opts(arg: str) -> str | None: # wasm-ld does not recognize some link flags "--sort-common", "--as-needed", + # macOS-specific linker flags that wasm-ld doesn't understand + "-headerpad_max_install_names", + "-dead_strip_dylibs", ]: continue From 9c803e958709cdbdec615fcd2cdfae21006dca9a Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:08:00 +0530 Subject: [PATCH 3/3] Add comment about SciPy 1.16 build problem Co-Authored-By: Gyeongjae Choi --- pyodide_build/_f2c_fixes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyodide_build/_f2c_fixes.py b/pyodide_build/_f2c_fixes.py index 1874c154..de5ba4af 100644 --- a/pyodide_build/_f2c_fixes.py +++ b/pyodide_build/_f2c_fixes.py @@ -77,8 +77,8 @@ def scipy_fix_cfile(path: Path) -> None: text = text.replace("static void f2py_setup_", "static int f2py_setup_") # Fix Cython-generated function pointer casts for __Pyx_IsSameCFunction - # for _matfuncs_sqrtm - # TODO: not sure if this is the best place to put this, but it works + # for _matfuncs_sqrtm for builds of SciPy 1.16.0. + # TODO: I'm not sure if this is the best place to put this, but it works text = re.sub( r"(__Pyx_IsSameCFunction\([^,]+,\s*)\(int\(\*\)\(void\)\)", r"\1(void(*)(void))",