Files
packages/lang
Josef Schlehofer 8f8fc9a5d9 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:50 +02:00
..
2024-07-12 12:56:24 -07:00
…
2025-04-28 13:15:31 +08:00
2025-06-01 10:25:23 +03:00
2024-06-23 11:15:50 -07:00
2024-04-23 18:58:31 -07:00
2025-12-29 12:52:40 +01:00
2025-12-29 12:52:40 +01:00
2024-10-30 05:15:42 -07:00
2024-07-09 17:52:36 -07:00
2024-11-17 20:53:44 +02:00
2024-06-10 13:47:21 -07:00
2026-04-05 15:23:22 +02:00
2025-05-04 20:35:57 +08:00
2024-07-14 16:06:36 -07:00
2026-06-01 11:19:42 +02:00
2025-12-18 13:48:52 +02:00
2026-06-09 14:59:36 +02:00
2025-06-30 10:18:26 +02:00
…
2024-05-14 10:56:51 -07:00