Files
packages/lang
Josef Schlehofer 1f0b486578 python3: fix host python extension compilation on macOS
On macOS (Darwin) hosts, building host Python C extensions (such as Cython) using the '-shared' flag and linking against '-lpython3.x' causes the host Python interpreter to load a duplicate copy of the Python runtime. This leads to type checking mismatches and segmentation faults (SIGSEGV) when importing the compiled extension.

For example, running:
    ./staging_dir/hostpkg/bin/python3 -c "import Cython.Utils"
crashes with:
    Segmentation fault: 11

To build shared modules correctly on macOS, they must be compiled as bundles using the '-bundle -undefined dynamic_lookup' flags instead of '-shared', and they should not link against the Python library (no '-lpython3.x' in LDFLAGS).

Fix this by dynamically adjusting LDSHARED and LDFLAGS in python3-host.mk when the host OS is Darwin.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit ea541f48b5)
2026-06-10 08:28:33 +02:00
..
2026-03-15 12:25:21 +02:00
2026-01-28 20:59:53 +02:00
2026-04-06 22:23:32 +03:00
2026-06-02 21:14:28 +02:00
2025-11-13 19:18:37 +02:00
2026-04-04 18:44:52 +03:00
2026-06-09 15:02:59 +02:00
2025-05-11 21:23:49 +03:00
2025-06-01 10:18:38 +03:00