Conversation
Summary
- Add explicit
-lmlinkage for the_coreC 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
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
mentioned this pull request
Closed
Labels
None yet