Siyet · GitHub

Conversation

@Siyet

Summary

  • 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

Test plan

Built and verified with ldd on two environments:

Ubuntu 22.04 (WSL2, x86_64, gcc 11.4, Python 3.10):

libm linked?
Without fix No - only libc.so.6
With fix Yes - libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6

Ubuntu 24.04 (WSL2, x86_64, gcc 13.3, Python 3.12):

libm linked?
Without fix No - only libc.so.6
With fix Yes - libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6

Windows 11 (Python 3.12, AMD64):

Confirmed that -lm is not added on win32 - libraries list stays empty. libm is part of MSVC runtime, no explicit linkage needed.

  • CI passes on all platforms

aleksandr.tseluyko

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

@Siyet Siyet mentioned this pull request

Apr 8, 2026

Closed

@jcrist

Labels

None yet

Read the original on github.com ↗