Skip to content

Commit 719a216

Browse files
Siyetaleksandr.tseluykojcrist
authored
Fix missing libm linkage for _core extension on Linux (#993)
Add explicit -lm linkage for the _core C extension on non-Windows platforms. Fixes undefined symbol errors (nextafter, fmod, lround) on aarch64 Linux systems where libm is not implicitly linked. Closes #971 Co-authored-by: aleksandr.tseluyko <[email protected]> Co-authored-by: Jim Crist-Harif <[email protected]>
1 parent b5040d5 commit 719a216

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
@@ -52,10 +52,15 @@
5252
]
5353
)
5454

55+
libraries = []
56+
if sys.platform != "win32":
57+
libraries.append("m")
58+
5559
ext_modules = [
5660
Extension(
5761
"msgspec._core",
5862
[os.path.join("src", "msgspec", "_core.c")],
63+
libraries=libraries,
5964
extra_compile_args=extra_compile_args,
6065
extra_link_args=extra_link_args,
6166
)

0 commit comments

Comments
 (0)