Skip to content

Commit 07f72a5

Browse files
committed
Fix builds on FreeBSD 15
Cython's thread-safe module state lookup uses the C11 threads API on CPython 3.12+. FreeBSD provides that API in libstdthreads, so link against it explicitly. Fixes: #1334
1 parent 1b11846 commit 07f72a5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
# Link against libm (math library) for functions like log10()
3838
LDFLAGS.extend(['-lm'])
3939

40+
if platform.uname().system == 'FreeBSD':
41+
# Cython's thread-safe module state lookup uses the C11 threads API on
42+
# CPython 3.12+. FreeBSD provides that API in libstdthreads.
43+
LDFLAGS.extend(['-lstdthreads'])
44+
4045

4146
_ROOT = pathlib.Path(__file__).parent
4247

0 commit comments

Comments
 (0)